]> _ Git - cubist_cms-back.git/commitdiff
wip #3491
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 11 Mar 2020 13:52:18 +0000 (14:52 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 11 Mar 2020 13:52:18 +0000 (14:52 +0100)
composer.json
src/app/Console/Commands/CubistCommand.php
src/app/Console/Commands/CubistMagicCommand.php [new file with mode: 0644]
src/app/Console/Commands/GenerateCommand.php
src/app/Console/Commands/MigrateCommand.php
src/app/Console/Commands/SearchIndexCommand.php

index ca78d69eaa92610e6080a8832becb89fd5eb1999..9ff75494a94e88ef79b3cdc93032dbd41f44cf9c 100644 (file)
         "cubist/cms-front": "dev-master",
         "cubist/util": "dev-master",
         "cubist/locale": "dev-master",
+        "cubist/laravel-backpack-dropzone-field": "dev-master",
         "fideloper/proxy": "^4.2",
         "predis/predis": "^1.1",
-        "spatie/laravel-translatable": "^4.2",
-        "venturecraft/revisionable": "^1.33",
-        "cubist/laravel-backpack-dropzone-field": "dev-master",
-        "cviebrock/eloquent-sluggable": "^6.0",
+        "spatie/laravel-translatable": "^4.3",
+        "venturecraft/revisionable": "^1.34",
+        "cviebrock/eloquent-sluggable": "^7.0",
         "lavary/laravel-menu": "^1.7",
-        "graham-campbell/markdown": "^11.0",
+        "graham-campbell/markdown": "^12.0",
         "barryvdh/laravel-debugbar": "^3.2",
         "league/commonmark-ext-autolink": "^1.0",
-        "cviebrock/laravel-elasticsearch": "^4.1",
-        "spatie/laravel-honeypot": "^1.4",
+        "cviebrock/laravel-elasticsearch": "^4.2",
+        "spatie/laravel-honeypot": "^2.1",
         "chrisjean/php-ico": "^1.0",
         "swayok/alternative-laravel-cache": "^5.4"
     },
     "require-dev": {
         "filp/whoops": "^2.7",
-        "laravel/tinker": "^2.1",
+        "laravel/tinker": "^2.2",
         "barryvdh/laravel-ide-helper": "^2.6"
     },
     "extra": {
index 0384e53d104b245007ba2d98aa10fbea5fcc7856..aa3ff2be21c5257dd99c84d073def77c01b34a4b 100644 (file)
@@ -3,12 +3,7 @@
 
 namespace Cubist\Backpack\app\Console\Commands;
 
-
-use Cubist\Backpack\app\Magic\Models\CubistMagicAbstractModel;
-use Cubist\Util\Files\Files;
-use Cubist\Util\PHP;
 use Illuminate\Console\Command;
-use Illuminate\Support\Facades\App;
 use Symfony\Component\Process\Exception\ProcessFailedException;
 use Symfony\Component\Process\Process;
 
@@ -18,7 +13,7 @@ class CubistCommand extends Command
     /**
      * Run a SSH command.
      *
-     * @param string $command The SSH command that needs to be run
+     * @param string|array $command The SSH command that needs to be run
      * @param bool $beforeNotice Information for the user before the command is run
      * @param bool $afterNotice Information for the user after the command is run
      *
@@ -28,7 +23,11 @@ class CubistCommand extends Command
     {
         $this->echo('info', $beforeNotice ? ' ' . $beforeNotice : $command);
 
-        $process = new Process($command, null, null, null, 180, null);
+        if (is_string($command)) {
+            $command = [$command];
+        }
+
+        $process = new Process($command, null, null, null, 180);
         $process->run(function ($type, $buffer) {
             if (Process::ERR === $type) {
                 $this->echo('comment', $buffer);
@@ -60,29 +59,4 @@ class CubistCommand extends Command
             $this->{$type}($content);
         }
     }
-
-    protected function _handleMagicFolder($callback)
-    {
-        $magic = app_path() . '/Models';
-
-        $this->line('Environment ' . App::environment());
-
-        $iterator = Files::getDirectoryIterator($magic, true);
-        foreach ($iterator as $item) {
-            $this->line('Testing ' . $item);
-            /** @var $item \SplFileInfo */
-            if ($item->isFile() && $item->getExtension() == 'php') {
-                try {
-                    $class = PHP::instanciateClassInFile($item);
-                    if ($class instanceof CubistMagicAbstractModel) {
-                        if (is_callable($callback)) {
-                            call_user_func($callback, $class);
-                        }
-                    }
-                } catch (\Exception $e) {
-                    $this->line($e->getMessage());
-                }
-            }
-        }
-    }
 }
diff --git a/src/app/Console/Commands/CubistMagicCommand.php b/src/app/Console/Commands/CubistMagicCommand.php
new file mode 100644 (file)
index 0000000..de6a69f
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+
+
+namespace Cubist\Backpack\app\Console\Commands;
+
+use Cubist\Backpack\app\Magic\Models\CubistMagicAbstractModel;
+use Cubist\Util\Files\Files;
+use Cubist\Util\PHP;
+use Illuminate\Support\Facades\App;
+
+class CubistMagicCommand extends CubistCommand
+{
+    protected function _handleMagicFolder($callback)
+    {
+        $magic = app_path() . '/Models';
+
+        $this->line('Environment ' . App::environment());
+
+        $iterator = Files::getDirectoryIterator($magic, true);
+        foreach ($iterator as $item) {
+            $this->line('Testing ' . $item);
+            /** @var $item \SplFileInfo */
+            if ($item->isFile() && $item->getExtension() == 'php') {
+                try {
+                    $class = PHP::instanciateClassInFile($item);
+                    if ($class instanceof CubistMagicAbstractModel) {
+                        if (is_callable($callback)) {
+                            call_user_func($callback, $class);
+                        }
+                    }
+                } catch (\Exception $e) {
+                    $this->line($e->getMessage());
+                }
+            }
+        }
+    }
+}
index 4191c8511a15b72e2d9dcef776e1afbb545491a3..936fd2dfeb5b99ed7949a70119bfd07925eb3848 100644 (file)
@@ -5,7 +5,7 @@ namespace Cubist\Backpack\app\Console\Commands;
 use Cubist\Backpack\app\Magic\Models\CubistMagicAbstractModel;
 use Cubist\Backpack\app\Magic\Util;
 
-class GenerateCommand extends CubistCommand
+class GenerateCommand extends CubistMagicCommand
 {
     /**
      * The name and signature of the console command.
index 669f7b4308832727be73da682a48e0351327a0ae..1d1469dfb4cd9d460d176561629669ed1ab786ba 100644 (file)
@@ -1,15 +1,13 @@
 <?php
 
+namespace Cubist\Backpack\app\Console\Commands;
 
-namespace Cubist\Backpack\app\Console\Command;
-
-use Cubist\Backpack\app\Console\Commands\CubistCommand;
 use Cubist\Backpack\app\Magic\Models\CubistMagicAbstractModel;
 use Doctrine\DBAL\DriverManager;
 use Doctrine\DBAL\Schema\Comparator;
 use Doctrine\DBAL\Schema\Schema;
 
-class MigrateCommand extends CubistCommand
+class MigrateCommand extends CubistMagicCommand
 {
     /**
      * The name and signature of the console command.
index a573157ca80aefe3fce9712031aed25d7a32c764..38c88190adb5d78268874818cf8b045240a97881 100644 (file)
@@ -3,15 +3,8 @@
 
 namespace Cubist\Backpack\app\Console\Commands;
 
-use Cubist\Backpack\app\Magic\Menu\Menu;
-use Cubist\Backpack\app\Magic\Menu\PageItem;
-use Cubist\Backpack\app\Magic\Menu\VirtualItem;
 use Cubist\Backpack\app\Magic\Search;
-use Cubist\Backpack\app\Template\Navigation;
-use Cubist\Backpack\app\Template\Redirection;
-use Cviebrock\LaravelElasticsearch\Facade as Elasticsearch;
 use Illuminate\Console\Command;
-use Cubist\Util\XML\DOMSelector;
 
 
 class SearchIndexCommand extends Command