]> BookStack Code Mirror - bookstack/blobdiff - app/Console/Commands/RegenerateCommentContent.php
Fixed local_secure_restricted preventing attachment uploads
[bookstack] / app / Console / Commands / RegenerateCommentContent.php
index 587a5edb310825db0c19c0a71031cb6801cc62d0..3e25dc8a395566f2291f5f06941e5e5b75b08a3e 100644 (file)
@@ -5,6 +5,7 @@ namespace BookStack\Console\Commands;
 use BookStack\Actions\Comment;
 use BookStack\Actions\CommentRepo;
 use Illuminate\Console\Command;
+use Illuminate\Support\Facades\DB;
 
 class RegenerateCommentContent extends Command
 {
@@ -43,9 +44,9 @@ class RegenerateCommentContent extends Command
      */
     public function handle()
     {
-        $connection = \DB::getDefaultConnection();
+        $connection = DB::getDefaultConnection();
         if ($this->option('database') !== null) {
-            \DB::setDefaultConnection($this->option('database'));
+            DB::setDefaultConnection($this->option('database'));
         }
 
         Comment::query()->chunk(100, function ($comments) {
@@ -55,7 +56,9 @@ class RegenerateCommentContent extends Command
             }
         });
 
-        \DB::setDefaultConnection($connection);
+        DB::setDefaultConnection($connection);
         $this->comment('Comment HTML content has been regenerated');
+
+        return 0;
     }
 }