From a79ed8d917261e8aa492d6ae02c7882a053e4f78 Mon Sep 17 00:00:00 2001 From: Jerome Pagny Date: Fri, 1 May 2020 16:08:36 +0200 Subject: [PATCH 01/11] Fix bug : method title_case is not longer available since laravel 5.7 Use Str::title method --- src/Console/ThemeGeneratorCommand.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Console/ThemeGeneratorCommand.php b/src/Console/ThemeGeneratorCommand.php index 3bbf420..a2d0f6c 100755 --- a/src/Console/ThemeGeneratorCommand.php +++ b/src/Console/ThemeGeneratorCommand.php @@ -5,6 +5,7 @@ use Illuminate\Config\Repository; use Illuminate\Console\Command; use Illuminate\Filesystem\Filesystem as File; +use Illuminate\Support\Str; class ThemeGeneratorCommand extends Command { @@ -143,10 +144,10 @@ public function consoleAsk() $this->theme['title'] = $this->ask('What is theme title?'); $this->theme['description'] = $this->ask('What is theme description?', false); - $this->theme['description'] = !$this->theme['description'] ? '' : title_case($this->theme['description']); + $this->theme['description'] = !$this->theme['description'] ? '' : Str::title($this->theme['description']); $this->theme['author'] = $this->ask('What is theme author name?', false); - $this->theme['author'] = !$this->theme['author'] ? '' : title_case($this->theme['author']); + $this->theme['author'] = !$this->theme['author'] ? '' : Str::title($this->theme['author']); $this->theme['version'] = $this->ask('What is theme version?', false); $this->theme['version'] = !$this->theme['version'] ? '1.0.0' : $this->theme['version']; From 45bd04437a4f9ba7382c1d82368c498c91293b57 Mon Sep 17 00:00:00 2001 From: Jerome Pagny Date: Fri, 1 May 2020 17:01:04 +0200 Subject: [PATCH 02/11] Fix bug symlink path --- src/Providers/ThemevelServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Providers/ThemevelServiceProvider.php b/src/Providers/ThemevelServiceProvider.php index faf3afb..380b8cb 100755 --- a/src/Providers/ThemevelServiceProvider.php +++ b/src/Providers/ThemevelServiceProvider.php @@ -18,7 +18,7 @@ class ThemevelServiceProvider extends ServiceProvider */ public function boot() { - if (!File::exists(public_path('Themes')) && config('theme.symlink') && File::exists(config('theme.theme_path'))) { + if (!File::exists(public_path('Themes')) && !File::exists(config('theme.symlink_path')) && config('theme.symlink') && File::exists(config('theme.theme_path'))) { App::make('files')->link(config('theme.theme_path'), config('theme.symlink_path', public_path('Themes'))); } } From 130fd3e2a56ae6e02dc388a0ef4484303f1f842b Mon Sep 17 00:00:00 2001 From: Jerome Pagny Date: Fri, 1 May 2020 17:26:06 +0200 Subject: [PATCH 03/11] Fix style ci error --- src/Console/ThemeGeneratorCommand.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Console/ThemeGeneratorCommand.php b/src/Console/ThemeGeneratorCommand.php index a2d0f6c..ed207d0 100755 --- a/src/Console/ThemeGeneratorCommand.php +++ b/src/Console/ThemeGeneratorCommand.php @@ -90,9 +90,9 @@ public function handle() $this->themePath = $this->config->get('theme.theme_path'); $this->theme['name'] = strtolower($this->argument('name')); - if(empty($this->theme['name'])) { + if (empty($this->theme['name'])) { $this->theme['name'] = $this->ask('What is your theme name?'); - if(empty($this->theme['name'])) { + if (empty($this->theme['name'])) { $this->error("Theme is not Generated, Theme name required !!!"); return; } @@ -102,7 +102,7 @@ public function handle() } /** - * Theme Initialize + * Theme Initialize. * * @return void */ @@ -175,8 +175,10 @@ public function createStubs($themeStubFiles, $createdThemePath) } elseif ($filename == 'theme') { $filename = pathinfo($storePath, PATHINFO_EXTENSION); } elseif ($filename == 'css' || $filename == 'js') { - $this->theme[$filename] = ltrim($storePath, - rtrim($this->config->get('theme.folders.assets'), '/').'/'); + $this->theme[$filename] = ltrim( + $storePath, + rtrim($this->config->get('theme.folders.assets'), '/').'/' + ); } $themeStubFile = $this->themeStubPath.'/'.$filename.'.stub'; $this->makeFile($themeStubFile, $createdThemePath.'/'.$storePath); From ae5f2dc72446299dea27f45387772531a0387b8b Mon Sep 17 00:00:00 2001 From: Jerome Pagny Date: Fri, 1 May 2020 17:30:33 +0200 Subject: [PATCH 04/11] Fix style ci error --- src/Console/ThemeGeneratorCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console/ThemeGeneratorCommand.php b/src/Console/ThemeGeneratorCommand.php index ed207d0..c1be0fc 100755 --- a/src/Console/ThemeGeneratorCommand.php +++ b/src/Console/ThemeGeneratorCommand.php @@ -93,7 +93,7 @@ public function handle() if (empty($this->theme['name'])) { $this->theme['name'] = $this->ask('What is your theme name?'); if (empty($this->theme['name'])) { - $this->error("Theme is not Generated, Theme name required !!!"); + $this->error('Theme is not Generated, Theme name required !!!'); return; } } From 549f92b95f3b7790f2408181d7e13a2514317174 Mon Sep 17 00:00:00 2001 From: Jerome Pagny Date: Fri, 1 May 2020 17:32:46 +0200 Subject: [PATCH 05/11] Fix style ci error --- src/Console/ThemeGeneratorCommand.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Console/ThemeGeneratorCommand.php b/src/Console/ThemeGeneratorCommand.php index c1be0fc..07b30df 100755 --- a/src/Console/ThemeGeneratorCommand.php +++ b/src/Console/ThemeGeneratorCommand.php @@ -94,6 +94,7 @@ public function handle() $this->theme['name'] = $this->ask('What is your theme name?'); if (empty($this->theme['name'])) { $this->error('Theme is not Generated, Theme name required !!!'); + return; } } From 36088d8eca20eed3f33cd343514b23883127c38e Mon Sep 17 00:00:00 2001 From: Jerome Pagny Date: Fri, 1 May 2020 17:34:24 +0200 Subject: [PATCH 06/11] Fix style ci error --- src/Console/ThemeGeneratorCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console/ThemeGeneratorCommand.php b/src/Console/ThemeGeneratorCommand.php index 07b30df..2819348 100755 --- a/src/Console/ThemeGeneratorCommand.php +++ b/src/Console/ThemeGeneratorCommand.php @@ -94,7 +94,7 @@ public function handle() $this->theme['name'] = $this->ask('What is your theme name?'); if (empty($this->theme['name'])) { $this->error('Theme is not Generated, Theme name required !!!'); - + return; } } From 0414ec78bdf0b80f6d56226373a59304a328d2a6 Mon Sep 17 00:00:00 2001 From: Jerome Pagny Date: Fri, 1 May 2020 17:40:16 +0200 Subject: [PATCH 07/11] Fix bug getFullPath() method --- src/Managers/Theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Managers/Theme.php b/src/Managers/Theme.php index 157262a..890aa0f 100755 --- a/src/Managers/Theme.php +++ b/src/Managers/Theme.php @@ -204,7 +204,7 @@ public function getFullPath($path) $themeInfo = $this->getThemeInfo($themeName); if ( $this->config[ 'theme.symlink' ] ) { - $themePath = 'Themes'. DIRECTORY_SEPARATOR . $themeName . DIRECTORY_SEPARATOR; + $themePath = str_replace(base_path('public') . DIRECTORY_SEPARATOR, '', $this->config[ 'theme.symlink_path' ]) . DIRECTORY_SEPARATOR; } else { $themePath = str_replace(base_path('public') . DIRECTORY_SEPARATOR, '', $themeInfo->get('path')) . DIRECTORY_SEPARATOR; } From 9620f099bfccaadf4d1a6583b8b3085cd6777763 Mon Sep 17 00:00:00 2001 From: Jerome Pagny Date: Fri, 1 May 2020 17:46:48 +0200 Subject: [PATCH 08/11] Fix style ci error --- src/Managers/Theme.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Managers/Theme.php b/src/Managers/Theme.php index 890aa0f..c2d5f44 100755 --- a/src/Managers/Theme.php +++ b/src/Managers/Theme.php @@ -204,16 +204,17 @@ public function getFullPath($path) $themeInfo = $this->getThemeInfo($themeName); if ( $this->config[ 'theme.symlink' ] ) { - $themePath = str_replace(base_path('public') . DIRECTORY_SEPARATOR, '', $this->config[ 'theme.symlink_path' ]) . DIRECTORY_SEPARATOR; + if ($this->config['theme.symlink']) { ++ $themePath = str_replace(base_path('public').DIRECTORY_SEPARATOR, '', $this->config['theme.symlink_path']).DIRECTORY_SEPARATO; } else { - $themePath = str_replace(base_path('public') . DIRECTORY_SEPARATOR, '', $themeInfo->get('path')) . DIRECTORY_SEPARATOR; + $themePath = str_replace(base_path('public').DIRECTORY_SEPARATOR, '', $themeInfo->get('path')).DIRECTORY_SEPARATOR; } $assetPath = $this->config['theme.folders.assets'].DIRECTORY_SEPARATOR; $fullPath = $themePath.$assetPath.$path; if (!file_exists($fullPath) && $themeInfo->has('parent') && !empty($themeInfo->get('parent'))) { - $themePath = str_replace(base_path().DIRECTORY_SEPARATOR, '', $this->getThemeInfo($themeInfo->get('parent'))->get('path') ).DIRECTORY_SEPARATOR; + $themePath = str_replace(base_path().DIRECTORY_SEPARATOR, '', $this->getThemeInfo($themeInfo->get('parent'))->get('path')).DIRECTORY_SEPARA $fullPath = $themePath.$assetPath.$path; return $fullPath; @@ -226,7 +227,7 @@ public function getFullPath($path) * Get the current theme path to a versioned Mix file. * * @param string $path - * @param string $manifestDirectory + * @param string $manifestDirectory * * @return \Illuminate\Support\HtmlString|string */ From 245635176644cbe93576fa830e90468fa1081d2f Mon Sep 17 00:00:00 2001 From: Jerome Pagny Date: Fri, 1 May 2020 17:48:13 +0200 Subject: [PATCH 09/11] Fix style ci error --- src/Managers/Theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Managers/Theme.php b/src/Managers/Theme.php index c2d5f44..d3fbae8 100755 --- a/src/Managers/Theme.php +++ b/src/Managers/Theme.php @@ -214,7 +214,7 @@ public function getFullPath($path) $fullPath = $themePath.$assetPath.$path; if (!file_exists($fullPath) && $themeInfo->has('parent') && !empty($themeInfo->get('parent'))) { - $themePath = str_replace(base_path().DIRECTORY_SEPARATOR, '', $this->getThemeInfo($themeInfo->get('parent'))->get('path')).DIRECTORY_SEPARA + $themePath = str_replace(base_path().DIRECTORY_SEPARATOR, '', $this->getThemeInfo($themeInfo->get('parent'))->get('path')).DIRECTORY_SEPARATOR; $fullPath = $themePath.$assetPath.$path; return $fullPath; From 8273c1f42e5e78f067424b47f609f73e5a0d45ae Mon Sep 17 00:00:00 2001 From: Jerome Pagny Date: Fri, 1 May 2020 17:50:10 +0200 Subject: [PATCH 10/11] Fix style ci error --- src/Managers/Theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Managers/Theme.php b/src/Managers/Theme.php index d3fbae8..e65418b 100755 --- a/src/Managers/Theme.php +++ b/src/Managers/Theme.php @@ -205,7 +205,7 @@ public function getFullPath($path) if ( $this->config[ 'theme.symlink' ] ) { if ($this->config['theme.symlink']) { -+ $themePath = str_replace(base_path('public').DIRECTORY_SEPARATOR, '', $this->config['theme.symlink_path']).DIRECTORY_SEPARATO; ++ $themePath = str_replace(base_path('public').DIRECTORY_SEPARATOR, '', $this->config['theme.symlink_path']).DIRECTORY_SEPARATOR; } else { $themePath = str_replace(base_path('public').DIRECTORY_SEPARATOR, '', $themeInfo->get('path')).DIRECTORY_SEPARATOR; } From 2ff1ad9e6cf1e6b82207710d3bfcd4fbfab92726 Mon Sep 17 00:00:00 2001 From: Jerome Pagny Date: Fri, 1 May 2020 17:58:59 +0200 Subject: [PATCH 11/11] Fix style ci error + forget to add a 'themeName' in path --- src/Managers/Theme.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Managers/Theme.php b/src/Managers/Theme.php index e65418b..6dd39ca 100755 --- a/src/Managers/Theme.php +++ b/src/Managers/Theme.php @@ -203,9 +203,8 @@ public function getFullPath($path) $themeInfo = $this->getThemeInfo($themeName); - if ( $this->config[ 'theme.symlink' ] ) { - if ($this->config['theme.symlink']) { -+ $themePath = str_replace(base_path('public').DIRECTORY_SEPARATOR, '', $this->config['theme.symlink_path']).DIRECTORY_SEPARATOR; + if ($this->config['theme.symlink']) { + $themePath = str_replace(base_path('public').DIRECTORY_SEPARATOR, '', $this->config['theme.symlink_path']).DIRECTORY_SEPARATOR.$themeName.DIRECTORY_SEPARATOR; } else { $themePath = str_replace(base_path('public').DIRECTORY_SEPARATOR, '', $themeInfo->get('path')).DIRECTORY_SEPARATOR; }