Example #1
0
$src_class_loader = new \src\class_loader('src\\', "{$src_root_path}src/", $phpEx);
$src_class_loader->register();
$src_class_loader_ext = new \src\class_loader('\\', "{$src_root_path}ext/", $phpEx);
$src_class_loader_ext->register();
// Set up container
$src_config_php_file = new \src\config_php_file($src_root_path, $phpEx);
$src_container_builder = new \src\di\container_builder($src_config_php_file, $src_root_path, $phpEx);
$src_container_builder->set_use_extensions(false);
$src_container_builder->set_dump_container(false);
$src_container_builder->set_use_custom_pass(false);
$src_container_builder->set_inject_config(false);
$src_container_builder->set_compile_container(false);
$other_config_path = $src_root_path . 'install/update/new/config/';
$config_path = file_exists($other_config_path . 'services.yml') ? $other_config_path : $src_root_path . 'config/';
$src_container_builder->set_config_path($config_path);
$src_container_builder->set_custom_parameters(array('core.root_path' => $src_root_path, 'core.adm_relative_path' => $src_adm_relative_path, 'core.php_ext' => $phpEx, 'core.table_prefix' => '', 'cache.driver.class' => 'src\\cache\\driver\\file'));
$src_container = $src_container_builder->get_container();
$src_container->register('dbal.conn.driver')->setSynthetic(true);
$src_container->compile();
$src_class_loader->set_cache($src_container->get('cache.driver'));
$src_class_loader_ext->set_cache($src_container->get('cache.driver'));
$src_dispatcher = $src_container->get('dispatcher');
$request = $src_container->get('request');
// make sure request_var uses this request instance
request_var('', 0, false, false, $request);
// "dependency injection" for a function
// Try and load an appropriate language if required
$language = basename($request->variable('language', ''));
if ($request->header('Accept-Language') && !$language) {
    $accept_lang_ary = explode(',', strtolower($request->header('Accept-Language')));
    foreach ($accept_lang_ary as $accept_lang) {