Skip to content

Commit

Permalink
Fix problem with auth in extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbrouwers committed Sep 24, 2015
1 parent 0f546a7 commit d74d5c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 36 deletions.
7 changes: 4 additions & 3 deletions src/Configuration/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function createDriver($driver, array $settings = [])
// will check for a custom driver creator, which allows developers to create
// drivers using their own customized driver creator Closure to create it.
if (isset($this->customCreators[$driver])) {
return $this->callCustomCreator($driver);
return $this->callCustomCreator($driver, $settings);
} elseif (class_exists($class)) {
return $this->container->make($class)->resolve($settings);
}
Expand All @@ -94,12 +94,13 @@ protected function createDriver($driver, array $settings = [])
* Call a custom driver creator.
*
* @param string $driver
* @param array $settings
*
* @return mixed
*/
protected function callCustomCreator($driver)
protected function callCustomCreator($driver, array $settings = [])
{
return $this->customCreators[$driver]($this->container);
return $this->customCreators[$driver]($settings, $this->container);
}

/**
Expand Down
35 changes: 2 additions & 33 deletions src/DoctrineServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\ClassMetadataFactory;
use Illuminate\Auth\AuthManager;
use Illuminate\Support\ServiceProvider;
use InvalidArgumentException;
use LaravelDoctrine\ORM\Auth\DoctrineUserProvider;
Expand All @@ -31,21 +30,15 @@

class DoctrineServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
* @var bool
*/
//protected $defer = true;

/**
* Boot service provider.
*/
public function boot()
{
$this->app->make(ExtensionManager::class)->boot();

$this->extendAuthManager();

$this->app->make(ExtensionManager::class)->boot();

if (!$this->isLumen()) {
$this->publishes([
$this->getConfigPath() => config_path('doctrine.php'),
Expand Down Expand Up @@ -253,30 +246,6 @@ protected function registerConsoleCommands()
]);
}

/**
* Get the services provided by the provider.
* @return string[]
*/
public function provides()
{
return [
'auth',
'em',
'registry',
'validation.presence',
AuthManager::class,
EntityManager::class,
DoctrineManager::class,
ConnectionManager::class,
CacheManager::class,
MetaDataManager::class,
ClassMetadataFactory::class,
EntityManagerInterface::class,
ExtensionManager::class,
ManagerRegistry::class
];
}

/**
* @return bool
*/
Expand Down

0 comments on commit d74d5c8

Please sign in to comment.