Файл: concrete5.7.5.6/concrete/src/Foundation/Service/ProviderList.php
Строк: 46
<?php
namespace ConcreteCoreFoundationService;
use ConcreteCoreApplicationApplication;
class ProviderList {
public function __construct(Application $app) {
$this->app = $app;
}
/**
* Loads and registers a class ServiceProvider class.
* @param string $class
* @return void
*/
public function registerProvider($class) {
$this->createInstance($class)->register();
}
/**
* Creates an instance of the passed class string, override this to change how providers are instantiated
*
* @param string $class The class name
* @return ConcreteCoreFoundationServiceProvider
*/
protected function createInstance($class)
{
return new $class($this->app);
}
/**
* Registers an array of service group classes.
* @param array $groups
* @return void
*/
public function registerProviders($groups) {
foreach($groups as $group) {
$this->registerProvider($group);
}
}
/**
* We are not allowed to serialize $this->app
*/
public function __sleep() {
unset($this->app);
}
}