]> _ Git - cubist_cms-back.git/commitdiff
wip #3490 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 11 Mar 2020 18:33:58 +0000 (19:33 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 11 Mar 2020 18:33:58 +0000 (19:33 +0100)
src/app/Console/Commands/CubistCommand.php
src/app/Magic/Models/CubistMagicAuthenticable.php [new file with mode: 0644]

index 2e39184bdd95ee74a5750e46baf8a9804c14edfc..f95e2e4cc5028f0466ce4b9b41c4cd297e1e05d1 100644 (file)
@@ -10,18 +10,27 @@ use Symfony\Component\Process\Process;
 class CubistCommand extends Command
 {
 
+    public function executeProcessQuiet($command)
+    {
+        return $this->executeProcess($command, '', '', false);
+    }
+
+
     /**
      * Run a SSH command.
      *
      * @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
+     * @param bool $output
      *
      * @return mixed Command-line output
      */
-    public function executeProcess($command, $beforeNotice = false, $afterNotice = false)
+    public function executeProcess($command, $beforeNotice = false, $afterNotice = false, $output = true)
     {
-        $this->echo('info', $beforeNotice ? ' ' . $beforeNotice : $command);
+        if ($output) {
+            $this->echo('info', $beforeNotice ? ' ' . $beforeNotice : $command);
+        }
 
         if (is_string($command)) {
             $process = Process::fromShellCommandline($command, null, null, null, 180);
@@ -30,11 +39,13 @@ class CubistCommand extends Command
         }
 
 
-        $process->run(function ($type, $buffer) {
-            if (Process::ERR === $type) {
-                $this->echo('comment', $buffer);
-            } else {
-                $this->echo('line', $buffer);
+        $process->run(function ($type, $buffer) use ($output) {
+            if ($output) {
+                if (Process::ERR === $type) {
+                    $this->echo('comment', $buffer);
+                } else {
+                    $this->echo('line', $buffer);
+                }
             }
         });
 
@@ -43,7 +54,7 @@ class CubistCommand extends Command
             throw new ProcessFailedException($process);
         }
 
-        if ($afterNotice) {
+        if ($afterNotice && $output) {
             $this->echo('info', $afterNotice);
         }
     }
diff --git a/src/app/Magic/Models/CubistMagicAuthenticable.php b/src/app/Magic/Models/CubistMagicAuthenticable.php
new file mode 100644 (file)
index 0000000..4d1dc92
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+
+namespace Cubist\Backpack\app\Magic\Models;
+
+use Illuminate\Auth\Authenticatable;
+use Illuminate\Auth\MustVerifyEmail;
+use Illuminate\Auth\Passwords\CanResetPassword;
+use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
+use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
+use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
+use Illuminate\Foundation\Auth\Access\Authorizable;
+
+class CubistMagicAuthenticable extends CubistMagicAbstractModel
+    implements
+    AuthenticatableContract,
+    AuthorizableContract,
+    CanResetPasswordContract
+{
+    use Authenticatable, Authorizable, CanResetPassword, MustVerifyEmail;
+}