- BC Break ?
- Parameter injection in v2.x ?
- min
- MinPackage (router + resource + json)
$time = microtime(true); | |
register_shutdown_function( | |
function() use ($time) { | |
printf("Memory: %s / %s bytes\nTime: %f ms\nDeclared: %d classes\nIncluded: %d files > include_files.txt\n", | |
number_format(memory_get_usage()), | |
number_format(memory_get_peak_usage()), | |
(microtime(true) - $time) * 1000, | |
count(get_declared_classes()), | |
count(get_included_files()) | |
); |
<?php | |
namespace Ray\Di { interface InstanceInterface { public function getInstance($class); } } namespace Ray\Di { use Doctrine\Common\Cache\Cache; interface InjectorInterface extends InstanceInterface { public function getContainer(); public function getModule(); public function setModule(AbstractModule $module); public function getLogger(); } } namespace Ray\Di { use Aura\Di\ContainerInterface; use Aura\Di\Lazy; use Doctrine\Common\Annotations\AnnotationReader; use Doctrine\Common\Annotations\AnnotationRegistry; use Doctrine\Common\Annotations\CachedReader; use Doctrine\Common\Cache\Cache; use LogicException; use Ray\Aop\Bind; use Ray\Aop\BindInterface; use Ray\Aop\Compiler; use Ray\Aop\CompilerInterface; use Ray\Di\Exception; use ReflectionClass; use ReflectionException; use ReflectionMethod; use SplObjectStorage; use ArrayObject; use PHPParser_PrettyPrinter_Default; use Serializable; use Ray\Di\Di\Inject; class Injector implements InjectorInterface, \Serializable { protected $config; protected $container; |
O:19:"Demo\Helloworld\App":1:{s:8:"resource";O:22:"BEAR\Resource\Resource":8:{s:31:"BEAR\Resource\Resourcefactory";O:21:"BEAR\Resource\Factory":1:{s:29:"BEAR\Resource\Factoryscheme";C:30:"BEAR\Resource\SchemeCollection":11410:{x:i:0;a:3:{s:4:"page";a:1:{s:4:"self";O:25:"BEAR\Resource\Adapter\App":3:{s:35:"BEAR\Resource\Adapter\Appinjector";C:15:"Ray\Di\Injector":10729:{a:7:{i:0;O:16:"Ray\Di\Container":6:{s:8:"*forge";O:12:"Ray\Di\Forge":1:{s:9:"*config";O:13:"Ray\Di\Config":5:{s:9:"*params";C:11:"ArrayObject":35:{x:i:0;a:1:{s:1:"*";a:0:{}};m:a:0:{}}s:9:"*setter";C:11:"ArrayObject":35:{x:i:0;a:1:{s:1:"*";a:0:{}};m:a:0:{}}s:10:"*unified";a:0:{}s:13:"*definition";C:17:"Ray\Di\Definition":386:{x:i:0;a:8:{s:5:"Scope";s:9:"Prototype";s:13:"PostConstruct";N;s:10:"PreDestroy";N;s:6:"Inject";a:0:{}s:13:"ImplementedBy";a:0:{}s:4:"user";a:0:{}s:8:"optional";a:0:{}s:1:"*";a:0:{}};m:a:1:{s:27:"Ray\Di\Definitiondefaults";a:7:{s:5:"Scope";s:9:"Prototype";s:13:"PostConstruct";N;s:10:"PreDestroy";N;s:6:"Inject";a:0:{}s:13:"Im |
.bearsunday { | |
/*! | |
* Bootstrap v3.1.1 (http://getbootstrap.com) | |
* Copyright 2011-2014 Twitter, Inc. | |
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |
*/ | |
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */ | |
/*# sourceMappingURL=bootstrap.css.map */ | |
} | |
.bearsunday html { |
<?php | |
use Ray\Di\ProviderInterface; | |
use Ray\Di\Di\Inject; | |
interface CarInterface{} | |
interface CarConfigInterface{} | |
class CarConfig extends \ArrayObject implements CarConfigInterface{} |
// original | |
$this['events'] = $this->resource->get->uri('app://spout/resources/listing') | |
->withQuery([ | |
'type' => 'event', | |
'sort' => 'datetime' | |
]) | |
->eager | |
->request()['resources']; | |
// link |
/** | |
* @param string|Uri $uri | |
* @param array $query | |
* | |
* @return callable | |
*/ | |
function resource($uri, array $query) | |
{ | |
$resource = (new Injector(new AppModule, __DIR__ . '/tmp'))->getInstance(ResourceInterface::class); | |
$request = $resource->get->uri($uri)->withQuery($query)->eager->request(); |
Aura v2 https://github.com/auraphp/Aura.Router/blob/d50ad32e20409bd7fc8522dc81bf220b35c974aa/src/Router.php | |
public function match($path, array $server = array()) | |
Symfony http://api.symfony.com/2.0/Symfony/Component/Routing/RouterInterface.html | |
public array match(string $pathinfo); | |
ZF2 http://framework.zend.com/manual/current/en/modules/zend.mvc.routing.html | |
public function match(Request $request); | |
PHP-Router https://github.com/dannyvankooten/PHP-Router/blob/master/src/PHPRouter/Router.php#L72 |
<?php | |
namespace Ray\Di; | |
use Ray\Aop\Compiler; | |
use Ray\Aop\Matcher; | |
use Ray\Aop\Pointcut; | |
use Ray\Aop\WeavedInterface; | |
class DependencyCompilerTest extends \PHPUnit_Framework_TestCase |