33 lines
700 B
PHP
33 lines
700 B
PHP
<?php
|
|
|
|
namespace Httpcb;
|
|
|
|
use Phalcon\Di\FactoryDefault as DiDefault;
|
|
use Phalcon\Di\Injectable;
|
|
use Phalcon\DiInterface;
|
|
use Phalcon\Mvc\Application;
|
|
|
|
class Bootstrap extends Injectable
|
|
{
|
|
public function __construct(DiInterface $di = null)
|
|
{
|
|
if ($di === null) {
|
|
$di = new DiDefault();
|
|
}
|
|
$this->setDI($di);
|
|
}
|
|
|
|
public function run()
|
|
{
|
|
$app = new Application($this->getDI());
|
|
|
|
// Force autoloader if registered.
|
|
// Should be needed by almost all other services.
|
|
$di = $this->getDI();
|
|
if ($di->has('loader')) {
|
|
$di->get('loader');
|
|
}
|
|
|
|
return $app->handle()->getContent();
|
|
}
|
|
}
|