diff --git a/composer.json b/composer.json index b524d95..6887ecb 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,8 @@ }, "extra": { "branch-alias": { - "dev-develop": "3.0-dev" + "dev-develop": "3.0-dev", + "dev-2-1-develop": "2.1-dev" } }, "minimum-stability": "beta", diff --git a/composer.lock b/composer.lock index e3497a8..1d746b7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "c1cad496c53bf4050366b41d4c0b5064", + "hash": "b307747da63319219273976b606b6169", "packages": [ { "name": "chrisboulton/php-resque", @@ -107,12 +107,12 @@ "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "4a3bc58adfd501fa6e82c82fdd9e8d4036898fa1" + "reference": "e0291f3a30fe8959884b433c47abfdb99797dd53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/4a3bc58adfd501fa6e82c82fdd9e8d4036898fa1", - "reference": "4a3bc58adfd501fa6e82c82fdd9e8d4036898fa1", + "url": "https://api.github.com/repos/composer/composer/zipball/e0291f3a30fe8959884b433c47abfdb99797dd53", + "reference": "e0291f3a30fe8959884b433c47abfdb99797dd53", "shasum": "" }, "require": { @@ -167,7 +167,7 @@ "dependency", "package" ], - "time": "2014-12-10 15:36:16" + "time": "2014-12-17 15:25:22" }, { "name": "composer/satis", @@ -753,16 +753,16 @@ }, { "name": "doctrine/orm", - "version": "v2.4.6", + "version": "v2.4.7", "source": { "type": "git", "url": "https://github.com/doctrine/doctrine2.git", - "reference": "bebacf79d8d4dae9168f0f9bc6811e6c2cb6a4d9" + "reference": "2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/bebacf79d8d4dae9168f0f9bc6811e6c2cb6a4d9", - "reference": "bebacf79d8d4dae9168f0f9bc6811e6c2cb6a4d9", + "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68", + "reference": "2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68", "shasum": "" }, "require": { @@ -822,7 +822,7 @@ "database", "orm" ], - "time": "2014-10-06 13:22:50" + "time": "2014-12-16 13:45:01" }, { "name": "guzzle/guzzle", @@ -1026,16 +1026,16 @@ }, { "name": "knplabs/github-api", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/KnpLabs/php-github-api.git", - "reference": "fc2bd5531d221f1f9e7d49238a680e50570bf60b" + "reference": "eac0ecce6faac7cdfccc8aff3b21902765df3368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/fc2bd5531d221f1f9e7d49238a680e50570bf60b", - "reference": "fc2bd5531d221f1f9e7d49238a680e50570bf60b", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/eac0ecce6faac7cdfccc8aff3b21902765df3368", + "reference": "eac0ecce6faac7cdfccc8aff3b21902765df3368", "shasum": "" }, "require": { @@ -1083,7 +1083,7 @@ "gist", "github" ], - "time": "2014-09-23 05:58:10" + "time": "2014-12-13 22:04:00" }, { "name": "kriswallsmith/buzz", @@ -1242,12 +1242,12 @@ "source": { "type": "git", "url": "https://github.com/nice-php/doctrine-orm.git", - "reference": "36d37a6a395fc24ca144265fb83510b1b589ccf0" + "reference": "82415deff901dd977cbbe181cdc923ba2dcd2396" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nice-php/doctrine-orm/zipball/36d37a6a395fc24ca144265fb83510b1b589ccf0", - "reference": "36d37a6a395fc24ca144265fb83510b1b589ccf0", + "url": "https://api.github.com/repos/nice-php/doctrine-orm/zipball/82415deff901dd977cbbe181cdc923ba2dcd2396", + "reference": "82415deff901dd977cbbe181cdc923ba2dcd2396", "shasum": "" }, "require": { @@ -1276,7 +1276,7 @@ "MIT" ], "description": "Integrates Doctrine ORM with Nice PHP framework", - "time": "2014-12-10 18:37:08" + "time": "2014-12-11 16:07:11" }, { "name": "nice/framework", @@ -1284,12 +1284,12 @@ "source": { "type": "git", "url": "https://github.com/nice-php/framework.git", - "reference": "b964de2503b845a149accd9b85ce7060701257e4" + "reference": "01226a7e6ae59b7d7e95abf4cc86f59baf1aeb82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nice-php/framework/zipball/b964de2503b845a149accd9b85ce7060701257e4", - "reference": "b964de2503b845a149accd9b85ce7060701257e4", + "url": "https://api.github.com/repos/nice-php/framework/zipball/01226a7e6ae59b7d7e95abf4cc86f59baf1aeb82", + "reference": "01226a7e6ae59b7d7e95abf4cc86f59baf1aeb82", "shasum": "" }, "require": { @@ -1325,7 +1325,7 @@ "MIT" ], "description": "A nice PHP microframework", - "time": "2014-12-09 18:00:53" + "time": "2014-12-13 17:09:38" }, { "name": "nice/security", @@ -1380,12 +1380,12 @@ "source": { "type": "git", "url": "https://github.com/nice-php/twig.git", - "reference": "15fbd3a741a5ebbe76a241ee9266ebc4a6a15356" + "reference": "449e0bf006ee4b6c7cee60e5775ab42be223fab1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nice-php/twig/zipball/15fbd3a741a5ebbe76a241ee9266ebc4a6a15356", - "reference": "15fbd3a741a5ebbe76a241ee9266ebc4a6a15356", + "url": "https://api.github.com/repos/nice-php/twig/zipball/449e0bf006ee4b6c7cee60e5775ab42be223fab1", + "reference": "449e0bf006ee4b6c7cee60e5775ab42be223fab1", "shasum": "" }, "require": { @@ -1416,7 +1416,7 @@ "MIT" ], "description": "Integrates Twig with Nice PHP framework", - "time": "2014-11-22 20:04:52" + "time": "2014-12-13 17:22:29" }, { "name": "nikic/fast-route", diff --git a/src/Application.php b/src/Application.php index 36f67f9..ab48e33 100644 --- a/src/Application.php +++ b/src/Application.php @@ -15,7 +15,6 @@ use Nice\Extension\SessionExtension; use Nice\Extension\TwigExtension; use Symfony\Component\Yaml\Yaml; -use Terramar\Packages\DependencyInjection\Compiler\TwigExtensionPass; use Terramar\Packages\DependencyInjection\PackagesExtension; use Terramar\Packages\Plugin\GitLab\Plugin as GitLabPlugin; use Terramar\Packages\Plugin\Satis\Plugin as SatisPlugin; @@ -61,8 +60,6 @@ protected function registerDefaultExtensions() 'firewall' => '^/manage', 'success_path' => '/manage' ))); - - $this->addCompilerPass(new TwigExtensionPass()); } /** diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index 370a43b..73ee245 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -20,7 +20,11 @@ class DefaultController public function indexAction(Application $app, Request $request) { $rootDir = $app->getRootDir(); - $mtime = new \DateTime('@' . filemtime($rootDir . '/web/packages.json')); + $packagesJson = $rootDir . '/web/packages.json'; + $mtime = null; + if (file_exists($packagesJson)) { + $mtime = new \DateTime('@' . filemtime($packagesJson)); + } return new Response( $app->get('twig')->render('Default/index.html.twig', array( diff --git a/src/DependencyInjection/Compiler/TwigExtensionPass.php b/src/DependencyInjection/Compiler/TwigExtensionPass.php deleted file mode 100644 index 6b4c645..0000000 --- a/src/DependencyInjection/Compiler/TwigExtensionPass.php +++ /dev/null @@ -1,26 +0,0 @@ -getDefinition('twig') - ->addMethodCall('addExtension', array(new Reference('packages.twig_extension.plugin'))); - } -} \ No newline at end of file diff --git a/src/DependencyInjection/PackagesExtension.php b/src/DependencyInjection/PackagesExtension.php index c3262ff..9fcee17 100644 --- a/src/DependencyInjection/PackagesExtension.php +++ b/src/DependencyInjection/PackagesExtension.php @@ -107,7 +107,8 @@ public function load(array $configs, ContainerBuilder $container) 'request', ContainerInterface::NULL_ON_INVALID_REFERENCE, false - ))); + ))) + ->addTag('twig.extension'); $container->register('packages.fragment_handler.uri_signer', 'Symfony\Component\HttpKernel\UriSigner') ->addArgument(''); diff --git a/src/Version.php b/src/Version.php index 41dfeac..53b7e45 100644 --- a/src/Version.php +++ b/src/Version.php @@ -11,5 +11,5 @@ class Version { - const VERSION = '3.0.1'; + const VERSION = '3.0.2'; }