Commit 842d1217 authored by katbailey's avatar katbailey
Browse files

Various coding standards fixes, cleanup and documentation fixes

parent 8ffe09ee
......@@ -2632,6 +2632,10 @@ function drupal_language_initialize() {
* directly.
*
* @see Drupal\Core\Language\LanguageManager
*
* @param $type
* The type of language object needed, e.g. LANGUAGE_TYPE_INTERFACE. Passing
* NULL invokes a reset of the statically stored language type objects.
*/
function language_manager($type = NULL) {
// Keep track of whether we are in a multilingual environment.
......
......@@ -1412,7 +1412,10 @@ function install_bootstrap_full(&$install_state) {
// Clear the module list that was overriden earlier in the process.
// This will allow all freshly installed modules to be loaded.
module_list_reset();
// @todo Figure out how best to handle the Kernel constructor parameters.
// @todo The constructor parameters for the Kernel class are for environment,
// e.g. 'prod', 'dev', and a boolean indicating whether it is in debug mode.
// Drupal does not currently make use of either of these, though that may
// change with http://drupal.org/node/1537198.
$kernel = new DrupalKernel('prod', FALSE);
$kernel->boot();
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
......
......@@ -12,10 +12,8 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
class RegisterKernelListenersPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
class RegisterKernelListenersPass implements CompilerPassInterface {
public function process(ContainerBuilder $container) {
if (!$container->hasDefinition('dispatcher')) {
return;
}
......
......@@ -15,20 +15,30 @@
/**
* The DrupalKernel class is the core of Drupal itself.
*
* This class is responsible for building the Dependency Injection Container and
* also deals with the registration of bundles. It allows registered bundles to
* add their services to the container. Core provides the CoreBundle, which adds
* the services required for all core subsystems. Each module can then add its
* own bundle, i.e. a subclass of Symfony\Component\HttpKernel\Bundle, to
* register services to the container.
*/
class DrupalKernel extends Kernel {
/**
* Returns an array of available bundles.
*/
public function registerBundles() {
$bundles = array(
new CoreBundle(),
);
// TODO: Remove the necessity of calling system_list() to find out which
// @todo Remove the necessity of calling system_list() to find out which
// bundles exist. See http://drupal.org/node/1331486
$modules = array_keys(system_list('module_enabled'));
foreach ($modules as $module) {
$camelized = ContainerBuilder::camelize($module);
$class = "\Drupal\\{$module}\\{$camelized}Bundle";
$class = "Drupal\\{$module}\\{$camelized}Bundle";
if (class_exists($class)) {
$bundles[] = new $class();
}
......@@ -42,8 +52,8 @@ public function registerBundles() {
*/
protected function initializeContainer() {
// @todo We should be compiling the container and dumping to php so we don't
// have to recompile every time. There is a separate issue for this, see
// http://drupal.org/node/1668892.
// have to recompile every time. There is a separate issue for this, see
// http://drupal.org/node/1668892.
$this->container = $this->buildContainer();
$this->container->set('kernel', $this);
drupal_container($this->container);
......
......@@ -36,8 +36,8 @@ class ExceptionController extends ContainerAware {
* and the name of the method to call, we can't just register it to the DIC
* the regular way.
*
* @todo: This probably doesn't belong here, but I'm not sure where would be a better
* place to put it... in a class of its own?
* @todo This probably doesn't belong here, but I'm not sure where would be a
* better place to put it... in a class of its own?
*/
public static function getExceptionListener(Container $container) {
$negotiation = $container->get('content_negotiation');
......
......@@ -37,6 +37,5 @@
drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE);
$kernel = new DrupalKernel('prod', FALSE);
$kernel->boot();
$response = $kernel->handle($request)->prepare($request)->send();
$kernel->terminate($request, $response);
......@@ -36,6 +36,5 @@
drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE);
$kernel = new DrupalKernel('prod', FALSE);
$kernel->boot();
$response = $kernel->handle($request)->prepare($request)->send();
$kernel->terminate($request, $response);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment