]> _ Git - cubist_cms-back.git/commitdiff
#2783
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 May 2019 17:17:33 +0000 (19:17 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 May 2019 17:17:33 +0000 (19:17 +0200)
src/app/Console/Commands/MagicCubistCommand.php
src/app/Magic/Models/CubistMagicModelAbstract.php
src/resources/cubistmagic/Controller.stub

index 434b91c1f109a8c37a2a2a3993f8a68d3714948f..d7afaf98677443e6f7f7443337b44638cacdb492 100644 (file)
@@ -75,7 +75,7 @@ class MagicCubistCommand extends Command
     {
         $this->echo('info', $beforeNotice ? ' ' . $beforeNotice : $command);
 
-        $process = new Process($command, null, null, null, $this->option('timeout'), null);
+        $process = new Process($command, null, null, null, 50, null);
         $process->run(function ($type, $buffer) {
             if (Process::ERR === $type) {
                 $this->echo('comment', $buffer);
index 170a36c575c7ce0cbc62c35d820757a8cbf372e9..03944a41dfc863768cfcefa6af3727064a376e99 100644 (file)
@@ -30,7 +30,8 @@ class CubistMagicModelAbstract extends Model
         $this->init();
     }
 
-    public function init(){
+    public function init()
+    {
 
     }
 
@@ -72,7 +73,7 @@ class CubistMagicModelAbstract extends Model
     protected function _generateControllerCode()
     {
         $this->_replaceInCode($this->_getStubPath() . 'Controller.stub',
-            app_path() . '/Http/Controllers/' . $this->getCamelName() . 'CubistMagicController.php');
+            app_path() . '/Http/Controllers/Admin/CubistMagic/' . $this->getCamelName() . 'CubistMagicController.php');
     }
 
 
@@ -91,6 +92,10 @@ class CubistMagicModelAbstract extends Model
             $res = str_replace('_' . $name . '_', $value, $res);
         }
 
+        if (!file_exists(dirname($dest))) {
+            mkdir(dirname($dest), 0777, true);
+        }
+
         file_put_contents($dest, $res);
     }
 
index 2d5deb3a57a20716f161ac027936c91449d548bb..e11f6103610b222eb5a8de4137f8c5ca4a67bf5e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-namespace App\Htpp\Controllers\CubistMagic;
+namespace App\Htpp\Controllers\Admin\CubistMagic;
 
 class _CAMELNAME_CubistMagicController extends CubistMagicController
 {