From 73b551cf0481811b07b8c0af4f0138b097afcf90 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Thu, 27 Feb 2020 20:03:19 +1100 Subject: [PATCH] Switch to October Rain assetic --- modules/backend/classes/FormField.php | 4 ++-- modules/backend/routes.php | 2 +- modules/system/aliases.php | 2 +- modules/system/classes/CombineAssets.php | 24 ++++++++++++------------ modules/system/console/OctoberUpdate.php | 1 - 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/modules/backend/classes/FormField.php b/modules/backend/classes/FormField.php index 5f52b5c23..02080a9ca 100644 --- a/modules/backend/classes/FormField.php +++ b/modules/backend/classes/FormField.php @@ -124,7 +124,7 @@ class FormField /** * @var string Specifies a comment to accompany the field */ - public $comment; + public $comment = ''; /** * @var string Specifies the comment position. @@ -139,7 +139,7 @@ class FormField /** * @var string Specifies a message to display when there is no value supplied (placeholder). */ - public $placeholder; + public $placeholder = ''; /** * @var array Contains a list of attributes specified in the field configuration. diff --git a/modules/backend/routes.php b/modules/backend/routes.php index 81904802f..0268f7efc 100644 --- a/modules/backend/routes.php +++ b/modules/backend/routes.php @@ -25,7 +25,7 @@ App::before(function ($request) { 'middleware' => ['web'], 'prefix' => Config::get('cms.backendUri', 'backend') ], function () { - Route::any('{slug}', 'Backend\Classes\BackendController@run')->where('slug', '(.*)?'); + Route::any('{slug?}', 'Backend\Classes\BackendController@run')->where('slug', '(.*)?'); }) ; diff --git a/modules/system/aliases.php b/modules/system/aliases.php index 01a04ec96..314dd0992 100644 --- a/modules/system/aliases.php +++ b/modules/system/aliases.php @@ -16,7 +16,6 @@ return [ 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 'Event' => Illuminate\Support\Facades\Event::class, 'Hash' => Illuminate\Support\Facades\Hash::class, - 'Input' => October\Rain\Support\Facades\Input::class, 'Lang' => Illuminate\Support\Facades\Lang::class, 'Log' => Illuminate\Support\Facades\Log::class, 'Mail' => Illuminate\Support\Facades\Mail::class, @@ -42,6 +41,7 @@ return [ 'Config' => October\Rain\Support\Facades\Config::class, 'Seeder' => October\Rain\Database\Updates\Seeder::class, 'Flash' => October\Rain\Support\Facades\Flash::class, + 'Input' => October\Rain\Support\Facades\Input::class, 'Form' => October\Rain\Support\Facades\Form::class, 'Html' => October\Rain\Support\Facades\Html::class, 'Http' => October\Rain\Support\Facades\Http::class, diff --git a/modules/system/classes/CombineAssets.php b/modules/system/classes/CombineAssets.php index b85826d84..17ec7c2bd 100644 --- a/modules/system/classes/CombineAssets.php +++ b/modules/system/classes/CombineAssets.php @@ -10,11 +10,11 @@ use Route; use Config; use Request; use Response; -use Assetic\Asset\FileAsset; -use Assetic\Asset\AssetCache; -use Assetic\Asset\AssetCollection; -use Assetic\Factory\AssetFactory; -use October\Rain\Parse\Assetic\FilesystemCache; +use October\Rain\Assetic\Asset\FileAsset; +use October\Rain\Assetic\Asset\AssetCache; +use October\Rain\Assetic\Asset\AssetCollection; +use October\Rain\Assetic\Cache\FilesystemCache; +use October\Rain\Assetic\Factory\AssetFactory; use System\Helpers\Cache as CacheHelper; use ApplicationException; use DateTime; @@ -126,22 +126,22 @@ class CombineAssets /* * Register JavaScript filters */ - $this->registerFilter('js', new \October\Rain\Parse\Assetic\JavascriptImporter); + $this->registerFilter('js', new \October\Rain\Assetic\Filter\JavascriptImporter); /* * Register CSS filters */ - $this->registerFilter('css', new \Assetic\Filter\CssImportFilter); - $this->registerFilter(['css', 'less', 'scss'], new \Assetic\Filter\CssRewriteFilter); - $this->registerFilter('less', new \October\Rain\Parse\Assetic\LessCompiler); - $this->registerFilter('scss', new \October\Rain\Parse\Assetic\ScssCompiler); + $this->registerFilter('css', new \October\Rain\Assetic\Filter\CssImportFilter); + $this->registerFilter(['css', 'less', 'scss'], new \October\Rain\Assetic\Filter\CssRewriteFilter); + $this->registerFilter('less', new \October\Rain\Assetic\Filter\LessCompiler); + $this->registerFilter('scss', new \October\Rain\Assetic\Filter\ScssCompiler); /* * Minification filters */ if ($this->useMinify) { - $this->registerFilter('js', new \Assetic\Filter\JSqueezeFilter); - $this->registerFilter(['css', 'less', 'scss'], new \October\Rain\Parse\Assetic\StylesheetMinify); + $this->registerFilter('js', new \October\Rain\Assetic\Filter\JSMinFilter); + $this->registerFilter(['css', 'less', 'scss'], new \October\Rain\Assetic\Filter\StylesheetMinify); } /* diff --git a/modules/system/console/OctoberUpdate.php b/modules/system/console/OctoberUpdate.php index b826fe305..200dcd221 100644 --- a/modules/system/console/OctoberUpdate.php +++ b/modules/system/console/OctoberUpdate.php @@ -17,7 +17,6 @@ use Symfony\Component\Console\Input\InputOption; */ class OctoberUpdate extends Command { - /** * The console command name. */