/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Controller
NameSizeModeActions
Component/-0755rm
Exception/-0755rm
Component.php68700644editdlrm
ComponentRegistry.php45100644editdlrm
Controller.php342280644editdlrm
ControllerFactory.php134470644editdlrm
ErrorController.php16990644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Controller/ComponentRegistry.php (4510B)
*/ class ComponentRegistry extends ObjectRegistry implements EventDispatcherInterface { use EventDispatcherTrait; /** * The controller that this collection was initialized with. * * @var \Cake\Controller\Controller|null */ protected $_Controller; /** * Constructor. * * @param \Cake\Controller\Controller|null $controller Controller instance. */ public function __construct(?Controller $controller = null) { if ($controller) { $this->setController($controller); } } /** * Get the controller associated with the collection. * * @return \Cake\Controller\Controller Controller instance or null if not set. */ public function getController(): Controller { if ($this->_Controller === null) { throw new CakeException('Controller not set for ComponentRegistry'); } return $this->_Controller; } /** * Set the controller associated with the collection. * * @param \Cake\Controller\Controller $controller Controller instance. * @return $this */ public function setController(Controller $controller) { $this->_Controller = $controller; $this->setEventManager($controller->getEventManager()); return $this; } /** * Resolve a component classname. * * Part of the template method for {@link \Cake\Core\ObjectRegistry::load()}. * * @param string $class Partial classname to resolve. * @return string|null Either the correct class name or null. * @psalm-return class-string|null */ protected function _resolveClassName(string $class): ?string { return App::className($class, 'Controller/Component', 'Component'); } /** * Throws an exception when a component is missing. * * Part of the template method for {@link \Cake\Core\ObjectRegistry::load()} * and {@link \Cake\Core\ObjectRegistry::unload()} * * @param string $class The classname that is missing. * @param string|null $plugin The plugin the component is missing in. * @return void * @throws \Cake\Controller\Exception\MissingComponentException */ protected function _throwMissingClassError(string $class, ?string $plugin): void { throw new MissingComponentException([ 'class' => $class . 'Component', 'plugin' => $plugin, ]); } /** * Create the component instance. * * Part of the template method for {@link \Cake\Core\ObjectRegistry::load()} * Enabled components will be registered with the event manager. * * @param string $class The classname to create. * @param string $alias The alias of the component. * @param array $config An array of config to use for the component. * @return \Cake\Controller\Component The constructed component class. * @psalm-suppress MoreSpecificImplementedParamType * @psalm-param class-string $class */ protected function _create($class, string $alias, array $config): Component { /** @var \Cake\Controller\Component $instance */ $instance = new $class($this, $config); $enable = $config['enabled'] ?? true; if ($enable) { $this->getEventManager()->on($instance); } return $instance; } }