Skip to content

Commit

Permalink
Merge pull request #196 from jmolivas/drupal_classloader-function
Browse files Browse the repository at this point in the history
Drupal drupal_classloader function no longer exist
  • Loading branch information
jmolivas committed Sep 6, 2014
2 parents 467a19b + 47671d8 commit fdfcd4f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Tests/Console/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ protected function setUp()
$this->drupalBootstrap = $this->getMockBuilder('Drupal\AppConsole\Command\Helper\DrupalBootstrapHelper')
->getMock();
$this->kernel = $this->getMockBuilder('Drupal\AppConsole\Command\Helper\KernelHelper')
->disableOriginalConstructor()
->getMock();
$this->eventDispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher')
->getMock();
Expand Down
4 changes: 2 additions & 2 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env php
<?php
if (file_exists(__DIR__ . '/../../../core/vendor/autoload.php')) {
require __DIR__ . '/../../../core/vendor/autoload.php';
$class_loader = require __DIR__ . '/../../../core/vendor/autoload.php';
} else {
require __DIR__ . '/../vendor/autoload.php';
$class_loader = require __DIR__ . '/../vendor/autoload.php';
}

require __DIR__ . '/console.php';
2 changes: 1 addition & 1 deletion bin/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$application->setHelperSet(new HelperSet(array(
'bootstrap' => new DrupalBootstrapHelper(),
'finder' => new BootstrapFinderHelper(new Finder()),
'kernel' => new KernelHelper(),
'kernel' => new KernelHelper($class_loader),
'shell' => new ShellHelper(new Shell($application)),
'dialog' => new DialogHelper(),
'formatter' => new FormatterHelper(),
Expand Down
8 changes: 7 additions & 1 deletion src/Command/Helper/KernelHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@

class KernelHelper extends Helper
{
private $class_loader;

function __construct($class_loader){
$this->class_loader = $class_loader;
}

/**
* @var DrupalKernel
*/
Expand Down Expand Up @@ -42,7 +48,7 @@ public function setKernel(DrupalKernel $kernel)
public function getKernel()
{
if (!$this->kernel) {
$this->kernel = new DrupalKernel($this->environment, \drupal_classloader(), !$this->debug);
$this->kernel = new DrupalKernel($this->environment, $this->class_loader, !$this->debug);
}

return $this->kernel;
Expand Down

0 comments on commit fdfcd4f

Please sign in to comment.