Exemplo n.º 1
0
 /**
  * @throws TestCaseException
  */
 public static function execute()
 {
     BootstrapManager::listener(function (StartupEvent $startupEvent) {
         $startupEvent->getContext()->create(static::class)->run();
     });
     BootstrapManager::bootstrap();
 }
Exemplo n.º 2
0
 * Edde is self-hosted; it is proof-of-concept or it can be used as tutorial. Many experimental features
 * are implemented here.
 */
use Edde\Api\Application\IApplication;
use Edde\Ext\Neon\NeonFile;
use Edde\Runtime\Bootstrap\BootstrapManager;
use Edde\Runtime\Bootstrap\Event\ConfigurationEvent;
use Edde\Runtime\Bootstrap\Event\SetupEvent;
use Edde\Runtime\Bootstrap\Event\StartupEvent;
use Tracy\Debugger;
require_once __DIR__ . '/../lib/tracy.phar';
require_once __DIR__ . '/../../src/loader.php';
BootstrapManager::bootstrap(function (ConfigurationEvent $configurationEvent) {
    $configurationEvent->getConfiguration()->addResource(new NeonFile(__DIR__ . '/../config/config.neon'))->addResource(new NeonFile(__DIR__ . '/../config/config.local.neon'), false);
}, function (SetupEvent $setupEvent) {
    $configuration = $setupEvent->getConfiguration();
    if ($configuration->isDevelMode()) {
        Debugger::enable(Debugger::DEVELOPMENT, $configuration->getDir('log'));
        Debugger::$strictMode = true;
        Debugger::$maxDepth = 12;
        Debugger::$maxLen = 8196;
    }
}, function (StartupEvent $startupEvent) {
    /**
     * optional - create (by default Edde's implementation) IApplication and run it; it holds whole life-cycle
     */
    $startupEvent->getContext()->create(IApplication::class)->run();
});
/**
 * and thats all; look around, there is many things to explore :)
 */