private function __construct()
 {
     require_once __DIR__ . '/autoload.php';
     Application::getInstance();
     try {
         self::setAssetsFolder();
         self::setCssFolder();
         self::setJsFolder(Application::getConfigItem('jsFolder'));
     } catch (\Exception $e) {
         echo 'Error setting assets: ', $e->getMessage();
     }
 }
Example #2
0
 public function __construct()
 {
     $this->app = Application::getInstance();
 }
Example #3
0
<?php

require_once __DIR__ . '/vendor/autoload.php';
use App\Application, App\config\Config, App\config\reader\PhpConfigReader;
try {
    $configReader = new PhpConfigReader(__DIR__ . '/config/main.php');
    $config = new Config($configReader);
    if (!$config->validate()) {
        throw new \Exception($config->getErrorMessage());
    }
    Application::getInstance($config)->run();
} catch (\Exception $e) {
    echo "ERROR\n";
    echo $e->getMessage() . "\n";
}
Example #4
0
 | BOOTSTRAP
 |-------------------------------------------------------------------------
 |
 | Carrega o arquivo responsavel pelo carregamento das classes e definiçoes
 | basicas iniciais
 |
*/
require '../bootstrap.php';
/*
 |-------------------------------------------------------------------------
 | ROTAS
 |-------------------------------------------------------------------------
 |
 | Carrega o arquivo contento as definiçoes de rota
 |
*/
$routes = (require_once '../config/routes.php');
/*
 |-------------------------------------------------------------------------
 | APLICAÇAO
 |-------------------------------------------------------------------------
 |
 | Inicializa a aplicaçao
*/
$app = Application::getInstance($routes);
/**
 * //TRUE caso queira usar o debug, caso FALSE os erros serão lançados como
 * Exception e registrados no log da aplicação
 */
$app->init(true);
$app->finalyze();
Example #5
0
 /**
  * Set the globally available instance of the container.
  *
  * @return static 
  * @static 
  */
 public static function getInstance()
 {
     //Method inherited from \Illuminate\Container\Container
     return \App\Application::getInstance();
 }