Exemplo n.º 1
0
<?php

include "../vendor/autoload.php";
use Aurora\MVC\Controller;
class Home extends Controller
{
    public function view($id)
    {
    }
}
$Injector = new Aurora\Injector();
$Injector->define("Aurora\\Http\\Request", [":GET" => $_GET, ":POST" => $_POST, ":COOKIE" => $_COOKIE, ":FILES" => $_FILES, ":SERVER" => $_SERVER]);
$Config = new Aurora\Config();
$Application = new Aurora\Application($Config, $Injector);
$Router = new Aurora\Router();
$Router->addRoute('GET', '/message/send/{id}', ["Home", "view"]);
$found = $Router->findRoute('GET', '/message/send/John');
$Application->run($found["action"], $found["params"]);
Exemplo n.º 2
0
<?php

$Resolver = new Aurora\Injector();
$Resolver->define("Aurora\\Http\\Request", [":get" => $_GET, ":post" => $_POST, ":cookie" => $_COOKIE, ":files" => $_FILES, ":server" => $_SERVER], true);
$Loader = new Twig_Loader_Filesystem(APP . "View/");
$Twig = new Twig_Environment($Loader, ['cache' => APP . "Storage/Cache/"]);
$Twig->addExtension(new Aurora\Twig\Extension($Resolver));
$Resolver->define("Aurora\\MVC\\View", [":Engine" => $Twig]);
$Resolver->prepare("Aurora\\MVC\\Presenter", function ($Instance) use($Config) {
    $Instance->Cookie = new Aurora\Http\Cookie();
    $Instance->Cookie->raw = true;
    $Instance->Session = new Aurora\Session(null, $Config->get("session"));
    $Instance->Session->start();
});
return $Resolver;
Exemplo n.º 3
0
        echo "baby";
    }
}
class DependencyB
{
    public $make;
    public function __construct($make)
    {
        $this->make = $make;
    }
    function callMe()
    {
        echo "baby";
    }
}
$Injector = new Aurora\Injector();
$Injector->define("A", ["DependencyA" => new DependencyA("LOOOVE"), ":doing" => "Cradt"]);
$Injector->share('A');
echo $Injector->make("A") === $Injector->make("A");
$Injector->make("A");
$Injector->define("E", [":bar" => "Great Rocket", ":call" => "jimmy"]);
class NoConstructor
{
    function callMe()
    {
        echo "baby" . PHP_EOL;
    }
}
class CallMe
{
    public function onConstruct()