This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
*/ | |
namespace Mvc5\Config; | |
trait Config | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
trait base_trait | |
{ | |
protected $prop = []; | |
function __construct() | |
{ | |
var_dump($this->prop); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
*/ | |
namespace Mvc5\Service; | |
use Mvc5\Arg; | |
use Mvc5\Signal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
*/ | |
include __DIR__ . '/../init.php'; | |
use Mvc5\App; | |
use Mvc5\Arg; | |
use Mvc5\Http\Request; | |
use Mvc5\Http\Response; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function create($config, array $args = [], callable $callback = null) | |
{ | |
if (!$config) { | |
return $config; | |
} | |
if (is_string($config)) { | |
$name = explode(Args::SERVICE_SEPARATOR, $config); | |
$config = array_shift($name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$plugin = $this->plugin($plugin, function($plugin) use($args, $callback) { | |
if (!is_callable($plugin)) { | |
return $this->call('service:event', [$plugin]); | |
} | |
return $plugin; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Home; | |
use Mvc5\View\Model\Base; | |
use Mvc5\View\Model\Plugin; | |
use Mvc5\View\Model\ViewModel; | |
use Mvc5\View\ViewPlugin; | |
class Model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
*/ | |
namespace Framework\Service\Container; | |
use Framework\Config\ArrayAccess; | |
use Framework\Config\Configuration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function hydrate(Config $config, $service) | |
{ | |
foreach($config->calls() as $method => $value) { | |
if (is_string($method)) { | |
if (Args::PROPERTY == $method[0]) { | |
$service->{substr($method, 1)} = $this->resolve($value); | |
continue; | |
} | |
$service->$method($this->resolve($value)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$config = [ | |
'alias' => [], | |
'events' => ['Mvc' => [function($route, $request) { var_dump($route, $request); }]], | |
'services' => [ | |
'Response' => new Response\HttpResponse, | |
'Route' => new RouteConfig([ | |
'hostname' => 'localhost', | |
'method' => 'GET', | |
'path' => '/', | |
'scheme' => 'http' |
NewerOlder