This is a pull request for the changes laid out in #316. I think it strikes a reasonable balance between:
Don't pull-in to many 3rd party black boxes.
Keep the core compact and easy to understand.
Add new and useful functionality.
Start to phase out older facilities.
Keep backwards compatibility.
New Config directory
Configuration are located in a new config/ directory now
move config.php to config/config.php
move default_config.php to config/defaults.php
Core Changes
Bootstrapping
The bootstrap-process isn't hardcoded in the core anymore. Advanced users can influenced it in config/boostrap.php.
New global Container object
A new PSR-11 compatible Phile\Core\Container-class for global objects is introduced, which should serve as sole source for global objects in the future.
It is configured in config/container.php.
Event access
Static access to Phile\Core\Event is deprecated. The event-bus is available via the Container, access with Container::getInstance()->get('Phile_EventBus').
Router access
Accessing the router via new Phile\Core\Router is deprecated. The router is available via Container::getInstance()->get('Phile_Router')
New Config object
Phile_Settings as in Phile\Core\Registry::get('Phile_Settings') is deprecated and handled in a new class Phile\Core\Config now.
The Config is locked after bootstrapping and before request-processing.
The Config-class is available via the Container.
E.g. instead of Registry::get('Phile_Settings')[<property>] use Container::getInstance()->get('Phile_Config')->get(<property>).
Template Var creation
Template variables derived from the config are now available via Config::getTemplateVars().
Globals deprecated
Globals are now mapped into the Config class and can be accessed through it. E.g. instead of CACHE_DIR use Container::getInstance()->get('Phile_Config')->get('cache_dir').
The global CONTENT_DIR is deprecated, access the config-variable content_dir instead.
The global CONTENT_EXT is deprecated, access the config-variable content_ext instead.
PSR-7/PSR-15
The core migrated to a PSR-7 compatible Request and Response implementation.
The core supports PSR-15 compatible middleware now. It can either be configured in config/bootstrap.php or injected by plugins via the phile.core.middleware.add-event.
This is a pull request for the changes laid out in #316. I think it strikes a reasonable balance between:
New Config directory
config/
directory nowconfig.php
toconfig/config.php
default_config.php
toconfig/defaults.php
Core Changes
Bootstrapping
The bootstrap-process isn't hardcoded in the core anymore. Advanced users can influenced it in
config/boostrap.php
.New global Container object
A new PSR-11 compatible
Phile\Core\Container
-class for global objects is introduced, which should serve as sole source for global objects in the future.It is configured in
config/container.php
.Event access
Static access to
Phile\Core\Event
is deprecated. The event-bus is available via theContainer
, access withContainer::getInstance()->get('Phile_EventBus')
.Router access
Accessing the router via
new Phile\Core\Router
is deprecated. The router is available viaContainer::getInstance()->get('Phile_Router')
New Config object
Phile_Settings
as inPhile\Core\Registry::get('Phile_Settings')
is deprecated and handled in a new classPhile\Core\Config
now.The Config is locked after bootstrapping and before request-processing.
The
Config
-class is available via theContainer
.E.g. instead of
Registry::get('Phile_Settings')[<property>]
useContainer::getInstance()->get('Phile_Config')->get(<property>)
.Template Var creation
Template variables derived from the config are now available via
Config::getTemplateVars()
.Globals deprecated
Globals are now mapped into the Config class and can be accessed through it. E.g. instead of
CACHE_DIR
useContainer::getInstance()->get('Phile_Config')->get('cache_dir')
.The global
CONTENT_DIR
is deprecated, access the config-variablecontent_dir
instead.The global
CONTENT_EXT
is deprecated, access the config-variablecontent_ext
instead.PSR-7/PSR-15
The core migrated to a PSR-7 compatible Request and Response implementation.
The core supports PSR-15 compatible middleware now. It can either be configured in
config/bootstrap.php
or injected by plugins via thephile.core.middleware.add
-event.