diff --git a/Tests/BrainExe/Core/Application/AppKernelTest.php b/Tests/BrainExe/Core/Application/AppKernelTest.php index 390f524..bf0dc19 100644 --- a/Tests/BrainExe/Core/Application/AppKernelTest.php +++ b/Tests/BrainExe/Core/Application/AppKernelTest.php @@ -56,10 +56,9 @@ public function setUp() $this->subject = new AppKernel( $this->controllerResolver, $this->routeCollection, - $this->urlMatcher + $this->urlMatcher, + [$this->middleWare] ); - - $this->subject->setMiddlewares([$this->middleWare]); } public function testHandle() diff --git a/Tests/BrainExe/Core/Application/SerializedRouteCollectionTest.php b/Tests/BrainExe/Core/Application/SerializedRouteCollectionTest.php index 2b5adbd..b184ec9 100644 --- a/Tests/BrainExe/Core/Application/SerializedRouteCollectionTest.php +++ b/Tests/BrainExe/Core/Application/SerializedRouteCollectionTest.php @@ -16,9 +16,7 @@ class SerializedRouteCollectionTest extends TestCase public function setUp() { - $this->subject = new SerializedRouteCollection([ - 'foo' => 'C:31:"Symfony\\Component\\Routing\\Route":348:{a:9:{s:4:"path";s:8:"/espeak/";s:4:"host";s:0:"";s:8:"defaults";a:1:{s:11:"_controller";a:2:{i:0;s:29:"__Controller.EspeakController";i:1;s:5:"index";}}s:12:"requirements";a:0:{}s:7:"options";a:1:{s:14:"compiler_class";s:39:"Symfony\\Component\\Routing\\RouteCompiler";}s:7:"schemes";a:0:{}s:7:"methods";a:0:{}s:9:"condition";s:0:"";s:8:"compiled";N;}}', - ]); + $this->subject = new SerializedRouteCollection(); } /** @@ -34,7 +32,7 @@ public function testCount() { $actual = $this->subject->count(); - $this->assertEquals(1, $actual); + $this->assertGreaterThan(0, $actual); } /** diff --git a/Tests/BrainExe/Core/DependencyInjection/CompilerPass/ControllerCompilerPassTest.php b/Tests/BrainExe/Core/DependencyInjection/CompilerPass/ControllerCompilerPassTest.php index 705ae50..ce2d574 100644 --- a/Tests/BrainExe/Core/DependencyInjection/CompilerPass/ControllerCompilerPassTest.php +++ b/Tests/BrainExe/Core/DependencyInjection/CompilerPass/ControllerCompilerPassTest.php @@ -5,11 +5,11 @@ use BrainExe\Core\Annotations\Route; use BrainExe\Core\DependencyInjection\CompilerPass\ControllerCompilerPass; use PHPUnit_Framework_MockObject_MockObject as MockObject; -use PHPUnit_Framework_TestCase; +use PHPUnit_Framework_TestCase as TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; -class ControllerCompilerPassTest extends PHPUnit_Framework_TestCase +class ControllerCompilerPassTest extends TestCase { /** @@ -54,18 +54,12 @@ public function testProcess() $this->container ->expects($this->at(0)) - ->method('getDefinition') - ->with('Core.RouteCollection') - ->willReturn($this->routerDefinition); - - $this->container - ->expects($this->at(1)) ->method('findTaggedServiceIds') ->with(ControllerCompilerPass::ROUTE_TAG) ->willReturn($serviceIds); $this->container - ->expects($this->at(2)) + ->expects($this->at(1)) ->method('getDefinition') ->with($serviceId) ->willReturn($service); diff --git a/Tests/BrainExe/Core/DependencyInjection/CompilerPass/MiddlewareCompilerPassTest.php b/Tests/BrainExe/Core/DependencyInjection/CompilerPass/MiddlewareCompilerPassTest.php index 53cfd18..db77d8e 100644 --- a/Tests/BrainExe/Core/DependencyInjection/CompilerPass/MiddlewareCompilerPassTest.php +++ b/Tests/BrainExe/Core/DependencyInjection/CompilerPass/MiddlewareCompilerPassTest.php @@ -1,6 +1,6 @@ subject = new MiddlewareCompilerPass(); } @@ -55,8 +56,8 @@ public function testProcess() $appKernel ->expects($this->once()) - ->method('addMethodCall') - ->with('setMiddlewares', [[new Reference($serviceId1)]]); + ->method('replaceArgument') + ->with(3, [new Reference($serviceId1)]); $this->container ->expects($this->once()) diff --git a/Tests/BrainExe/Core/DependencyInjection/CompilerPass/RedisCompilerPassTest.php b/Tests/BrainExe/Core/DependencyInjection/CompilerPass/RedisCompilerPassTest.php index de06e4a..dc41078 100644 --- a/Tests/BrainExe/Core/DependencyInjection/CompilerPass/RedisCompilerPassTest.php +++ b/Tests/BrainExe/Core/DependencyInjection/CompilerPass/RedisCompilerPassTest.php @@ -1,6 +1,6 @@ container = $this->getMock(Container::class); - - $this->subject = new ObjectFinder($this->container); - } - - public function testGetService() - { - $serviceId = 'FooService'; - $service = new \stdClass(); - - $this->container - ->expects($this->once()) - ->method('get') - ->with($serviceId) - ->willReturn($service); - - $actual = $this->subject->getService($serviceId); - - $this->assertEquals($service, $actual); - } -} diff --git a/Tests/BrainExe/Core/Traits/ConfigTraitTest.php b/Tests/BrainExe/Core/Traits/ConfigTraitTest.php index a43c7df..ccd6ea9 100644 --- a/Tests/BrainExe/Core/Traits/ConfigTraitTest.php +++ b/Tests/BrainExe/Core/Traits/ConfigTraitTest.php @@ -4,8 +4,9 @@ use BrainExe\Core\Traits\ConfigTrait; use PHPUnit_Framework_MockObject_MockObject as MockObject; -use PHPUnit_Framework_TestCase; +use PHPUnit_Framework_TestCase as TestCase; use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; class ConfigTest { @@ -17,7 +18,7 @@ public function testGetParameter($key) } } -class ConfigTraitTest extends PHPUnit_Framework_TestCase +class ConfigTraitTest extends TestCase { /** @@ -28,14 +29,12 @@ class ConfigTraitTest extends PHPUnit_Framework_TestCase /** * @var Container|MockObject */ - private $mockContainer; + private $container; public function setUp() { - $this->mockContainer = $this->getMock(Container::class); - - $this->subject = new ConfigTest(); - $this->subject->setContainer($this->mockContainer); + $this->container = $this->getMock(Container::class); + $this->subject = new ConfigTest(); } public function testGetConfig() @@ -43,14 +42,21 @@ public function testGetConfig() $key = 'key'; $value = 'value'; - $this->mockContainer + $parameterBag = $this->getMock(ParameterBag::class); + $this->container + ->expects($this->once()) + ->method('getParameterBag') + ->willReturn($parameterBag); + + $parameterBag ->expects($this->once()) - ->method('getParameter') + ->method('get') ->with($key) ->willReturn($value); - $actualResult = $this->subject->testGetParameter($key); + $this->subject->setContainer($this->container); + $actual = $this->subject->testGetParameter($key); - $this->assertEquals($value, $actualResult); + $this->assertEquals($value, $actual); } } diff --git a/Tests/BrainExe/Core/Traits/RedisCacheTraitTest.php b/Tests/BrainExe/Core/Traits/RedisCacheTraitTest.php deleted file mode 100644 index 03bd379..0000000 --- a/Tests/BrainExe/Core/Traits/RedisCacheTraitTest.php +++ /dev/null @@ -1,92 +0,0 @@ -redis = $this->getRedisMock(); - - $this->subject = $this->getMockForTrait(RedisCacheTrait::class); - $this->subject->setRedis($this->redis); - } - - public function testInvalidate() - { - $key = 'key'; - - $this->redis - ->expects($this->once()) - ->method('del') - ->with($key); - - $this->subject->invalidate($key); - } - - public function testWrapWhenCached() - { - $key = 'key'; - $ttl = 100; - $value = 'value'; - - $callback = function () use ($value) { - return $value; - }; - - $this->redis - ->expects($this->once()) - ->method('get') - ->with($key) - ->willReturn(serialize($value)); - - $actualResult = $this->subject->wrapCache($key, $callback, $ttl); - - $this->assertEquals($value, $actualResult); - } - - public function testWrap() - { - $key = 'key'; - $ttl = 100; - $value = 'value'; - - $callback = function () use ($value) { - return $value; - }; - - $this->redis - ->expects($this->once()) - ->method('get') - ->with($key) - ->willReturn(null); - - $this->redis - ->expects($this->once()) - ->method('setex') - ->with($key, $ttl, serialize($value)); - - $actualResult = $this->subject->wrapCache($key, $callback, $ttl); - - $this->assertEquals($value, $actualResult); - } -} diff --git a/composer.json b/composer.json index e8c3107..9600581 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "brainexe/core", "description": "Framework core - used for brainexe/homie", "homepage": "https://mdoetsch.de", - "minimum-stability": "dev", + "minimum-stability": "stable", "license": "MIT", "authors": [ { @@ -29,10 +29,10 @@ "symfony/proxy-manager-bridge": "~3.0", "zendframework/zend-stdlib": "~2.7|~3.0", "ocramius/proxy-manager": "~1.0", - "brainexe/annotations": "~1.1", + "brainexe/annotations": "~1.0.4", "monolog/monolog": "~1.17", "doctrine/cache": "~1.6", - "predis/predis": "~1.1", + "predis/predis": "~1.0", "mtdowling/cron-expression": "1.1.*", "phpmailer/phpmailer": "~5.2" }, diff --git a/composer.lock b/composer.lock index fae3889..6b71cc5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,30 +4,30 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "2f415b9a22bdbd2ebd0e0e58c77d1b46", - "content-hash": "99a522f5f4422bf730939e87eea87423", + "hash": "525386019a0289a636431bd7d1f84ce0", + "content-hash": "bd9ac13f410b46552549eeca3ef2a2a7", "packages": [ { "name": "brainexe/annotations", - "version": "dev-master", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/brainexe/annotations.git", - "reference": "7814a4b2285531636e5da2074ad31c50b853c1f4" + "reference": "a98c7e6452accab571be7e1e08ce6666907f56d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brainexe/annotations/zipball/7814a4b2285531636e5da2074ad31c50b853c1f4", - "reference": "7814a4b2285531636e5da2074ad31c50b853c1f4", + "url": "https://api.github.com/repos/brainexe/annotations/zipball/a98c7e6452accab571be7e1e08ce6666907f56d4", + "reference": "a98c7e6452accab571be7e1e08ce6666907f56d4", "shasum": "" }, "require": { - "doctrine/annotations": "~1.2", - "symfony/config": "~2.7|~3.0", - "symfony/dependency-injection": "~2.7|~3.0" + "doctrine/annotations": "1.2.*", + "symfony/config": "~3.0", + "symfony/dependency-injection": "~3.0" }, "require-dev": { - "phpunit/phpunit": "~4.7" + "phpunit/phpunit": "~5.2" }, "type": "library", "extra": { @@ -52,20 +52,20 @@ ], "description": "Simple @annotation library based on doctrine annotations for symfony dependency injection container", "homepage": "https://mdoetsch.de", - "time": "2016-01-22 22:17:10" + "time": "2016-04-05 19:53:26" }, { "name": "doctrine/annotations", - "version": "dev-master", + "version": "v1.2.7", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "2e1b1f7597e2f647e99e96e747fcae9718ac817b" + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/2e1b1f7597e2f647e99e96e747fcae9718ac817b", - "reference": "2e1b1f7597e2f647e99e96e747fcae9718ac817b", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", "shasum": "" }, "require": { @@ -120,20 +120,20 @@ "docblock", "parser" ], - "time": "2016-03-24 07:09:52" + "time": "2015-08-31 12:32:49" }, { "name": "doctrine/cache", - "version": "dev-master", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "4e3b8b9464d511eccbefe07cef94c275bce7e434" + "reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/4e3b8b9464d511eccbefe07cef94c275bce7e434", - "reference": "4e3b8b9464d511eccbefe07cef94c275bce7e434", + "url": "https://api.github.com/repos/doctrine/cache/zipball/f8af318d14bdb0eff0336795b428b547bd39ccb6", + "reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6", "shasum": "" }, "require": { @@ -144,12 +144,13 @@ }, "require-dev": { "phpunit/phpunit": "~4.8|~5.0", - "predis/predis": "~1.0" + "predis/predis": "~1.0", + "satooshi/php-coveralls": "~0.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -189,11 +190,11 @@ "cache", "caching" ], - "time": "2016-03-11 16:30:04" + "time": "2015-12-31 16:37:02" }, { "name": "doctrine/lexer", - "version": "dev-master", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", @@ -247,7 +248,7 @@ }, { "name": "monolog/monolog", - "version": "1.x-dev", + "version": "1.18.2", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", @@ -369,7 +370,7 @@ }, { "name": "ocramius/proxy-manager", - "version": "1.0.x-dev", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/Ocramius/ProxyManager.git", @@ -432,33 +433,40 @@ }, { "name": "phpmailer/phpmailer", - "version": "5.4.x-dev", + "version": "v5.2.14", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a9054a5d6158ff97fc51b8aa15528ede973b2f89" + "reference": "e774bc9152de85547336e22b8926189e582ece95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a9054a5d6158ff97fc51b8aa15528ede973b2f89", - "reference": "a9054a5d6158ff97fc51b8aa15528ede973b2f89", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e774bc9152de85547336e22b8926189e582ece95", + "reference": "e774bc9152de85547336e22b8926189e582ece95", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=5.0.0" }, "require-dev": { - "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "4.*" + "phpdocumentor/phpdocumentor": "*", + "phpunit/phpunit": "4.7.*" }, "suggest": { - "league/oauth2-client": "Needed for XOAUTH2 authentication" + "league/oauth2-client": "Needed for XOAUTH2 authentication", + "league/oauth2-google": "Needed for Gmail XOAUTH2" }, "type": "library", "autoload": { - "psr-4": { - "PHPMailer\\PHPMailer\\": "src/" - } + "classmap": [ + "class.phpmailer.php", + "class.phpmaileroauth.php", + "class.phpmaileroauthgoogle.php", + "class.smtp.php", + "class.pop3.php", + "extras/EasyPeasyICS.php", + "extras/ntlm_sasl_client.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -482,24 +490,24 @@ } ], "description": "PHPMailer is a full-featured email creation and transfer class for PHP", - "time": "2016-03-16 08:49:28" + "time": "2015-11-01 10:15:28" }, { "name": "predis/predis", - "version": "dev-master", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/nrk/predis.git", - "reference": "6bc1a38123f61efde92d8b4a73adabf168e09442" + "reference": "84060b9034d756b4d79641667d7f9efe1aeb8e04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nrk/predis/zipball/6bc1a38123f61efde92d8b4a73adabf168e09442", - "reference": "6bc1a38123f61efde92d8b4a73adabf168e09442", + "url": "https://api.github.com/repos/nrk/predis/zipball/84060b9034d756b4d79641667d7f9efe1aeb8e04", + "reference": "84060b9034d756b4d79641667d7f9efe1aeb8e04", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3.2" }, "require-dev": { "phpunit/phpunit": "~4.0" @@ -509,11 +517,6 @@ "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { "psr-4": { "Predis\\": "src/" @@ -537,34 +540,26 @@ "predis", "redis" ], - "time": "2015-07-30 18:51:15" + "time": "2015-07-30 18:34:15" }, { "name": "psr/log", - "version": "dev-master", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d8e60a5619fff77f9669da8997697443ef1a1d7e" + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d8e60a5619fff77f9669da8997697443ef1a1d7e", - "reference": "d8e60a5619fff77f9669da8997697443ef1a1d7e", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", "shasum": "" }, - "require": { - "php": ">=5.3.0" - }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "psr-0": { + "Psr\\Log\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -578,26 +573,25 @@ } ], "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", "keywords": [ "log", "psr", "psr-3" ], - "time": "2016-01-06 21:40:42" + "time": "2012-12-21 11:40:51" }, { "name": "symfony/config", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "2d23e8b661e2d9658932902f5a40445cc5e5b359" + "reference": "980ee40c28f00acff8906c11b778aab5f0db74c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/2d23e8b661e2d9658932902f5a40445cc5e5b359", - "reference": "2d23e8b661e2d9658932902f5a40445cc5e5b359", + "url": "https://api.github.com/repos/symfony/config/zipball/980ee40c28f00acff8906c11b778aab5f0db74c2", + "reference": "980ee40c28f00acff8906c11b778aab5f0db74c2", "shasum": "" }, "require": { @@ -610,7 +604,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -637,20 +631,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:56:56" + "time": "2016-03-04 07:55:57" }, { "name": "symfony/console", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "902185ebdfbd09b01974cb1f3cb65c64e6c701d1" + "reference": "6b1175135bc2a74c08a28d89761272de8beed8cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/902185ebdfbd09b01974cb1f3cb65c64e6c701d1", - "reference": "902185ebdfbd09b01974cb1f3cb65c64e6c701d1", + "url": "https://api.github.com/repos/symfony/console/zipball/6b1175135bc2a74c08a28d89761272de8beed8cd", + "reference": "6b1175135bc2a74c08a28d89761272de8beed8cd", "shasum": "" }, "require": { @@ -670,7 +664,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -697,20 +691,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-03-16 17:16:29" + "time": "2016-03-16 17:00:50" }, { "name": "symfony/debug", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "5f4f7b4aaf3615f62183e818f5efa542d4fb95f2" + "reference": "a06d10888a45afd97534506afb058ec38d9ba35b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/5f4f7b4aaf3615f62183e818f5efa542d4fb95f2", - "reference": "5f4f7b4aaf3615f62183e818f5efa542d4fb95f2", + "url": "https://api.github.com/repos/symfony/debug/zipball/a06d10888a45afd97534506afb058ec38d9ba35b", + "reference": "a06d10888a45afd97534506afb058ec38d9ba35b", "shasum": "" }, "require": { @@ -727,7 +721,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -754,20 +748,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-03-30 10:41:47" + "time": "2016-03-30 10:41:14" }, { "name": "symfony/dependency-injection", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "54ef2cfe967a14ccc81a86439643c2da3208417d" + "reference": "6a9058101b591edced21ca3c83c80a3978f5c6b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/54ef2cfe967a14ccc81a86439643c2da3208417d", - "reference": "54ef2cfe967a14ccc81a86439643c2da3208417d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/6a9058101b591edced21ca3c83c80a3978f5c6b0", + "reference": "6a9058101b591edced21ca3c83c80a3978f5c6b0", "shasum": "" }, "require": { @@ -786,7 +780,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -813,20 +807,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2016-04-03 07:41:26" + "time": "2016-03-30 10:41:14" }, { "name": "symfony/event-dispatcher", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "3433bfec93209ce539751591c3a1d9a1ac5ff53b" + "reference": "9002dcf018d884d294b1ef20a6f968efc1128f39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3433bfec93209ce539751591c3a1d9a1ac5ff53b", - "reference": "3433bfec93209ce539751591c3a1d9a1ac5ff53b", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9002dcf018d884d294b1ef20a6f968efc1128f39", + "reference": "9002dcf018d884d294b1ef20a6f968efc1128f39", "shasum": "" }, "require": { @@ -846,7 +840,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -873,20 +867,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-03-10 11:16:56" + "time": "2016-03-10 10:34:12" }, { "name": "symfony/filesystem", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3402bb927c2ae25caca38d6faf901f25fc42a926" + "reference": "f82499a459dcade2ea56df94cc58b19c8bde3d20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3402bb927c2ae25caca38d6faf901f25fc42a926", - "reference": "3402bb927c2ae25caca38d6faf901f25fc42a926", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/f82499a459dcade2ea56df94cc58b19c8bde3d20", + "reference": "f82499a459dcade2ea56df94cc58b19c8bde3d20", "shasum": "" }, "require": { @@ -895,7 +889,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -922,20 +916,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2016-03-27 16:15:51" + "time": "2016-03-27 10:24:39" }, { "name": "symfony/finder", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "c3e7b8a86d3044a3dff2cc5a89f2c523ccf0e0fb" + "reference": "c54e407b35bc098916704e9fd090da21da4c4f52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/c3e7b8a86d3044a3dff2cc5a89f2c523ccf0e0fb", - "reference": "c3e7b8a86d3044a3dff2cc5a89f2c523ccf0e0fb", + "url": "https://api.github.com/repos/symfony/finder/zipball/c54e407b35bc098916704e9fd090da21da4c4f52", + "reference": "c54e407b35bc098916704e9fd090da21da4c4f52", "shasum": "" }, "require": { @@ -944,7 +938,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -971,20 +965,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2016-03-10 11:16:56" + "time": "2016-03-10 11:13:05" }, { "name": "symfony/http-foundation", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "d55e325bbb40117d879c3285886d3711a4f4f623" + "reference": "99f38445a874e7becb8afc4b4a79ee181cf6ec3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d55e325bbb40117d879c3285886d3711a4f4f623", - "reference": "d55e325bbb40117d879c3285886d3711a4f4f623", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/99f38445a874e7becb8afc4b4a79ee181cf6ec3f", + "reference": "99f38445a874e7becb8afc4b4a79ee181cf6ec3f", "shasum": "" }, "require": { @@ -997,7 +991,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1024,20 +1018,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2016-04-02 08:08:03" + "time": "2016-03-27 14:50:32" }, { "name": "symfony/http-kernel", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "3ccc446fd5449b5ad8bf6fc38d2fc2d11ffb7e62" + "reference": "579f828489659d7b3430f4bd9b67b4618b387dea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/3ccc446fd5449b5ad8bf6fc38d2fc2d11ffb7e62", - "reference": "3ccc446fd5449b5ad8bf6fc38d2fc2d11ffb7e62", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/579f828489659d7b3430f4bd9b67b4618b387dea", + "reference": "579f828489659d7b3430f4bd9b67b4618b387dea", "shasum": "" }, "require": { @@ -1079,7 +1073,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1106,11 +1100,11 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2016-04-02 11:06:02" + "time": "2016-03-25 01:41:20" }, { "name": "symfony/polyfill-mbstring", - "version": "dev-master", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -1169,16 +1163,16 @@ }, { "name": "symfony/process", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "5d60ebbe407b591df3b955c9b9c5fb239defb305" + "reference": "e6f1f98bbd355d209a992bfff45e7edfbd4a0776" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/5d60ebbe407b591df3b955c9b9c5fb239defb305", - "reference": "5d60ebbe407b591df3b955c9b9c5fb239defb305", + "url": "https://api.github.com/repos/symfony/process/zipball/e6f1f98bbd355d209a992bfff45e7edfbd4a0776", + "reference": "e6f1f98bbd355d209a992bfff45e7edfbd4a0776", "shasum": "" }, "require": { @@ -1187,7 +1181,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1214,20 +1208,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-04-02 13:13:12" + "time": "2016-03-30 10:41:14" }, { "name": "symfony/proxy-manager-bridge", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/proxy-manager-bridge.git", - "reference": "62febdb384fe3e928f418d6173e102b0f19b1a5b" + "reference": "359f4aa4581e61e91faa2b088e3eccd396bef123" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/proxy-manager-bridge/zipball/62febdb384fe3e928f418d6173e102b0f19b1a5b", - "reference": "62febdb384fe3e928f418d6173e102b0f19b1a5b", + "url": "https://api.github.com/repos/symfony/proxy-manager-bridge/zipball/359f4aa4581e61e91faa2b088e3eccd396bef123", + "reference": "359f4aa4581e61e91faa2b088e3eccd396bef123", "shasum": "" }, "require": { @@ -1241,7 +1235,7 @@ "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1268,20 +1262,20 @@ ], "description": "Symfony ProxyManager Bridge", "homepage": "https://symfony.com", - "time": "2016-04-01 06:52:19" + "time": "2016-03-04 07:55:57" }, { "name": "symfony/routing", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "496038466add75c605e83037d5b94d2b6491c8d8" + "reference": "d061b609f2d0769494c381ec92f5c5cc5e4a20aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/496038466add75c605e83037d5b94d2b6491c8d8", - "reference": "496038466add75c605e83037d5b94d2b6491c8d8", + "url": "https://api.github.com/repos/symfony/routing/zipball/d061b609f2d0769494c381ec92f5c5cc5e4a20aa", + "reference": "d061b609f2d0769494c381ec92f5c5cc5e4a20aa", "shasum": "" }, "require": { @@ -1310,7 +1304,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1343,7 +1337,7 @@ "uri", "url" ], - "time": "2016-04-02 08:08:03" + "time": "2016-03-23 13:23:25" }, { "name": "zendframework/zend-code", @@ -1399,16 +1393,16 @@ }, { "name": "zendframework/zend-eventmanager", - "version": "dev-develop", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "e6bf66a22fe990ff477e66055c502f3ba685020d" + "reference": "5c80bdee0e952be112dcec0968bad770082c3a6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/e6bf66a22fe990ff477e66055c502f3ba685020d", - "reference": "e6bf66a22fe990ff477e66055c502f3ba685020d", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/5c80bdee0e952be112dcec0968bad770082c3a6e", + "reference": "5c80bdee0e952be112dcec0968bad770082c3a6e", "shasum": "" }, "require": { @@ -1449,20 +1443,20 @@ "events", "zf2" ], - "time": "2016-03-07 15:48:37" + "time": "2016-02-18 20:53:00" }, { "name": "zendframework/zend-stdlib", - "version": "dev-develop", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "0e5191d480c6aa4afe9c31b04d7ac3a3f87b5040" + "reference": "22eb098958980fbbe6b9a06f209f5a4b496cc0c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/0e5191d480c6aa4afe9c31b04d7ac3a3f87b5040", - "reference": "0e5191d480c6aa4afe9c31b04d7ac3a3f87b5040", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/22eb098958980fbbe6b9a06f209f5a4b496cc0c1", + "reference": "22eb098958980fbbe6b9a06f209f5a4b496cc0c1", "shasum": "" }, "require": { @@ -1494,22 +1488,22 @@ "stdlib", "zf2" ], - "time": "2016-03-07 15:50:04" + "time": "2016-02-03 16:53:37" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "dev-master", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "416fb8ad1d095a87f1d21bc40711843cd122fd4a" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/416fb8ad1d095a87f1d21bc40711843cd122fd4a", - "reference": "416fb8ad1d095a87f1d21bc40711843cd122fd4a", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { @@ -1550,7 +1544,7 @@ "constructor", "instantiate" ], - "time": "2016-03-31 10:24:22" + "time": "2015-06-14 21:17:01" }, { "name": "myclabs/deep-copy", @@ -1645,16 +1639,16 @@ }, { "name": "phpspec/prophecy", - "version": "dev-master", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "b02221e42163be673f9b44a0bc92a8b4907a7c6d" + "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b02221e42163be673f9b44a0bc92a8b4907a7c6d", - "reference": "b02221e42163be673f9b44a0bc92a8b4907a7c6d", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", + "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", "shasum": "" }, "require": { @@ -1670,7 +1664,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.5.x-dev" } }, "autoload": { @@ -1703,20 +1697,20 @@ "spy", "stub" ], - "time": "2016-02-21 17:41:21" + "time": "2016-02-15 07:46:21" }, { "name": "phpunit/php-code-coverage", - "version": "dev-master", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "9b2a050b8ee982bf4132fa5c8b381f33c7416f2b" + "reference": "fe33716763b604ade4cb442c0794f5bd5ad73004" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9b2a050b8ee982bf4132fa5c8b381f33c7416f2b", - "reference": "9b2a050b8ee982bf4132fa5c8b381f33c7416f2b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe33716763b604ade4cb442c0794f5bd5ad73004", + "reference": "fe33716763b604ade4cb442c0794f5bd5ad73004", "shasum": "" }, "require": { @@ -1766,11 +1760,11 @@ "testing", "xunit" ], - "time": "2016-03-09 13:32:21" + "time": "2016-03-03 08:49:08" }, { "name": "phpunit/php-file-iterator", - "version": "dev-master", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", @@ -1899,16 +1893,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "dev-master", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "cab6c6fefee93d7b7c3a01292a0fe0884ea66644" + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/cab6c6fefee93d7b7c3a01292a0fe0884ea66644", - "reference": "cab6c6fefee93d7b7c3a01292a0fe0884ea66644", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "shasum": "" }, "require": { @@ -1944,20 +1938,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-09-23 14:46:55" + "time": "2015-09-15 10:49:45" }, { "name": "phpunit/phpunit", - "version": "dev-master", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fedef9cdbaa682b9f1c5212c88219a222121d064" + "reference": "dd3001822b2df8f5add266020e3d2fd3c5db3ae9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fedef9cdbaa682b9f1c5212c88219a222121d064", - "reference": "fedef9cdbaa682b9f1c5212c88219a222121d064", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/dd3001822b2df8f5add266020e3d2fd3c5db3ae9", + "reference": "dd3001822b2df8f5add266020e3d2fd3c5db3ae9", "shasum": "" }, "require": { @@ -1972,7 +1966,7 @@ "phpunit/php-code-coverage": "^3.3.0", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", + "phpunit/php-timer": ">=1.0.6", "phpunit/phpunit-mock-objects": "^3.1", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", @@ -1993,7 +1987,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.4.x-dev" + "dev-master": "5.3.x-dev" } }, "autoload": { @@ -2019,20 +2013,20 @@ "testing", "xunit" ], - "time": "2016-04-03 06:37:43" + "time": "2016-03-31 21:35:50" }, { "name": "phpunit/phpunit-mock-objects", - "version": "dev-master", + "version": "3.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "7b18bbdad9880e09740959e90eec4b91c35a4aa9" + "reference": "7c34c9bdde4131b824086457a3145e27dba10ca1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/7b18bbdad9880e09740959e90eec4b91c35a4aa9", - "reference": "7b18bbdad9880e09740959e90eec4b91c35a4aa9", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/7c34c9bdde4131b824086457a3145e27dba10ca1", + "reference": "7c34c9bdde4131b824086457a3145e27dba10ca1", "shasum": "" }, "require": { @@ -2075,11 +2069,11 @@ "mock", "xunit" ], - "time": "2016-03-24 06:24:17" + "time": "2016-03-24 05:58:25" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "dev-master", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", @@ -2124,7 +2118,7 @@ }, { "name": "sebastian/comparator", - "version": "dev-master", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", @@ -2188,7 +2182,7 @@ }, { "name": "sebastian/diff", - "version": "dev-master", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", @@ -2240,7 +2234,7 @@ }, { "name": "sebastian/environment", - "version": "dev-master", + "version": "1.3.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", @@ -2290,16 +2284,16 @@ }, { "name": "sebastian/exporter", - "version": "dev-master", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "f88f8936517d54ae6d589166810877fb2015d0a2" + "reference": "7ae5513327cb536431847bcc0c10edba2701064e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f88f8936517d54ae6d589166810877fb2015d0a2", - "reference": "f88f8936517d54ae6d589166810877fb2015d0a2", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e", "shasum": "" }, "require": { @@ -2307,13 +2301,12 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { - "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -2353,7 +2346,7 @@ "export", "exporter" ], - "time": "2015-08-09 04:23:41" + "time": "2015-06-21 07:55:53" }, { "name": "sebastian/global-state", @@ -2408,7 +2401,7 @@ }, { "name": "sebastian/object-enumerator", - "version": "dev-master", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", @@ -2454,16 +2447,16 @@ }, { "name": "sebastian/recursion-context", - "version": "dev-master", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "7ff5b1b3dcc55b8ab8ae61ef99d4730940856ee7" + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/7ff5b1b3dcc55b8ab8ae61ef99d4730940856ee7", - "reference": "7ff5b1b3dcc55b8ab8ae61ef99d4730940856ee7", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", "shasum": "" }, "require": { @@ -2503,11 +2496,11 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-01-28 05:39:29" + "time": "2015-11-11 19:50:13" }, { "name": "sebastian/resource-operations", - "version": "dev-master", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", @@ -2549,7 +2542,7 @@ }, { "name": "sebastian/version", - "version": "dev-master", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", @@ -2592,16 +2585,16 @@ }, { "name": "symfony/yaml", - "version": "dev-master", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "407e31ad9742ace5c3d01642f02a3b2e6062bae5" + "reference": "0047c8366744a16de7516622c5b7355336afae96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/407e31ad9742ace5c3d01642f02a3b2e6062bae5", - "reference": "407e31ad9742ace5c3d01642f02a3b2e6062bae5", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0047c8366744a16de7516622c5b7355336afae96", + "reference": "0047c8366744a16de7516622c5b7355336afae96", "shasum": "" }, "require": { @@ -2610,7 +2603,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2637,11 +2630,11 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-03-30 14:44:34" + "time": "2016-03-04 07:55:57" } ], "aliases": [], - "minimum-stability": "dev", + "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, diff --git a/container.xml b/container.xml index 4048de3..a202571 100644 --- a/container.xml +++ b/container.xml @@ -1,7 +1,6 @@ - false true localhost:8080 @@ -29,6 +28,8 @@ false true + + %logger.dir%error.log @@ -104,7 +105,7 @@ - + diff --git a/src/Annotations/CompilerPass.php b/src/Annotations/CompilerPass.php index dac3753..18e7de0 100644 --- a/src/Annotations/CompilerPass.php +++ b/src/Annotations/CompilerPass.php @@ -17,7 +17,7 @@ class CompilerPass extends Service /** * @var integer */ - public $priority = 1; + public $priority = 3; /** * {@inheritdoc} diff --git a/src/Application/AppKernel.php b/src/Application/AppKernel.php index 6a9165c..e68e0d5 100644 --- a/src/Application/AppKernel.php +++ b/src/Application/AppKernel.php @@ -38,26 +38,26 @@ class AppKernel implements HttpKernelInterface private $urlMatcher; /** - * @Inject({"@ControllerResolver", "@Core.RouteCollection", "@UrlMatcher"}) + * @Inject({ + * "@ControllerResolver", + * "@Core.RouteCollection", + * "@UrlMatcher", + * null + * }) * @param ControllerResolver $resolver * @param SerializedRouteCollection $routes * @param UrlMatcher $urlMatcher + * @param MiddlewareInterface[] $middlewares */ public function __construct( ControllerResolver $resolver, SerializedRouteCollection $routes, - UrlMatcher $urlMatcher + UrlMatcher $urlMatcher, + array $middlewares ) { - $this->resolver = $resolver; - $this->routes = $routes; - $this->urlMatcher = $urlMatcher; - } - - /** - * @param MiddlewareInterface[] $middlewares - */ - public function setMiddlewares(array $middlewares) - { + $this->resolver = $resolver; + $this->routes = $routes; + $this->urlMatcher = $urlMatcher; $this->middlewares = $middlewares; } @@ -83,12 +83,12 @@ public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = /** * @param Request $request - * @return Response + * @return Response|mixed */ private function handleRequest(Request $request) { + // match route and set attributes in request object $attributes = $this->urlMatcher->match($request); - $request->attributes->replace($attributes); $routeName = $attributes['_route']; diff --git a/src/Application/ControllerResolver.php b/src/Application/ControllerResolver.php index 55e4fdc..e3139de 100644 --- a/src/Application/ControllerResolver.php +++ b/src/Application/ControllerResolver.php @@ -4,7 +4,7 @@ use BrainExe\Annotations\Annotations\Inject; use BrainExe\Annotations\Annotations\Service; -use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; @@ -14,15 +14,15 @@ class ControllerResolver implements ControllerResolverInterface { /** - * @var Container + * @var ContainerInterface */ private $container; /** * @Inject("@service_container") - * @param Container $container + * @param ContainerInterface $container */ - public function __construct(Container $container) + public function __construct(ContainerInterface $container) { $this->container = $container; } diff --git a/src/Application/SerializedRouteCollection.php b/src/Application/SerializedRouteCollection.php index f4b7324..601e37a 100644 --- a/src/Application/SerializedRouteCollection.php +++ b/src/Application/SerializedRouteCollection.php @@ -4,40 +4,39 @@ use ArrayIterator; use BrainExe\Annotations\Annotations\Service; +use BrainExe\Core\Traits\FileCacheTrait; use Psr\Log\InvalidArgumentException; use RuntimeException; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; /** - * @Service("Core.RouteCollection", public=false) + * @Service("Core.RouteCollection", public=false, shared=false) */ class SerializedRouteCollection extends RouteCollection { + use FileCacheTrait; + + const CACHE_FILE = 'routes'; + /** * @var string[] */ - private $serializedRoutes; + private $serializedRoutes = null; /** * @var Route[] */ private $cache = []; - /** - * @param string[] $routes - */ - public function __construct(array $routes = []) - { - $this->serializedRoutes = $routes; - } - /** * @param string $name * @return Route */ public function get($name) { + $this->loadFromCache(); + if (isset($this->cache[$name])) { return $this->cache[$name]; } @@ -79,6 +78,8 @@ public function getIterator() */ public function count() { + $this->loadFromCache(); + return count($this->serializedRoutes); } @@ -102,6 +103,15 @@ public function remove($name) private function initAll() { + $this->loadFromCache(); + return array_map([$this, 'get'], array_keys($this->serializedRoutes)); } + + private function loadFromCache() + { + if ($this->serializedRoutes == null) { + $this->serializedRoutes = $this->includeFile(self::CACHE_FILE); + } + } } diff --git a/src/Authentication/Controller/CreateController.php b/src/Authentication/Controller/CreateController.php index 3d9b4fc..b8f8a9d 100644 --- a/src/Authentication/Controller/CreateController.php +++ b/src/Authentication/Controller/CreateController.php @@ -33,7 +33,7 @@ public function __construct(Register $register) /** * @param Request $request * @return UserVO - * @Route("/admin/", name="authenticate.doRegister", methods="POST") + * @Route("/admin/", name="admin.doRegister", methods="POST") * @Guest */ public function register(Request $request) diff --git a/src/Cron/CacheListener.php b/src/Cron/CacheListener.php index d19d0a0..cee8c6c 100644 --- a/src/Cron/CacheListener.php +++ b/src/Cron/CacheListener.php @@ -7,7 +7,6 @@ use BrainExe\Core\Annotations\Listen; use BrainExe\Core\DependencyInjection\CompilerPass\Cron; use BrainExe\Core\EventDispatcher\CronEvent; -use BrainExe\Core\EventDispatcher\Events\ClearCacheEvent; use BrainExe\Core\EventDispatcher\Events\TimingEvent; use BrainExe\Core\Traits\EventDispatcherTrait; use BrainExe\Core\Traits\FileCacheTrait; @@ -39,7 +38,7 @@ public function __construct(Gateway $gateway) } /** - * @Listen(ClearCacheEvent::NAME) + * @todo matze wtf? */ public function handleRebuildCache() { diff --git a/src/DependencyInjection/CompilerPass/ConfigCompilerPass.php b/src/DependencyInjection/CompilerPass/ConfigCompilerPass.php index 4fc94f4..4975273 100644 --- a/src/DependencyInjection/CompilerPass/ConfigCompilerPass.php +++ b/src/DependencyInjection/CompilerPass/ConfigCompilerPass.php @@ -22,7 +22,7 @@ class ConfigCompilerPass implements CompilerPassInterface public function process(ContainerBuilder $container) { $loader = new XmlFileLoader($container, new FileLocator('config')); - $filesystem = new FileSystem(); + $filesystem = new Filesystem(); if ($filesystem->exists(ROOT . 'app/container.xml')) { $loader->load(ROOT . 'app/container.xml'); diff --git a/src/DependencyInjection/CompilerPass/ConsoleCompilerPass.php b/src/DependencyInjection/CompilerPass/ConsoleCompilerPass.php index d8d47e9..4e0c46b 100644 --- a/src/DependencyInjection/CompilerPass/ConsoleCompilerPass.php +++ b/src/DependencyInjection/CompilerPass/ConsoleCompilerPass.php @@ -30,6 +30,7 @@ public function process(ContainerBuilder $container) $console->addMethodCall('setAutoExit', [false]); $taggedServices = $container->findTaggedServiceIds(self::TAG); + $commands = []; foreach (array_keys($taggedServices) as $serviceId) { /** @var Command $command */ @@ -66,6 +67,7 @@ private function formatDefinition(InputDefinition $definition) [$argument->getName(), $mode, $argument->getDescription(), $argument->getDefault()] ); } + foreach ($definition->getOptions() as $option) { $mode = $this->getOptionMode($option); diff --git a/src/DependencyInjection/CompilerPass/ControllerCompilerPass.php b/src/DependencyInjection/CompilerPass/ControllerCompilerPass.php index 07067ea..600bd19 100644 --- a/src/DependencyInjection/CompilerPass/ControllerCompilerPass.php +++ b/src/DependencyInjection/CompilerPass/ControllerCompilerPass.php @@ -5,6 +5,7 @@ use BrainExe\Core\Annotations\CompilerPass; use BrainExe\Core\Annotations\Route as RouteAnnotation; use BrainExe\Core\Application\SerializedRouteCollection; +use BrainExe\Core\Traits\FileCacheTrait; use Exception; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -17,6 +18,8 @@ */ class ControllerCompilerPass implements CompilerPassInterface { + use FileCacheTrait; + const CONTROLLER_TAG = 'controller'; const ROUTE_TAG = 'route'; @@ -25,8 +28,7 @@ class ControllerCompilerPass implements CompilerPassInterface */ public function process(ContainerBuilder $container) { - $coreCollector = $container->getDefinition('Core.RouteCollection'); - $controllers = $container->findTaggedServiceIds(self::ROUTE_TAG); + $controllers = $container->findTaggedServiceIds(self::ROUTE_TAG); $serialized = []; foreach ($controllers as $controllerId => $tag) { @@ -35,11 +37,12 @@ public function process(ContainerBuilder $container) $route = $routeRaw[0]; $name = $route->getName(); - if (!$name) { + if (empty($name)) { throw new Exception(sprintf('"name" is missing for @Route(%s)', $controllerId)); } - if ($route->isCsrf()) { - $route->setOptions(['csrf' => true]); + + if (isset($serialized[$name])) { + throw new Exception(sprintf('Route name %s does already exits in %s', $name, $controllerId)); } $serialized[$name] = serialize($this->createRoute($route)); @@ -49,9 +52,9 @@ public function process(ContainerBuilder $container) $controller->clearTag(self::ROUTE_TAG); } - $coreCollector->addArgument($serialized); + ksort($serialized); - $this->dumpMatcher($container); + $this->dumpMatcher($container, $serialized); } /** @@ -78,14 +81,11 @@ private function createRoute(RouteAnnotation $route) /** * @param ContainerBuilder $container + * @param array $routes * @codeCoverageIgnore */ - protected function dumpMatcher(ContainerBuilder $container) + protected function dumpMatcher(ContainerBuilder $container, array $routes) { - if (!is_dir(ROOT . 'cache')) { - return; - } - /** @var SerializedRouteCollection $routerCollection */ $routerCollection = $container->get('Core.RouteCollection'); @@ -98,5 +98,7 @@ protected function dumpMatcher(ContainerBuilder $container) $routeDumper = new PhpGeneratorDumper($routerCollection); $content = $routeDumper->dump(); file_put_contents($routerFile, $content); + + $this->dumpVariableToCache(SerializedRouteCollection::CACHE_FILE, $routes); } } diff --git a/src/DependencyInjection/CompilerPass/GlobalCompilerPass.php b/src/DependencyInjection/CompilerPass/GlobalCompilerPass.php index 6d61ef5..d829033 100644 --- a/src/DependencyInjection/CompilerPass/GlobalCompilerPass.php +++ b/src/DependencyInjection/CompilerPass/GlobalCompilerPass.php @@ -43,9 +43,12 @@ public function process(ContainerBuilder $container) $container->reset(); /** @var Logger $logger */ $logger = $container->get('logger'); + $logger->debug('DIC: start', ['channel' => 'dic']); + foreach ($loggerStore as $log) { - $logger->debug($log); + $logger->debug($log, ['channel' => 'dic']); } - $logger->debug(sprintf("DIC: %0.2fms total time", $totalTime * 1000), ['context' => 'dic']); + + $logger->debug(sprintf('DIC: %0.2fms total time', $totalTime * 1000), ['channel' => 'dic']); } } diff --git a/src/DependencyInjection/CompilerPass/MiddlewareCompilerPass.php b/src/DependencyInjection/CompilerPass/MiddlewareCompilerPass.php index 27e3005..2f011a8 100644 --- a/src/DependencyInjection/CompilerPass/MiddlewareCompilerPass.php +++ b/src/DependencyInjection/CompilerPass/MiddlewareCompilerPass.php @@ -23,12 +23,13 @@ public function process(ContainerBuilder $container) { $appKernel = $container->getDefinition('AppKernel'); $middlewares = $container->getParameter('application.middlewares'); - $references = []; + $references = []; foreach ($middlewares as $serviceId) { $references[] = new Reference($serviceId); } - $appKernel->addMethodCall('setMiddlewares', [$references]); + + $appKernel->replaceArgument(3, $references); $container->setParameter('application.middlewares', []); } } diff --git a/src/DependencyInjection/CompilerPass/SetDefinitionFileCompilerPass.php b/src/DependencyInjection/CompilerPass/SetDefinitionFileCompilerPass.php index b1f1d02..c6ce365 100644 --- a/src/DependencyInjection/CompilerPass/SetDefinitionFileCompilerPass.php +++ b/src/DependencyInjection/CompilerPass/SetDefinitionFileCompilerPass.php @@ -9,7 +9,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; /** - * @CompilerPass + * @CompilerPass(priority=1) */ class SetDefinitionFileCompilerPass implements CompilerPassInterface { diff --git a/src/DependencyInjection/ObjectFinder.php b/src/DependencyInjection/ObjectFinder.php deleted file mode 100644 index ea0ed60..0000000 --- a/src/DependencyInjection/ObjectFinder.php +++ /dev/null @@ -1,38 +0,0 @@ -container = $container; - } - - /** - * @param string $serviceId - * @return mixed - */ - public function getService($serviceId) - { - return $this->container->get($serviceId); - } -} diff --git a/src/EventDispatcher/BackgroundOnlyEvent.php b/src/EventDispatcher/BackgroundOnlyEvent.php deleted file mode 100644 index a0282f5..0000000 --- a/src/EventDispatcher/BackgroundOnlyEvent.php +++ /dev/null @@ -1,11 +0,0 @@ -channel === $record['context']['channel']; - unset($record['context']['channel']); - return $supported; } } diff --git a/src/Middleware/Cache.php b/src/Middleware/Cache.php index ad2e360..6afc58b 100644 --- a/src/Middleware/Cache.php +++ b/src/Middleware/Cache.php @@ -6,6 +6,7 @@ use BrainExe\Core\Annotations\Middleware; use BrainExe\Core\Traits\CacheTrait; use BrainExe\Core\Traits\LoggerTrait; +use DateTime; use Doctrine\Common\Cache\CacheProvider; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -32,15 +33,15 @@ class Cache extends AbstractMiddleware /** * @var boolean */ - private $cacheEnabled; + private $enabled; /** * @Inject("%cache.enabled%") - * @param boolean $cacheEnabled + * @param bool $cacheEnabled */ public function __construct($cacheEnabled) { - $this->cacheEnabled = $cacheEnabled; + $this->enabled = $cacheEnabled; } /** @@ -48,7 +49,7 @@ public function __construct($cacheEnabled) */ public function processRequest(Request $request, Route $route) { - if (!$this->cacheEnabled || !$route->getOption('cache') || !$request->isMethod('GET')) { + if (!$this->enabled || !$route->getOption('cache') || !$request->isMethod('GET')) { return null; } @@ -80,7 +81,7 @@ public function processResponse(Request $request, Response $response) $this->debug(sprintf('save into cache: %s', $this->cacheKey)); - $cache->save($this->cacheKey, $response, self::DEFAULT_TTL); + $cache->save($this->cacheKey, $response, $this->getTTL()); $this->cacheKey = null; } @@ -97,7 +98,7 @@ private function generateCacheKey(Request $request) * @param CacheProvider$cache * @return Response */ - protected function handleCached(CacheProvider $cache) + private function handleCached(CacheProvider $cache) { $this->debug(sprintf('fetch from cache: %s', $this->cacheKey)); @@ -105,8 +106,20 @@ protected function handleCached(CacheProvider $cache) $response = $cache->fetch($this->cacheKey); $this->cacheKey = null; + $ttl = $this->getTTL(); + $response->headers->set('X-Cache', 'hit'); + $response->setMaxAge($ttl); + $response->setExpires(new DateTime(sprintf('+%d seconds', $ttl))); return $response; } + + /** + * @return int + */ + private function getTTL() + { + return self::DEFAULT_TTL; + } } diff --git a/src/Middleware/Gentime.php b/src/Middleware/Gentime.php index 7e2b11e..b479002 100644 --- a/src/Middleware/Gentime.php +++ b/src/Middleware/Gentime.php @@ -34,7 +34,7 @@ public function processResponse(Request $request, Response $response) $diff = microtime(true) - $startTime; $this->info( sprintf( - '%0.2fms (route: %s, user:%s)', + '%0.2fms (route: %s, user: %s)', $diff * 1000, $request->getRequestUri(), $username diff --git a/src/Middleware/Locale.php b/src/Middleware/Locale.php index b5be1f6..765859d 100644 --- a/src/Middleware/Locale.php +++ b/src/Middleware/Locale.php @@ -51,6 +51,7 @@ public function processRequest(Request $request, Route $route) if ($locale) { $this->locale->setLocale($locale); + $request->attributes->set('locale', $locale); } } } diff --git a/src/Traits/ConfigTrait.php b/src/Traits/ConfigTrait.php index 605307f..45037cb 100644 --- a/src/Traits/ConfigTrait.php +++ b/src/Traits/ConfigTrait.php @@ -4,6 +4,7 @@ use BrainExe\Annotations\Annotations\Inject; use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; /** * @api @@ -11,9 +12,9 @@ trait ConfigTrait { /** - * @var Container + * @var ParameterBag */ - private $container; + private $parameterBag; /** * @Inject("@Service_container") @@ -21,7 +22,7 @@ trait ConfigTrait */ public function setContainer(Container $container) { - $this->container = $container; + $this->parameterBag = $container->getParameterBag(); } /** @@ -30,6 +31,6 @@ public function setContainer(Container $container) */ protected function getParameter($parameterId) { - return $this->container->getParameter($parameterId); + return $this->parameterBag->get($parameterId); } } diff --git a/src/Traits/FileCacheTrait.php b/src/Traits/FileCacheTrait.php index 37c060f..609b804 100644 --- a/src/Traits/FileCacheTrait.php +++ b/src/Traits/FileCacheTrait.php @@ -2,8 +2,6 @@ namespace BrainExe\Core\Traits; - - /** * @api */ @@ -20,6 +18,7 @@ protected function includeFile($name) if (!is_file($filename)) { return null; } + return include $filename; } diff --git a/src/Traits/RedisCacheTrait.php b/src/Traits/RedisCacheTrait.php deleted file mode 100644 index 6178f4c..0000000 --- a/src/Traits/RedisCacheTrait.php +++ /dev/null @@ -1,41 +0,0 @@ -redis->get($key); - if ($cachedValue) { - return unserialize($cachedValue); - } - - $value = $callback(); - - $this->redis->setex($key, $ttl, serialize($value)); - - return $value; - } - - /** - * @param string $key - */ - public function invalidate($key) - { - $this->redis->del($key); - } -} diff --git a/src/Translation/CompilerPass.php b/src/Translation/CompilerPass.php index 378256b..db69860 100644 --- a/src/Translation/CompilerPass.php +++ b/src/Translation/CompilerPass.php @@ -10,7 +10,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; /** - * @CompilerPassAnnotation + * @CompilerPassAnnotation("Core.Translation.CompilerPass") */ class CompilerPass implements CompilerPassInterface { diff --git a/src/Util/IdGenerator.php b/src/Util/IdGenerator.php index 0f7d637..1c8869f 100644 --- a/src/Util/IdGenerator.php +++ b/src/Util/IdGenerator.php @@ -24,7 +24,7 @@ class IdGenerator */ public function generateUniqueId($type = self::DEFAULT_TYPE) { - return $this->getRedis()->INCR(sprintf(self::KEY, $type)); + return $this->getRedis()->incr(sprintf(self::KEY, $type)); } /**