"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Http/BaseApplication.php" between
cakephp-4.0.1.tar.gz and cakephp-4.0.2.tar.gz

About: CakePHP is a rapid development framework for PHP applications. Source code.

BaseApplication.php  (cakephp-4.0.1):BaseApplication.php  (cakephp-4.0.2)
skipping to change at line 85 skipping to change at line 85
* *
* @param string $configDir The directory the bootstrap configuration is hel d in. * @param string $configDir The directory the bootstrap configuration is hel d in.
* @param \Cake\Event\EventManagerInterface $eventManager Application event manager instance. * @param \Cake\Event\EventManagerInterface $eventManager Application event manager instance.
* @param \Cake\Http\ControllerFactoryInterface $controllerFactory Controlle r factory. * @param \Cake\Http\ControllerFactoryInterface $controllerFactory Controlle r factory.
*/ */
public function __construct( public function __construct(
string $configDir, string $configDir,
?EventManagerInterface $eventManager = null, ?EventManagerInterface $eventManager = null,
?ControllerFactoryInterface $controllerFactory = null ?ControllerFactoryInterface $controllerFactory = null
) { ) {
$this->configDir = $configDir; $this->configDir = rtrim($configDir, DIRECTORY_SEPARATOR) . DIRECTORY_SE PARATOR;
$this->plugins = Plugin::getCollection(); $this->plugins = Plugin::getCollection();
$this->_eventManager = $eventManager ?: EventManager::instance(); $this->_eventManager = $eventManager ?: EventManager::instance();
$this->controllerFactory = $controllerFactory; $this->controllerFactory = $controllerFactory;
} }
/** /**
* @param \Cake\Http\MiddlewareQueue $middleware The middleware queue to set in your App Class * @param \Cake\Http\MiddlewareQueue $middleware The middleware queue to set in your App Class
* @return \Cake\Http\MiddlewareQueue * @return \Cake\Http\MiddlewareQueue
*/ */
abstract public function middleware(MiddlewareQueue $middleware): Middleware Queue; abstract public function middleware(MiddlewareQueue $middleware): Middleware Queue;
skipping to change at line 139 skipping to change at line 139
public function getPlugins(): PluginCollection public function getPlugins(): PluginCollection
{ {
return $this->plugins; return $this->plugins;
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function bootstrap(): void public function bootstrap(): void
{ {
require_once $this->configDir . '/bootstrap.php'; require_once $this->configDir . 'bootstrap.php';
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function pluginBootstrap(): void public function pluginBootstrap(): void
{ {
foreach ($this->plugins->with('bootstrap') as $plugin) { foreach ($this->plugins->with('bootstrap') as $plugin) {
$plugin->bootstrap($this); $plugin->bootstrap($this);
} }
skipping to change at line 164 skipping to change at line 164
* *
* By default this will load `config/routes.php` for ease of use and backwar ds compatibility. * By default this will load `config/routes.php` for ease of use and backwar ds compatibility.
* *
* @param \Cake\Routing\RouteBuilder $routes A route builder to add routes i nto. * @param \Cake\Routing\RouteBuilder $routes A route builder to add routes i nto.
* @return void * @return void
*/ */
public function routes(RouteBuilder $routes): void public function routes(RouteBuilder $routes): void
{ {
// Only load routes if the router is empty // Only load routes if the router is empty
if (!Router::routes()) { if (!Router::routes()) {
require $this->configDir . '/routes.php'; require $this->configDir . 'routes.php';
} }
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function pluginRoutes(RouteBuilder $routes): RouteBuilder public function pluginRoutes(RouteBuilder $routes): RouteBuilder
{ {
foreach ($this->plugins->with('routes') as $plugin) { foreach ($this->plugins->with('routes') as $plugin) {
$plugin->routes($routes); $plugin->routes($routes);
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)