From 4d3b3891d0f0d10c0fdf7ae4afa31add04bb8f60 Mon Sep 17 00:00:00 2001 From: Bilal Iqbal Date: Tue, 15 Aug 2017 10:32:08 +0500 Subject: [PATCH 1/5] Updated package namespace --- composer.json | 9 +++++++-- .../StringBladeCompiler/Facades/StringView.php | 0 .../StringBladeCompiler/StringBladeCompiler.php | 0 .../StringBladeCompilerServiceProvider.php | 0 .../StringBladeCompiler/StringView.php | 0 5 files changed, 7 insertions(+), 2 deletions(-) rename src/{Digivo => Bilaliqbalr}/StringBladeCompiler/Facades/StringView.php (100%) rename src/{Digivo => Bilaliqbalr}/StringBladeCompiler/StringBladeCompiler.php (100%) rename src/{Digivo => Bilaliqbalr}/StringBladeCompiler/StringBladeCompilerServiceProvider.php (100%) rename src/{Digivo => Bilaliqbalr}/StringBladeCompiler/StringView.php (100%) diff --git a/composer.json b/composer.json index c9c6a0e..719d163 100755 --- a/composer.json +++ b/composer.json @@ -1,9 +1,14 @@ { - "name": "digivo/laravel-string-blade-compiler", + "name": "bilaliqbalr/laravel-string-blade-compiler", "description": "Render Blade templates from a string", "keywords": ["laravel", "blade", "compiler", "eloquent", "model"], "license": "MIT", "authors": [ + { + "name": "Bilal", + "email": "bilal@phalcosoft.com", + "homepage": "https://phalcosoft.com" + }, { "name": "Digivo", "email": "hello@digivo.co.uk" @@ -23,7 +28,7 @@ }, "autoload": { "psr-0": { - "Digivo\\StringBladeCompiler\\": "src/" + "Bilaliqbalr\\StringBladeCompiler\\": "src/" } }, "minimum-stability": "stable" diff --git a/src/Digivo/StringBladeCompiler/Facades/StringView.php b/src/Bilaliqbalr/StringBladeCompiler/Facades/StringView.php similarity index 100% rename from src/Digivo/StringBladeCompiler/Facades/StringView.php rename to src/Bilaliqbalr/StringBladeCompiler/Facades/StringView.php diff --git a/src/Digivo/StringBladeCompiler/StringBladeCompiler.php b/src/Bilaliqbalr/StringBladeCompiler/StringBladeCompiler.php similarity index 100% rename from src/Digivo/StringBladeCompiler/StringBladeCompiler.php rename to src/Bilaliqbalr/StringBladeCompiler/StringBladeCompiler.php diff --git a/src/Digivo/StringBladeCompiler/StringBladeCompilerServiceProvider.php b/src/Bilaliqbalr/StringBladeCompiler/StringBladeCompilerServiceProvider.php similarity index 100% rename from src/Digivo/StringBladeCompiler/StringBladeCompilerServiceProvider.php rename to src/Bilaliqbalr/StringBladeCompiler/StringBladeCompilerServiceProvider.php diff --git a/src/Digivo/StringBladeCompiler/StringView.php b/src/Bilaliqbalr/StringBladeCompiler/StringView.php similarity index 100% rename from src/Digivo/StringBladeCompiler/StringView.php rename to src/Bilaliqbalr/StringBladeCompiler/StringView.php From cf96914432aeaf5af41fbc546afee78750b20209 Mon Sep 17 00:00:00 2001 From: Bilal Iqbal Date: Tue, 15 Aug 2017 10:38:25 +0500 Subject: [PATCH 2/5] Added php extension to cached file and compatibility problem --- .../StringBladeCompiler/StringBladeCompiler.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Bilaliqbalr/StringBladeCompiler/StringBladeCompiler.php b/src/Bilaliqbalr/StringBladeCompiler/StringBladeCompiler.php index a5ca7ba..3305ef7 100644 --- a/src/Bilaliqbalr/StringBladeCompiler/StringBladeCompiler.php +++ b/src/Bilaliqbalr/StringBladeCompiler/StringBladeCompiler.php @@ -1,5 +1,5 @@ -getEngineResolver()->resolve('blade')->getCompiler(); parent::__construct($filesystem, $cache_path); - $this->rawTags = $blade->getRawTags(); - $this->contentTags = $blade->getContentTags(); - $this->escapedTags = $blade->getEscapedContentTags(); - $this->extensions = $blade->getExtensions(); + $this->rawTags = $blade->rawTags; + $this->contentTags = $blade->contentTags; + $this->escapedTags = $blade->escapedTags; + $this->extensions = $blade->extensions; $this->customDirectives = $blade->getCustomDirectives(); $this->config = $config; } @@ -54,7 +54,7 @@ public function getCompiledPath($path) * * e.g db_table_name_id_4 */ - return $this->cachePath . '/' . md5($path); + return $this->cachePath . '/' . md5($path) . '.php'; } /** From 13c2ccfcfda9121b25a859ac7e60841a29c84f83 Mon Sep 17 00:00:00 2001 From: Bilal Iqbal Date: Tue, 15 Aug 2017 05:44:21 +0000 Subject: [PATCH 3/5] Updated readme.md file --- readme.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index 491d517..70da94d 100755 --- a/readme.md +++ b/readme.md @@ -6,19 +6,19 @@ Originally forked from [Flynsarmy/laravel-db-blade-compiler](https://github.com/ This package generates and returns a compiled view from a provided string -### Installation (Laravel 5.x) +### Installation (Laravel 5.4.x) -Require this package in your composer.json and run composer update (or run `composer require digivo/laravel-string-blade-compiler:1.*` directly): +Require this package in your composer.json and run composer update (or run `composer require bilaliqbalr/laravel-string-blade-compiler:1.*` directly): - "digivo/laravel-string-blade-compiler": "1.*" + "bilaliqbalr/laravel-string-blade-compiler": "1.*" After updating composer, add the ServiceProvider to the providers array in app/config/app.php - 'Digivo\StringBladeCompiler\StringBladeCompilerServiceProvider', + Bilaliqbalr\StringBladeCompiler\StringBladeCompilerServiceProvider::class, and the Facade to the aliases array in the same file - 'StringView' => 'Digivo\StringBladeCompiler\Facades\DigivoView', + 'StringView' => Bilaliqbalr\StringBladeCompiler\Facades\StringView::class, You have to also publish the config-file From d1f2d8212a2c8e5eec6630c94252caf09f5371dd Mon Sep 17 00:00:00 2001 From: Bilal Iqbal Date: Tue, 15 Aug 2017 05:49:29 +0000 Subject: [PATCH 4/5] Updated namespace --- src/Bilaliqbalr/StringBladeCompiler/Facades/StringView.php | 4 ++-- .../StringBladeCompilerServiceProvider.php | 6 +++--- src/Bilaliqbalr/StringBladeCompiler/StringView.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Bilaliqbalr/StringBladeCompiler/Facades/StringView.php b/src/Bilaliqbalr/StringBladeCompiler/Facades/StringView.php index f13268d..e9acf02 100755 --- a/src/Bilaliqbalr/StringBladeCompiler/Facades/StringView.php +++ b/src/Bilaliqbalr/StringBladeCompiler/Facades/StringView.php @@ -1,5 +1,5 @@ -app->booting(function () { $loader = \Illuminate\Foundation\AliasLoader::getInstance(); - $loader->alias('StringView', 'Digivo\StringBladeCompiler\Facades\StringView'); + $loader->alias('StringView', 'Bilaliqbalr\StringBladeCompiler\Facades\StringView'); }); } diff --git a/src/Bilaliqbalr/StringBladeCompiler/StringView.php b/src/Bilaliqbalr/StringBladeCompiler/StringView.php index c3fee3e..7e174c2 100755 --- a/src/Bilaliqbalr/StringBladeCompiler/StringView.php +++ b/src/Bilaliqbalr/StringBladeCompiler/StringView.php @@ -1,5 +1,5 @@ - Date: Tue, 15 Aug 2017 06:05:40 +0000 Subject: [PATCH 5/5] Fix with laravel conflict --- src/Bilaliqbalr/StringBladeCompiler/StringView.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bilaliqbalr/StringBladeCompiler/StringView.php b/src/Bilaliqbalr/StringBladeCompiler/StringView.php index 7e174c2..9ab3400 100755 --- a/src/Bilaliqbalr/StringBladeCompiler/StringView.php +++ b/src/Bilaliqbalr/StringBladeCompiler/StringView.php @@ -55,7 +55,7 @@ public function render(Closure $callback = null) // Once we have the contents of the view, we will flush the sections if we are // done rendering all views so that there is nothing left hanging over when // anothoer view is rendered in the future by the application developers. - View::flushSectionsIfDoneRendering(); + View::flushSections(); return $response ?: $contents; }