From 1b5e061188a2a3dec34a623e4d022046a149004d Mon Sep 17 00:00:00 2001 From: Anthony Lawrence Date: Mon, 21 Dec 2015 16:13:52 +0000 Subject: [PATCH 1/8] Laravel 5 Compatability --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index deb803e..bed7c8c 100644 --- a/composer.json +++ b/composer.json @@ -19,8 +19,8 @@ "wiki": "https://github.com/A-Lawrence/VatsimXML/wiki" }, "require": { - "php": ">=5.4.0", - "illuminate/support": "4.2.*" + "php": ">=5.5.9", + "illuminate/support": "5.*" }, "autoload": { "classmap": [ From 3776fd340b58954b89bf046baba825d87412ce9b Mon Sep 17 00:00:00 2001 From: Anthony Lawrence Date: Mon, 21 Dec 2015 16:14:54 +0000 Subject: [PATCH 2/8] Laravel 5 Compatability --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c774d89..5723296 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ VatsimXMLFeeds ========= -The Vatsim Xmlfeeds package is a useful laravel package for accessing data publically presented via VATSIMs XML feeds. +The Vatsim Xmlfeeds package is a useful laravel 5 package for accessing data publically presented via VATSIMs XML feeds. Version ---- -1.0 +2.0 Installation -------------- @@ -14,12 +14,12 @@ Installation Use [Composer](http://getcomposer.org) to install the VatsimXML and dependencies. ```sh -$ composer require vatsim/xml 1.* +$ composer require vatsim/xml 2.* ``` ### Laravel #### Set up -Using VatsimXML in Laravel is made easy through the use of Service Providers. Add the service provider to your `app/config/app.php` file: +Using VatsimXML in Laravel is made easy through the use of Service Providers. Add the service provider to your `config/app.php` file: ```php 'providers' => array( // ... From cf1300b4ae84c33a9feedfdccbf8627c37c1a83d Mon Sep 17 00:00:00 2001 From: Anthony Lawrence Date: Mon, 21 Dec 2015 16:17:18 +0000 Subject: [PATCH 3/8] Laravel 5 Compatability --- src/Vatsim/Xml/XmlServiceProvider.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Vatsim/Xml/XmlServiceProvider.php b/src/Vatsim/Xml/XmlServiceProvider.php index 3f98a3f..39c668c 100644 --- a/src/Vatsim/Xml/XmlServiceProvider.php +++ b/src/Vatsim/Xml/XmlServiceProvider.php @@ -10,6 +10,10 @@ class XmlServiceProvider extends ServiceProvider { * @var bool */ protected $defer = false; + + public function dir($path){ + return __DIR__."/../../".$path; + } /** * Bootstrap the application events. @@ -18,7 +22,8 @@ class XmlServiceProvider extends ServiceProvider { */ public function boot() { - $this->package('vatsim/xml'); + $this->publishes([ + $this->dir("config/config.php") => config_path("vatsim-xml.php"), } /** @@ -30,7 +35,7 @@ public function register() { $this->app['vatsimxml'] = $this->app->share(function($app) { - return new XML( $app['config']->get('xml::config') ); + return new XML( $app['config']->get('vatsim-xml.config') ); }); } From b128e6949711abfbdec9dbff7a5ce5380b68f9c3 Mon Sep 17 00:00:00 2001 From: Anthony Lawrence Date: Mon, 21 Dec 2015 16:18:21 +0000 Subject: [PATCH 4/8] Update composer.json --- composer.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/composer.json b/composer.json index bed7c8c..34eb632 100644 --- a/composer.json +++ b/composer.json @@ -23,9 +23,6 @@ "illuminate/support": "5.*" }, "autoload": { - "classmap": [ - "src/migrations" - ], "psr-0": { "Vatsim\\Xml\\": "src/" } From a27e9bc552832eb90311551525db4037876619a8 Mon Sep 17 00:00:00 2001 From: Anthony Lawrence Date: Mon, 21 Dec 2015 16:26:26 +0000 Subject: [PATCH 5/8] Update XmlServiceProvider.php --- src/Vatsim/Xml/XmlServiceProvider.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Vatsim/Xml/XmlServiceProvider.php b/src/Vatsim/Xml/XmlServiceProvider.php index 39c668c..d47349d 100644 --- a/src/Vatsim/Xml/XmlServiceProvider.php +++ b/src/Vatsim/Xml/XmlServiceProvider.php @@ -24,6 +24,7 @@ public function boot() { $this->publishes([ $this->dir("config/config.php") => config_path("vatsim-xml.php"), + ]); } /** From 2545a16023ee40b15b80bb20bbc2a25a65652b4c Mon Sep 17 00:00:00 2001 From: Anthony Lawrence Date: Mon, 21 Dec 2015 16:34:30 +0000 Subject: [PATCH 6/8] Lumen support! --- src/Vatsim/Xml/XmlServiceProvider.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Vatsim/Xml/XmlServiceProvider.php b/src/Vatsim/Xml/XmlServiceProvider.php index d47349d..91ec706 100644 --- a/src/Vatsim/Xml/XmlServiceProvider.php +++ b/src/Vatsim/Xml/XmlServiceProvider.php @@ -22,9 +22,18 @@ public function dir($path){ */ public function boot() { - $this->publishes([ - $this->dir("config/config.php") => config_path("vatsim-xml.php"), - ]); + $request = $this->app['request']; + + // Lumen users need to copy the config themselves + // And it needs to pulled completely differently. + // So more work required. Luckily barryvdh had the answer - so thanks. + if(str_contains($this->app->version(), "Lumen")){ + $this->app->configure("vatsim-xml.php"); + } else { + $this->publishes([ + $this->dir("config/config.php") => config_path("vatsim-xml.php"), + ]); + } } /** From 6c2723623462315e95119f339c993faa51329b7c Mon Sep 17 00:00:00 2001 From: Anthony Lawrence Date: Mon, 21 Dec 2015 16:34:53 +0000 Subject: [PATCH 7/8] Lumen support! --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5723296..fd1e00f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The Vatsim Xmlfeeds package is a useful laravel 5 package for accessing data pub Version ---- -2.0 +2.2 (Lumen Supported) Installation -------------- From f692722f4c34fe9ea2c42eabeebc7e2724676fd1 Mon Sep 17 00:00:00 2001 From: Anthony Lawrence Date: Mon, 21 Dec 2015 16:58:13 +0000 Subject: [PATCH 8/8] More Lumen fixes required! --- src/Vatsim/Xml/XmlServiceProvider.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Vatsim/Xml/XmlServiceProvider.php b/src/Vatsim/Xml/XmlServiceProvider.php index 91ec706..9c49a0d 100644 --- a/src/Vatsim/Xml/XmlServiceProvider.php +++ b/src/Vatsim/Xml/XmlServiceProvider.php @@ -21,31 +21,32 @@ public function dir($path){ * @return void */ public function boot() + { + + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() { $request = $this->app['request']; - + // Lumen users need to copy the config themselves // And it needs to pulled completely differently. // So more work required. Luckily barryvdh had the answer - so thanks. if(str_contains($this->app->version(), "Lumen")){ - $this->app->configure("vatsim-xml.php"); + $this->app->configure("vatsim-xml"); } else { $this->publishes([ $this->dir("config/config.php") => config_path("vatsim-xml.php"), ]); } - } - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - $this->app['vatsimxml'] = $this->app->share(function($app) - { - return new XML( $app['config']->get('vatsim-xml.config') ); + $this->app['vatsimxml'] = $this->app->share(function($app){ + return new XML( $this->app["config"]->get("vatsim-xml") ); }); }