Beispiel #1
0
<?php

define('SF_ROOT_DIR', realpath(dirname(__FILE__) . '/..'));
define('SF_APP', 'form');
define('SF_ENVIRONMENT', 'dev');
define('SF_DEBUG', true);
require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';
require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'AppKernel.php';
AppKernel::getInstance()->getController()->dispatch();
Beispiel #2
0
 public function initAppServiceContainer($container_class = 'AppServiceContainer')
 {
     $builder = new ContainerBuilder();
     $configuration = AppKernel::getInstance()->getConfiguration();
     $parameters = $configuration->parameters;
     $parameters = $parameters->toArray();
     $parameters = $builder->resolveValue($parameters, array('parameters' => $parameters));
     $parameters = new Configuration($parameters);
     $configuration->parameters = $parameters;
     if (!isset($this->_serviceContainer)) {
         $container_path = CACHE_ROOT . '/' . $container_class . '.php';
         if (!file_exists($container_path) || ENV != 'online') {
             $builder->setClassName($container_class);
             $builder->setPath($container_path);
             $builder->dump($this->getConfiguration());
         }
         require_once $container_path;
         $this->_serviceContainer = call_user_func(array($container_class, 'getInstance'));
     }
 }