Beispiel #1
0
 /**
  * Register facade application class
  * @method Facade
  * @access public
  * @mode static
  */
 public static function Facade()
 {
     Facade::setFacadeApplication(self::$app);
     Facade::registerAliases();
 }
Beispiel #2
0
if (isset($config['cookies'])) {
    foreach ($config['cookies'] as $configKey => $configVal) {
        $config['slim']['cookies.' . $configKey] = $configVal;
    }
}
/**
 * Initialize Slim application
 */
$app = new \Slim\Slim($config['slim']);
$app->view->parserOptions = $config['twig'];
$app->view->parserExtensions = array(new \Slim\Views\TwigExtension());
/**
 * Initialize the Slim Facade class
 */
\SlimFacades\Facade::setFacadeApplication($app);
\SlimFacades\Facade::registerAliases($config['aliases']);
/**
 * Publish the configuration to Slim instance so controller have access to it via
 */
foreach ($config as $configKey => $configVal) {
    if ($configKey != 'slim') {
        $app->config($configKey, $configVal);
        if ($configKey != 'cookies') {
            foreach ($configVal as $subConfigKey => $subConfigVal) {
                $app->config($configKey . '.' . $subConfigKey, $subConfigVal);
            }
        }
    }
}
/**
 * if called from the install script, disable all hooks, middlewares, and database init
Beispiel #3
0
 /**
  * Boot up Slim Facade accessor
  * @param  Array $config
  */
 public function bootFacade($config)
 {
     Facade::setFacadeApplication($this->app);
     Facade::registerAliases($config);
 }
Beispiel #4
0
/**
 * Initialize Slim application
 */
$app = new \Slim\Slim($appconfig['app']);
$app->view->parserOptions = $appconfig['twig'];
$app->view->parserExtensions = array(new \Slim\Views\TwigExtension());
/**
 * Initialize Slim ServiceManager
 */
$services = new \SlimServices\ServiceManager($app);
$services->registerServices($config->get('app.providers'));
/**
 * Initialize the Slim Facade class
 */
\SlimFacades\Facade::setFacadeApplication($app);
\SlimFacades\Facade::registerAliases($config->get('app.aliases'));
/**
 * if called from the install script, disable all hooks, middlewares, and database init
 */
if (!defined('INSTALL')) {
    /**
     * Start the route
     */
    require APP_PATH . 'filters.php';
    require APP_PATH . 'routes.php';
}
return $app;
//include class
class Config
{
    /**