]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5093 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 15 Feb 2022 14:07:21 +0000 (15:07 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 15 Feb 2022 14:07:21 +0000 (15:07 +0100)
15 files changed:
.idea/workspace.xml
app/Http/Controllers/Admin/Operations/Tools/FluidbookAssetsDownloader.php
app/Jobs/Base.php [new file with mode: 0644]
app/Jobs/DownloadBase.php
app/Jobs/GenerateThemePreview.php
app/Jobs/ProcessTotals.php
app/Jobs/Tools/Base.php [new file with mode: 0644]
app/Jobs/Tools/FluidbookAssetsDownloader.php
app/Jobs/UpdateWS2ThemeTable.php
app/Mail/Base.php [new file with mode: 0644]
app/Mail/DeferredDownload.php
app/Mail/FluidbookQuoteAssign.php
app/Mail/FluidbookQuoteReceived.php
composer.lock
resources/views/tools/mail.blade.php [new file with mode: 0644]

index 30b5528283414bed1d2ae171d349d332536635ae..ca9f0aa4983e805cb0b85ffaed762b75d2f57949 100644 (file)
     <select />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="5d2ecd5e-a05a-4f96-a195-fa6372618165" name="Default Changelist" comment="wip #5093 @2">
+    <list default="true" id="5d2ecd5e-a05a-4f96-a195-fa6372618165" name="Default Changelist" comment="wip #5093 @0.25">
+      <change afterPath="$PROJECT_DIR$/app/Jobs/Base.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/app/Jobs/Tools/Base.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/app/Mail/Base.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/resources/views/tools/mail.blade.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/Http/Controllers/Admin/Operations/Tools/FluidbookAssetsDownloader.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Admin/Operations/Tools/FluidbookAssetsDownloader.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/Jobs/DownloadBase.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Jobs/DownloadBase.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/Jobs/GenerateThemePreview.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Jobs/GenerateThemePreview.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/Jobs/ProcessTotals.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Jobs/ProcessTotals.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/app/Jobs/Tools/FluidbookAssetsDownloader.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Jobs/Tools/FluidbookAssetsDownloader.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/Jobs/UpdateWS2ThemeTable.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Jobs/UpdateWS2ThemeTable.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/Mail/DeferredDownload.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Mail/DeferredDownload.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/Mail/FluidbookQuoteAssign.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Mail/FluidbookQuoteAssign.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/Mail/FluidbookQuoteReceived.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Mail/FluidbookQuoteReceived.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/composer.lock" beforeDir="false" afterPath="$PROJECT_DIR$/composer.lock" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1644582031422" duration="8556000" />
       <workItem from="1644828785862" duration="9853000" />
       <workItem from="1644851528057" duration="636000" />
-      <workItem from="1644852994411" duration="9050000" />
-    </task>
-    <task id="LOCAL-00199" summary="wip #4891 @1">
-      <created>1637241915237</created>
-      <option name="number" value="00199" />
-      <option name="presentableId" value="LOCAL-00199" />
-      <option name="project" value="LOCAL" />
-      <updated>1637241915237</updated>
+      <workItem from="1644852994411" duration="9344000" />
+      <workItem from="1644907547410" duration="22676000" />
     </task>
     <task id="LOCAL-00200" summary="wip #4891 @2">
       <created>1637247578195</created>
       <option name="project" value="LOCAL" />
       <updated>1644861865777</updated>
     </task>
-    <option name="localTasksCounter" value="248" />
+    <task id="LOCAL-00248" summary="wip #5093 @0.25">
+      <created>1644862137930</created>
+      <option name="number" value="00248" />
+      <option name="presentableId" value="LOCAL-00248" />
+      <option name="project" value="LOCAL" />
+      <updated>1644862137930</updated>
+    </task>
+    <option name="localTasksCounter" value="249" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
     <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
     <option name="CHECK_NEW_TODO" value="false" />
     <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
-    <MESSAGE value="wait #4928 @0.25" />
     <MESSAGE value="wait #4891 @0.5" />
     <MESSAGE value="wait #4949 @2" />
     <MESSAGE value="wait #4951 @3" />
     <MESSAGE value="wip #5041 @0.25" />
     <MESSAGE value="wip #5041 @1" />
     <MESSAGE value="wip #5093 @2" />
-    <option name="LAST_COMMIT_MESSAGE" value="wip #5093 @2" />
+    <MESSAGE value="wip #5093 @0.25" />
+    <option name="LAST_COMMIT_MESSAGE" value="wip #5093 @0.25" />
   </component>
   <component name="XSLT-Support.FileAssociations.UIState">
     <expand />
index fd208a73e03f78bf0924aead13623c47e4a039c3..47bec6273459e174beb53d891fde52adcbfd84b6 100644 (file)
@@ -6,6 +6,7 @@ use App\Fields\FluidbookID;
 use Cubist\Backpack\Magic\Fields\SelectFromArray;
 use Cubist\Backpack\Magic\Fields\Textarea;
 use Cubist\Backpack\Magic\Form;
+use Prologue\Alerts\Facades\Alert;
 
 trait FluidbookAssetsDownloader
 {
@@ -18,9 +19,9 @@ trait FluidbookAssetsDownloader
         $form->addField(['name' => 'fluidbook',
             'label' => __('Fluidbook de destination'),
             'type' => FluidbookID::class]);
+        $form->addField('folder',SelectFromArray::class,__('Dossier'),['allows_null'=>false,'options'=>['commerce'=>__('Panier / eCommerce'),'working'=>__('Assets et liens')]]);
         $form->addField('url', Textarea::class, __('Liste des urls à télécharger'), ['hint' => __('Une URL par ligne')]);
-        $form->addField('type', SelectFromArray::class, __('Méthode'), ['allows_null' => false, 'options' => ['download' => __('Télécharger les fichier'), 'unzip' => __('Télécharger et dézipper')], 'hint' => __('Dézipper ne conservera pas l\'arborescence des fichiers dans le zip')]);
-
+        $form->addField('type', SelectFromArray::class, __('Méthode'), ['allows_null' => false, 'options' => [ 'unzip' => __('Télécharger et dézipper'),'download' => __('Télécharger les fichier')], 'hint' => __('Dézipper ne conservera pas l\'arborescence des fichiers dans le zip')]);
 
         return view('tools.form', ['form' => $form]);
     }
@@ -28,7 +29,8 @@ trait FluidbookAssetsDownloader
     public function fluidbookassetsdownloaderDownload()
     {
         $request = request();
-        \App\Jobs\Tools\FluidbookAssetsDownloader::dispatch($request->input('url'), $request->input('type'), $request->input('fluidbook'));
-        return redirect($request->input('http_referrer'));
+        \App\Jobs\Tools\FluidbookAssetsDownloader::dispatch($request->input('url'), $request->input('type'), $request->input('fluidbook'), $request->input('folder'),backpack_user());
+        Alert::add('success', __('L\'opération a été placée en file d\'attente. Vous recevrez un email lorsqu\'elle sera terminée.'))->flash();
+        return redirect($request->input('_referrer'));
     }
 }
diff --git a/app/Jobs/Base.php b/app/Jobs/Base.php
new file mode 100644 (file)
index 0000000..c2d1b81
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+
+namespace App\Jobs;
+
+use App\Models\User;
+use Illuminate\Bus\Queueable;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Foundation\Bus\Dispatchable;
+use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Queue\SerializesModels;
+
+class Base implements ShouldQueue
+{
+    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
+
+    protected $jobName = 'job';
+
+    /**
+     * @var User
+     */
+    protected $user;
+
+
+    public function __construct()
+    {
+    }
+
+    /**
+     * @param User $user
+     */
+    public function setUser(User $user): void
+    {
+        $this->user = $user;
+    }
+
+    /**
+     * @return User
+     */
+    public function getUser(): User
+    {
+        return $this->user;
+    }
+
+    /**
+     * @return string
+     */
+    public function getJobName(): string
+    {
+        return $this->jobName;
+    }
+
+    /**
+     * @param string $jobName
+     */
+    public function setJobName(string $jobName): void
+    {
+        $this->jobName = $jobName;
+    }
+}
index 7b373ef5f9945ff7f876a9c8d06cd56fc4cf01e0..2a0695cd3a07919ead6b64441e67dc29e2fee32d 100644 (file)
@@ -7,17 +7,10 @@ use App\Models\User;
 use Cubist\Backpack\Magic\Models\CubistMagicAbstractModel;
 use Cubist\Util\Files\Files;
 use Cubist\Util\Str;
-use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-use Illuminate\Queue\InteractsWithQueue;
-use Illuminate\Queue\SerializesModels;
 use Illuminate\Support\Facades\Mail;
 
-class DownloadBase implements ShouldQueue
+class DownloadBase extends Base
 {
-    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
-
     /**
      * @var string
      */
@@ -28,12 +21,6 @@ class DownloadBase implements ShouldQueue
      */
     protected $entry;
 
-    /**
-     * @var User
-     */
-    protected $user;
-
-
     /**
      * @var string
      */
@@ -47,7 +34,7 @@ class DownloadBase implements ShouldQueue
     public function __construct($entry, $action, $user)
     {
         $this->entry = $entry;
-        $this->user = $user;
+        $this->setUser($user);
         $this->action = $action;
     }
 
index fb576807b775dd0a5e2d92dda3132d8607c517b5..8f94ef478decc108fb4f1392fcd2c7a7faa052bb 100644 (file)
@@ -4,18 +4,9 @@ namespace App\Jobs;
 
 use App\Models\FluidbookTheme;
 use Cubist\Util\CommandLine;
-use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-use Illuminate\Queue\InteractsWithQueue;
-use Illuminate\Queue\SerializesModels;
-use Illuminate\Contracts\Queue;
 
-
-class GenerateThemePreview implements ShouldQueue
+class GenerateThemePreview extends Base
 {
-    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
-
     /**
      * @var FluidbookTheme
      */
index d98f17d0ae200b9d22b1a96da2be37d0a2f8a8bc..cbd185368248746419739c9495ea6b58250601c9 100644 (file)
@@ -5,17 +5,12 @@ namespace App\Jobs;
 use App\Models\Company;
 use App\Models\FluidbookQuote;
 use App\Models\User;
-use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-use Illuminate\Queue\InteractsWithQueue;
-use Illuminate\Queue\SerializesModels;
 use Illuminate\Support\Facades\Artisan;
 use Illuminate\Support\Facades\DB;
 
-class ProcessTotals implements ShouldQueue
+class ProcessTotals extends Base
 {
-    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
+
 
     protected $projects = [];
     protected $companies = [];
diff --git a/app/Jobs/Tools/Base.php b/app/Jobs/Tools/Base.php
new file mode 100644 (file)
index 0000000..b43e5f5
--- /dev/null
@@ -0,0 +1,161 @@
+<?php
+
+namespace App\Jobs\Tools;
+
+use App\Models\User;
+use Cubist\Util\CommandLine;
+use Cubist\Util\Files\Files;
+use Illuminate\Support\Facades\Mail;
+use Monolog\ErrorHandler;
+use Monolog\Handler\StreamHandler;
+use Monolog\Logger;
+
+class Base extends \App\Jobs\Base
+{
+
+    /**
+     * @var \App\Mail\Base
+     */
+    protected $mail;
+
+    /**
+     * @var Logger
+     */
+    protected $logger;
+
+    /**
+     * @var string
+     */
+    protected $logfile;
+
+    protected $mailSent = false;
+    protected $ended = false;
+    protected $started = false;
+
+    protected $tries = 1;
+
+    public function __construct()
+    {
+        parent::__construct();
+
+        $this->logger = new Logger('job');
+        $this->logfile = Files::tempnam();
+        $this->logger->pushHandler(new StreamHandler($this->logfile));
+
+        $errorHandler = new ErrorHandler($this->logger);
+        $errorHandler->registerErrorHandler([], false);
+        $errorHandler->registerExceptionHandler([], false);
+        $errorHandler->registerFatalHandler();
+
+        $this->mail = new \App\Mail\Base();
+    }
+
+    public function log($str)
+    {
+        if ($str instanceof CommandLine) {
+            try {
+                $l = $str->getCommand() . ' /// ' . $str->getOutput();
+                $str = $l;
+                $this->logger->debug($str);
+            } catch (\Exception $e) {
+                $this->logger->critical($e);
+            }
+            return;
+        }
+        $this->logger->debug($str);
+    }
+
+    public function handle()
+    {
+        $this->logger->info(__('Démarrage de la tâche'));
+        $this->started = true;
+        try {
+            $this->run();
+            $this->logger->info(__('Tâche terminée sans erreur'));
+        } catch (\Exception $exception) {
+            $this->logger->critical($exception);
+        }
+        $this->endJob();
+    }
+
+    protected function run()
+    {
+
+    }
+
+    public function endJob()
+    {
+        if (!$this->started) {
+            return;
+        }
+        if ($this->ended) {
+            return;
+        }
+        $this->ended = true;
+        $this->logger->info(__('Fin de la tâche'));
+        $this->sendEmail();
+        $this->logger->close();
+        if (file_exists($this->logfile)) {
+            unlink($this->logfile);
+        }
+    }
+
+    /**
+     * @param User $user
+     */
+    public function setUser(User $user): void
+    {
+        parent::setUser($user);
+        $this->mail->setUser($user);
+    }
+
+    public function sendEmail()
+    {
+        if (!$this->started || $this->mailSent) {
+            return;
+        }
+
+        $this->mailSent = true;
+        $this->mail->html(view('tools.mail', ['logs' => $this->getLogContents()])->render());
+        $this->mail->subject(__('Résultat de la tâche « :jobname »', ['jobname' => $this->getJobName()]));
+        Mail::send($this->mail);
+    }
+
+    public function __destruct()
+    {
+        $this->endJob();
+
+    }
+
+    /**
+     * @return false|string
+     */
+    public function getLogContents()
+    {
+
+        if (file_exists($this->logfile)) {
+            return file_get_contents($this->logfile);
+        }
+        return '';
+    }
+
+    /**
+     * @return Logger
+     */
+    public function getLogger(): Logger
+    {
+        return $this->logger;
+    }
+
+    /**
+     * The job failed to process.
+     *
+     * @param \Exception $exception
+     * @return void
+     */
+    public function failed(\Exception $exception)
+    {
+        $this->logger->critical($exception);
+        $this->endJob();
+    }
+}
index 4c2ed58ef237cafcaea48c2552f02f089d2c05a2..53596fc26e98fc070deb64a3f2f3a73234b3f2b8 100644 (file)
@@ -3,37 +3,43 @@
 namespace App\Jobs\Tools;
 
 use Cubist\Util\Files\Files;
+use Cubist\Util\PHP;
 use Cubist\Util\Text;
 use Cubist\Util\Zip;
 use GuzzleHttp\Client;
-use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-use Illuminate\Queue\InteractsWithQueue;
-use Illuminate\Queue\SerializesModels;
 
-class FluidbookAssetsDownloader implements ShouldQueue
-{
-    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
 
+class FluidbookAssetsDownloader extends Base
+{
     protected $lines;
     protected $type;
     protected $dest;
 
-    public function __construct($url, $type, $fluidbook)
+    protected $timeout = 7200;
+
+    public function __construct($url, $type, $fluidbook, $folder, $user)
     {
+        parent::__construct();
         if (!$fluidbook) {
             throw new \Exception('Fluidbook has not be set');
         }
+        $this->setJobName(__('Téléchargement massif d\'assets dans un fluidbook'));
         $this->dest = '/home/extranet/www/fluidbook/books/working/' . $fluidbook . '/';
+        if ($folder !== 'working') {
+            $this->dest .= $folder . '/';
+        }
         $this->lines = Text::explodeNewLines($url);
         $this->type = $type;
-
+        $this->setUser($user);
     }
 
-    public function handle()
+    protected function run()
     {
+        PHP::neverStop();
+        $this->getLogger()->info(__('Répertoire de destination') . ': ' . $this->dest);
+        $this->getLogger()->info(__('Méthode') . ': ' . $this->type);
         foreach ($this->lines as $line) {
+            $this->logger->info(__('Téléchargement de l\'url') . ': ' . $line);
             $this->_downloadFile($line);
         }
     }
@@ -42,6 +48,7 @@ class FluidbookAssetsDownloader implements ShouldQueue
     {
         $originalURL = $u = trim($url);
         if (!$u) {
+            $this->logger->warning(__('URL vide'));
             return;
         }
         $hash = hash('sha256', $originalURL);
@@ -54,38 +61,62 @@ class FluidbookAssetsDownloader implements ShouldQueue
         try {
             $response = $client->get($u, ['sink' => $tmp]);
         } catch (\Exception $e) {
-            dd($e);
+            $this->logger->error($e);
+            return;
+        }
+
+        if ($response->hasHeader('Content-Type')) {
+            $e = explode(';', $response->getHeader('Content-Type')[0]);
+            $contentType = $e[0];
+        } else {
+            $contentType = 'application/octet-stream';
         }
-        if ($response->hasHeader('Content-Disposition')) {
-            if (preg_match('/filename="(.*)"/', $response->getHeader('Content-Disposition'), $matches)) {
-                $filename = $matches[1];
+
+        $this->logger->info(__('Type du fichier téléchargé') . ': ' . $contentType);
+
+        if ($response->hasHeader('Content-Disposition') && preg_match('/filename="(.*)"/', $response->getHeader('Content-Disposition')[0], $matches)) {
+            $filename = $matches[1];
+            $this->logger->info(__('Nom du fichier téléchargé') . ': ' . $filename);
+            if ($contentType === 'binary/octet-stream' || $contentType === 'application/octet-stream') {
+                $contentType = Files::getMimeType($filename);
+                $this->logger->info(__('Type de fichier déduit du nom de fichier') . ': ' . $contentType);
             }
-        } else if ($response->hasHeader('Content-Type')) {
+        }
 
-            $ct = $response->getHeader('Content-Type')[0];
-            $e = explode(';', $ct);
-            $ct = $e[0];
 
-            if ($ct === 'text/html') {
-                if (preg_match('/https:\/\/bynder[^"]+/', file_get_contents($tmp), $matches)) {
-                    unlink($tmp);
-                    return $this->_downloadFile(html_entity_decode($matches[0]), $client);
-                }
+        if ($contentType === 'text/html') {
+            $this->log(__('Détection d\'une page html'));
+            if (preg_match('/https:\/\/bynder[^"]+/', file_get_contents($tmp), $matches)) {
+                $this->log(__('Détection d\'un lien bynder') . ': ' . $matches[0]);
+                unlink($tmp);
+                return $this->_downloadFile(html_entity_decode($matches[0]), $client);
             }
+        }
 
+
+        if (!isset($filename)) {
             $filename = $hash;
-            if ($ct !== 'application/octet-stream') {
-                $ext = Files::getExtensionByMimeType($ct);
+            if ($contentType !== 'application/octet-stream') {
+                $ext = Files::getExtensionByMimeType($contentType);
                 if ($ext) {
                     $filename .= '.' . $ext;
                 }
             }
         }
-        if ($this->type === 'download') {
+
+        if ($this->type === 'download' || $contentType !== 'application/zip') {
+            if (file_exists($this->dest . $filename)) {
+                unlink($this->dest . $filename);
+            }
             rename($tmp, $this->dest . $filename);
+            $this->log(__('URL téléchargé') . ': ' . $filename);
         } else if ($this->type === 'unzip') {
-            Zip::extract($tmp, $this->dest, true);
-            unlink($tmp);
+            $cl = Zip::extract($tmp, $this->dest, true);
+            $this->log($cl);
+            $this->log(__('URL téléchargé et dézippé') . ': ' . $tmp);
+            if (file_exists($tmp)) {
+                unlink($tmp);
+            }
         }
     }
 }
index 9b5217f0c39c9b1cfd842aca22e88396ac89a26c..d0f8da06a36e42d679dc4da4b5064b1ab7a4f43f 100644 (file)
@@ -7,19 +7,12 @@ namespace App\Jobs;
 use App\Models\FluidbookTheme;
 use Cubist\Backpack\Magic\Fields\Color;
 use Cubist\Backpack\Magic\Fields\Files;
-use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-use Illuminate\Queue\InteractsWithQueue;
-use Illuminate\Queue\SerializesModels;
 use Illuminate\Support\Facades\DB;
 use Spatie\MediaLibrary\MediaCollections\Models\Media;
 
-class UpdateWS2ThemeTable implements ShouldQueue
+class UpdateWS2ThemeTable extends Base
 {
-    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
-
-    protected $id = 'all';
+        protected $id = 'all';
 
     protected $_fileFields = [];
     protected $_colorFields = [];
diff --git a/app/Mail/Base.php b/app/Mail/Base.php
new file mode 100644 (file)
index 0000000..12868de
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+namespace App\Mail;
+
+use App\Models\User;
+use Illuminate\Bus\Queueable;
+use Illuminate\Mail\Mailable;
+use Illuminate\Queue\SerializesModels;
+
+class Base extends Mailable
+{
+    use Queueable, SerializesModels;
+
+    public function build()
+    {
+        return $this;
+    }
+
+
+    /**
+     * @param $user User
+     * @return void
+     */
+
+    public function setUser($user)
+    {
+        $this->to($user->email);
+    }
+}
index 359e2f8cd13a28c265c24fd10b21a73ed87cc9c0..677a898e5d350e4cb30d9339194e5d262890f4ed 100644 (file)
@@ -2,17 +2,8 @@
 
 namespace App\Mail;
 
-use Illuminate\Bus\Queueable;
-use Illuminate\Mail\Mailable;
-use Illuminate\Queue\SerializesModels;
 
-class DeferredDownload extends Mailable
+class DeferredDownload extends Base
 {
-    use Queueable, SerializesModels;
-
-    public function build()
-    {
-        return $this;
-    }
 
 }
index ffb26b0103e36f43fcac6e98b25c8aac98a92624..99218c2958f515dafa9478db4df980cc45829c25 100644 (file)
@@ -9,30 +9,8 @@ use Illuminate\Bus\Queueable;
 use Illuminate\Mail\Mailable;
 use Illuminate\Queue\SerializesModels;
 
-class FluidbookQuoteAssign extends Mailable
+class FluidbookQuoteAssign extends Base
 {
-    use Queueable, SerializesModels;
-
-    /**
-     * Create a new message instance.
-     *
-     * @return void
-     */
-    public function __construct()
-    {
-        //
-    }
-
-    /**
-     * Build the message.
-     *
-     * @return $this
-     */
-    public function build()
-    {
-        return $this;
-    }
-
     public function setQuote(FluidbookQuote $quote)
     {
         $this->from('tech@fluidbook.com');
index 3b3e7626d94ec024e0635d9b94d38348ebd2e404..a23d91a09f135f9e5bb61e62155a58c04960aa7b 100644 (file)
@@ -7,29 +7,8 @@ use Illuminate\Bus\Queueable;
 use Illuminate\Mail\Mailable;
 use Illuminate\Queue\SerializesModels;
 
-class FluidbookQuoteReceived extends Mailable
+class FluidbookQuoteReceived extends Base
 {
-    use Queueable, SerializesModels;
-
-    /**
-     * Create a new message instance.
-     *
-     * @return void
-     */
-    public function __construct()
-    {
-        //
-    }
-
-    /**
-     * Build the message.
-     *
-     * @return $this
-     */
-    public function build()
-    {
-        return $this;
-    }
 
     public function setData($post)
     {
index cc16d1041cc7bb6db758eb9084e08e7b08e23881..94e7985017175472770e2acfcfe1bd0218c6194f 100644 (file)
         },
         {
             "name": "backpack/revise-operation",
-            "version": "1.0.9",
+            "version": "1.0.10",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Laravel-Backpack/revise-operation.git",
-                "reference": "768b84206d3cd8589b18aa4948e9a57e145dec73"
+                "reference": "eb0401021fc784e35a948d5a56040279b82c4d68"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Laravel-Backpack/revise-operation/zipball/768b84206d3cd8589b18aa4948e9a57e145dec73",
-                "reference": "768b84206d3cd8589b18aa4948e9a57e145dec73",
+                "url": "https://api.github.com/repos/Laravel-Backpack/revise-operation/zipball/eb0401021fc784e35a948d5a56040279b82c4d68",
+                "reference": "eb0401021fc784e35a948d5a56040279b82c4d68",
                 "shasum": ""
             },
             "require": {
             ],
             "support": {
                 "issues": "https://github.com/Laravel-Backpack/revise-operation/issues",
-                "source": "https://github.com/Laravel-Backpack/revise-operation/tree/1.0.9"
+                "source": "https://github.com/Laravel-Backpack/revise-operation/tree/1.0.10"
             },
-            "time": "2022-02-04T12:13:11+00:00"
+            "time": "2022-02-15T10:28:11+00:00"
         },
         {
             "name": "barryvdh/laravel-debugbar",
             "source": {
                 "type": "git",
                 "url": "git://git.cubedesigners.com/cubist_cms-back.git",
-                "reference": "f22c689cd1b6719cad3dc5e106f70dd319d7b5a4"
+                "reference": "7c920308acda0ff2a1b1cb6667af6ea2edfca67a"
             },
             "dist": {
                 "type": "tar",
-                "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-513de9.tar",
-                "reference": "f22c689cd1b6719cad3dc5e106f70dd319d7b5a4",
-                "shasum": "df721ab96e90ec034f03c0c48b466414e0ed6499"
+                "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-ebb0b0.tar",
+                "reference": "7c920308acda0ff2a1b1cb6667af6ea2edfca67a",
+                "shasum": "b8cb4531c06f06f9ecdc67d8dd928c48c9e8f00a"
             },
             "require": {
                 "backpack/backupmanager": "^3.0",
                 }
             ],
             "description": "Cubist Backpack extension",
-            "time": "2022-02-08T19:07:47+00:00"
+            "time": "2022-02-14T18:14:09+00:00"
         },
         {
             "name": "cubist/cms-front",
             "source": {
                 "type": "git",
                 "url": "git://git.cubedesigners.com/cubist_util.git",
-                "reference": "d59ad370ec7c47a86ba1e0b37c3378776a038c3e"
+                "reference": "9b1ac0f4a6024609bc69681e6596fdf9966735c5"
             },
             "dist": {
                 "type": "tar",
-                "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-629160.tar",
-                "reference": "d59ad370ec7c47a86ba1e0b37c3378776a038c3e",
-                "shasum": "de76d09afba9ac9a0166156790473e2796afe264"
+                "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-a2af29.tar",
+                "reference": "9b1ac0f4a6024609bc69681e6596fdf9966735c5",
+                "shasum": "3d0720991ee4ed89f48585b97bedb63d1c0041e9"
             },
             "require": {
                 "cubist/net": "dev-master",
                 }
             ],
             "description": "Utilities class",
-            "time": "2022-01-31T14:13:14+00:00"
+            "time": "2022-02-14T18:04:41+00:00"
         },
         {
             "name": "cviebrock/eloquent-sluggable",
                 }
             },
             "autoload": {
-                "psr-4": {
-                    "GuzzleHttp\\": "src/"
-                },
                 "files": [
                     "src/functions_include.php"
-                ]
+                ],
+                "psr-4": {
+                    "GuzzleHttp\\": "src/"
+                }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
         },
         {
             "name": "maximebf/debugbar",
-            "version": "v1.17.3",
+            "version": "v1.18.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/maximebf/php-debugbar.git",
-                "reference": "e8ac3499af0ea5b440908e06cc0abe5898008b3c"
+                "reference": "0d44b75f3b5d6d41ae83b79c7a4bceae7fbc78b6"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/e8ac3499af0ea5b440908e06cc0abe5898008b3c",
-                "reference": "e8ac3499af0ea5b440908e06cc0abe5898008b3c",
+                "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/0d44b75f3b5d6d41ae83b79c7a4bceae7fbc78b6",
+                "reference": "0d44b75f3b5d6d41ae83b79c7a4bceae7fbc78b6",
                 "shasum": ""
             },
             "require": {
                 "php": "^7.1|^8",
                 "psr/log": "^1|^2|^3",
-                "symfony/var-dumper": "^2.6|^3|^4|^5"
+                "symfony/var-dumper": "^2.6|^3|^4|^5|^6"
             },
             "require-dev": {
-                "phpunit/phpunit": "^7.5.20 || ^9.4.2"
+                "phpunit/phpunit": "^7.5.20 || ^9.4.2",
+                "twig/twig": "^1.38|^2.7|^3.0"
             },
             "suggest": {
                 "kriswallsmith/assetic": "The best way to manage assets",
             ],
             "support": {
                 "issues": "https://github.com/maximebf/php-debugbar/issues",
-                "source": "https://github.com/maximebf/php-debugbar/tree/v1.17.3"
+                "source": "https://github.com/maximebf/php-debugbar/tree/v1.18.0"
             },
-            "time": "2021-10-19T12:33:27+00:00"
+            "time": "2021-12-27T18:49:48+00:00"
         },
         {
             "name": "maxmind-db/reader",
         },
         {
             "name": "mobiledetect/mobiledetectlib",
-            "version": "2.8.37",
+            "version": "2.8.38",
             "source": {
                 "type": "git",
                 "url": "https://github.com/serbanghita/Mobile-Detect.git",
-                "reference": "9841e3c46f5bd0739b53aed8ac677fa712943df7"
+                "reference": "b6c4ac9686d204c49a432f527f137cf24ac0b90e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/9841e3c46f5bd0739b53aed8ac677fa712943df7",
-                "reference": "9841e3c46f5bd0739b53aed8ac677fa712943df7",
+                "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/b6c4ac9686d204c49a432f527f137cf24ac0b90e",
+                "reference": "b6c4ac9686d204c49a432f527f137cf24ac0b90e",
                 "shasum": ""
             },
             "require": {
             ],
             "support": {
                 "issues": "https://github.com/serbanghita/Mobile-Detect/issues",
-                "source": "https://github.com/serbanghita/Mobile-Detect/tree/2.8.37"
+                "source": "https://github.com/serbanghita/Mobile-Detect/tree/2.8.38"
             },
-            "funding": [
-                {
-                    "url": "https://github.com/serbanghita",
-                    "type": "github"
-                }
-            ],
-            "time": "2021-02-19T21:22:57+00:00"
+            "time": "2022-02-14T12:38:04+00:00"
         },
         {
             "name": "monolog/monolog",
                 }
             },
             "autoload": {
-                "psr-4": {
-                    "BladeUI\\Icons\\": "src"
-                },
                 "files": [
                     "src/helpers.php"
-                ]
+                ],
+                "psr-4": {
+                    "BladeUI\\Icons\\": "src"
+                }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
         },
         {
             "name": "react/promise",
-            "version": "v2.8.0",
+            "version": "v2.9.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/reactphp/promise.git",
-                "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4"
+                "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4",
-                "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4",
+                "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910",
+                "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910",
                 "shasum": ""
             },
             "require": {
                 "php": ">=5.4.0"
             },
             "require-dev": {
-                "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36"
+                "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36"
             },
             "type": "library",
             "autoload": {
             "authors": [
                 {
                     "name": "Jan Sorgalla",
-                    "email": "jsorgalla@gmail.com"
+                    "email": "jsorgalla@gmail.com",
+                    "homepage": "https://sorgalla.com/"
+                },
+                {
+                    "name": "Christian Lück",
+                    "email": "christian@clue.engineering",
+                    "homepage": "https://clue.engineering/"
+                },
+                {
+                    "name": "Cees-Jan Kiewiet",
+                    "email": "reactphp@ceesjankiewiet.nl",
+                    "homepage": "https://wyrihaximus.net/"
+                },
+                {
+                    "name": "Chris Boden",
+                    "email": "cboden@gmail.com",
+                    "homepage": "https://cboden.dev/"
                 }
             ],
             "description": "A lightweight implementation of CommonJS Promises/A for PHP",
             ],
             "support": {
                 "issues": "https://github.com/reactphp/promise/issues",
-                "source": "https://github.com/reactphp/promise/tree/v2.8.0"
+                "source": "https://github.com/reactphp/promise/tree/v2.9.0"
             },
-            "time": "2020-05-12T15:16:56+00:00"
+            "funding": [
+                {
+                    "url": "https://github.com/WyriHaximus",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/clue",
+                    "type": "github"
+                }
+            ],
+            "time": "2022-02-11T10:27:51+00:00"
         },
         {
             "name": "rustici-software/scormcloud-api-v2-client-php",
                 }
             },
             "autoload": {
-                "psr-4": {
-                    "Spatie\\Backup\\": "src"
-                },
                 "files": [
                     "src/Helpers/functions.php"
-                ]
+                ],
+                "psr-4": {
+                    "Spatie\\Backup\\": "src"
+                }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
                 }
             },
             "autoload": {
-                "psr-4": {
-                    "Spatie\\Permission\\": "src"
-                },
                 "files": [
                     "src/helpers.php"
-                ]
+                ],
+                "psr-4": {
+                    "Spatie\\Permission\\": "src"
+                }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
                 }
             },
             "autoload": {
-                "psr-4": {
-                    "Symfony\\Polyfill\\Mbstring\\": ""
-                },
                 "files": [
                     "bootstrap.php"
-                ]
+                ],
+                "psr-4": {
+                    "Symfony\\Polyfill\\Mbstring\\": ""
+                }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
                 }
             },
             "autoload": {
-                "psr-4": {
-                    "Facade\\FlareClient\\": "src"
-                },
                 "files": [
                     "src/helpers.php"
-                ]
+                ],
+                "psr-4": {
+                    "Facade\\FlareClient\\": "src"
+                }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
         },
         {
             "name": "sebastian/global-state",
-            "version": "3.0.1",
+            "version": "3.0.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/global-state.git",
-                "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b"
+                "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/474fb9edb7ab891665d3bfc6317f42a0a150454b",
-                "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b",
+                "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/de036ec91d55d2a9e0db2ba975b512cdb1c23921",
+                "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921",
                 "shasum": ""
             },
             "require": {
             ],
             "support": {
                 "issues": "https://github.com/sebastianbergmann/global-state/issues",
-                "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.1"
+                "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.2"
             },
             "funding": [
                 {
                     "type": "github"
                 }
             ],
-            "time": "2020-11-30T07:43:24+00:00"
+            "time": "2022-02-10T06:55:38+00:00"
         },
         {
             "name": "sebastian/object-enumerator",
diff --git a/resources/views/tools/mail.blade.php b/resources/views/tools/mail.blade.php
new file mode 100644 (file)
index 0000000..5950b54
--- /dev/null
@@ -0,0 +1,3 @@
+<pre>
+{{$logs}}
+</pre>