Ejemplo n.º 1
0
 /**
  * Initialises own (and legacy) components, like service manager.
  */
 protected function bootstrap()
 {
     // taken from lib/bootstrap.php
     // legacy handling
     $core = new \Zikula_Core();
     $core->setKernel($this->kernel);
     $core->boot();
     // these two events are called for BC only. remove in 2.0.0
     $core->getDispatcher()->dispatch('bootstrap.getconfig', new GenericEvent($core));
     $core->getDispatcher()->dispatch('bootstrap.custom', new GenericEvent($core));
     foreach ($GLOBALS['ZConfig'] as $config) {
         $core->getContainer()->loadArguments($config);
     }
     $GLOBALS['ZConfig']['System']['temp'] = $core->getContainer()->getParameter('temp_dir');
     $GLOBALS['ZConfig']['System']['datadir'] = $core->getContainer()->getParameter('datadir');
     $GLOBALS['ZConfig']['System']['system.chmod_dir'] = $core->getContainer()->getParameter('system.chmod_dir');
     \ServiceUtil::getManager($core);
     \EventUtil::getManager($core);
     $core->attachHandlers('config/EventHandlers');
     return $core;
 }
Ejemplo n.º 2
0
    $kernelConfig = array_merge($kernelConfig, Yaml::parse(file_get_contents($file)));
}
$kernelConfig = $kernelConfig['parameters'];
if ($kernelConfig['env'] !== 'prod') {
    // hide deprecation errors
    // @todo remove exclusions for Core-2.0
    Debug::enable(E_ALL & ~E_USER_DEPRECATED);
}
if (isset($kernelConfig['umask']) && !is_null($kernelConfig['umask'])) {
    umask($kernelConfig['umask']);
}
require __DIR__ . '/../app/ZikulaKernel.php';
$kernel = new ZikulaKernel($kernelConfig['env'], $kernelConfig['debug']);
$kernel->boot();
// legacy handling
$core = new Zikula_Core();
$core->setKernel($kernel);
$core->boot();
// these two events are called for BC only. remove in 2.0.0
$core->getDispatcher()->dispatch('bootstrap.getconfig', new GenericEvent($core));
$core->getDispatcher()->dispatch('bootstrap.custom', new GenericEvent($core));
foreach ($GLOBALS['ZConfig'] as $config) {
    $core->getContainer()->loadArguments($config);
}
$GLOBALS['ZConfig']['System']['temp'] = $core->getContainer()->getParameter('temp_dir');
$GLOBALS['ZConfig']['System']['datadir'] = $core->getContainer()->getParameter('datadir');
$GLOBALS['ZConfig']['System']['system.chmod_dir'] = $core->getContainer()->getParameter('system.chmod_dir');
ServiceUtil::getManager($core);
EventUtil::getManager($core);
$core->attachHandlers('config/EventHandlers');
return $core;