public function initialize(\Boris\Boris $boris, $dir) { parent::initialize($boris, $dir); chdir($dir); define('DRUPAL_ROOT', $dir); require_once "{$dir}/includes/bootstrap.inc"; drupal_override_server_variables(); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); }
public function initialize(\Boris\Boris $boris, $dir) { $config = json_decode(file_get_contents("{$dir}/composer.json"), true); if (isset($config['name'])) { $this->name = $config['name']; } parent::initialize($boris, $dir); echo "Using {$dir}/composer.json\n"; $loader = (require "{$dir}/vendor/autoload.php"); $boris->onStart(function ($worker, $vars) use($loader) { $worker->setLocal('loader', $loader); }); }
public function initialize(\Boris\Boris $boris, $dir) { parent::initialize($boris, $dir); require "{$dir}/ezpublish/bootstrap.php.cache"; require_once "{$dir}/ezpublish/EzPublishKernel.php"; $kernel = new \EzPublishKernel('dev', true); $kernel->loadClassCache(); $kernel->boot(); $boris->onStart(function ($worker, $vars) use($kernel) { $worker->setLocal('kernel', $kernel); $worker->setLocal('container', $kernel->getContainer()); }); }
public function initialize(\Boris\Boris $boris, $dir) { parent::initialize($boris, $dir); $classloader = (require_once $dir . '/core/vendor/autoload.php'); $request = \Symfony\Component\HttpFoundation\Request::createFromGlobals(); $kernel = \Drupal\Core\DrupalKernel::createFromRequest($request, $classloader, 'dev'); $kernel->boot(); $kernel->prepareLegacyRequest($request); \Drupal::getContainer()->set('request', $request); $boris->onStart(function ($worker, $vars) use($kernel) { $worker->setLocal('kernel', $kernel); $worker->setLocal('container', $kernel->getContainer()); }); }
public function initialize(\Boris\Boris $boris, $dir) { parent::initialize($boris, $dir); if (is_file("{$dir}/app/bootstrap.php.cache")) { require "{$dir}/app/bootstrap.php.cache"; } else { require "{$dir}/app/autoload.php"; } require_once "{$dir}/app/AppKernel.php"; $kernel = new \AppKernel('dev', true); $kernel->loadClassCache(); $kernel->boot(); $boris->onStart(function ($worker, $vars) use($kernel) { $worker->setLocal('kernel', $kernel); $worker->setLocal('container', $kernel->getContainer()); }); }