A flat file CMS with a swappable parser and template engine.
For other improvements and bugfixes see the full changelog.
If you merge the composer.json
manually don't miss the new "autoload": …
key (symptom: Class <…> not found in <…> error).
For other improvements and bugfixes see the full changelog.
The persistent cache for improved performance (old default setting) must be activated manually now:
// in your config/config.php
$config['plugins']['phile\\phpFastCache'] = ['active' => true, 'storage' => 'files'];
Phile\Http
. #326Phile\ServiceLocator\ErrorhandlerInterface
. #330For other improvements and bugfixes see the full changelog.
CONTENT_DIR
and CONTENT_EXT
are deprecated and set instead as 'content_dir'
and 'content_ext'
in config.php
. #310generator.php
is removed #311Phile\Model\Page
got a new getter and setter for its repository now. #314Configuration files are located in a new config/
directory now. Move your config.php
to config/config.php
.
1.9 sees some significant core development. While it is still backwards compatible it is recommended to transition to the new facilities.
The two major stages in Phile are:
Plug-ins should consider in which phase they are doing what. As a rule of thumb:
If a plugin provides facilities to the core (e.g. implements a ServiceLocator), then it probably wants to register its functionality during the bootstrap stage (e.g. plugins_loaded
event). The bootstrap phase should not create or send output.
The more common case is that a plugin requires facilities from the core (current page, template engine) to create or manipulate output. This should be done in events during the processing phase.
The bootstrap-process isn't hardcoded in the core anymore. Advanced users can influence it in config/bootstrap.php
.
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
.
Static access to Phile\Core\Event
is deprecated. The event-bus is available via the Container
.
// old:
Event::registerEvent('eventName', $listener);
// new:
Container::getInstance()
->get('Phile_EventBus')
->register('eventName', $listener);
Accessing the router via new Phile\Core\Router
is deprecated. The router is available via the Container
.
// old:
(new Router)->getBaseUrl();
// new:
Container::getInstance()
->get('Phile_Router')
->getBaseUrl();
The router is only available in the process-request stage after bootstrapping finished.
Phile_Settings
as in Registry::get('Phile_Settings')
is deprecated and handled in a new class Phile\Core\Config
now. The Config
-class is available via the Container
:
// old:
Registry::get('Phile_Settings')['site_title'];
// new:
Container::getInstance()
->get('Phile_Config')
->get('site_title');
The Config is locked into a read-only-mode after bootstrapping finished.
Globals are now mapped into the Config class and can be accessed through it:
// old:
$cacheDir = CACHE_DIR;
// new:
$cacheDir = Container::getInstance()
->get('Phile_Config')
->get('cache_dir');
Global constants may be deprecated in the future and be accessible through the Config only.
Template variables derived from the global configuration are now available via Config::getTemplateVars()
.
The core starts migrating to PSR-7 Request and Response objects. Zend Diactoros was chosen as 3rd-party 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.
Phile implements a PSR-15 request handler. The Phile-bootstrap adds the Phile-request-processing as the "innermost" middleware.
In the past sending output early and exiting at any moment wasn't a problem. Without additional middleware that's still the case. But with additional middleware the system may break because it depends on Phile's response "bubbling out" through the middleware.
To send output early in a middleware-conform way the following events:
after_init_core
request_uri
after_resolve_page
before_render_template
allow to set a 'response'
parameter in the event-data now. A PSR-7 response must be used, which can be created by calling one of the new factory methods of the Response
class. Long story short:
use Phile\Core\Response;
class Plugin extends AbstractPlugin
{
protected $events = ['before_render_template' => 'doMyThing'];
protected function doMyThing($eventData)
{
// …
$html = '…';
// really old (raw PHP):
header(<header>);
echo $html;
exit;
// old (Phile):
(new Response)
->setHeader(<header>)
->setBody($html)
->send()
->stop();
// new (PSR-7):
$response = (new Response)
->createHtmlResponse($html)
->withHeader(<header>);
$eventData['response'] = $response;
}
}
The core is going to stops further request-processing and sends the response early.
For other improvements and bugfixes see the full changelog.
$option
parameter in CacheInterface::set($key, $value, $time, $options)
and CacheInterface::delete($key, $options)
is deprecated. The build-in cache is going to ignore it and throw a warning if used.$key
) anymore: {}()/\@:
. An exception will be thrown if used.For other improvements and bugfixes see the full changelog.
For other improvements and bugfixes see the full changelog.
+
decoding in URL #271For other improvements and bugfixes see the full changelog.
Phile fully supports PHP 7 and all that goodness. You can also download a full version of Phile that already has the composer packages installed. 1.7.0 is a feature and bugfix release fully compatible with 1.6.x. If you encounter any problems when updating please open an issue.
Thanks to everyone who contributed to this release!
For other improvements and bugfixes see the full changelog.
1If you have code-blocks indented by less then 4 spaces in your existing markdown files you can set the parser configuration back to 2 spaces to restore the old behaviour (or update your markdown files accordingly).
3YAML makes meta-data much more powerful, but it's not fully compatible with the existing tag format. E.g. dates are converted to unix-timestamps (format dates in the template to make sure they're always in the desired format).
So the YAML parser is not activated by default yet. If you wan't to use it or test your site change the meta-data-parser config format
from Phile
to YAML
.
There's also one new composer dependency "symfony/yaml": "^2.7"
. So if you have installed Phile via composer don't forget to update the composer.json and run composer update.
4theme/default/style.css
was never used by Phile. But if you have accidentally picked up that file in your own code or templates please refer to theme/default/css/style.css
from now on.
After discussion #234 Phile strives to follow semver versioning. So the 1.6 API should be backwards-compatible to 1.5. If you encounter any problems when updating please submit an issue.
2Repositoryl\Page::findAll()
doesn't return a array anymore but a traversable object with array access. If you need a raw array straight away you can call $repository->findAll()->toArray()
.
Thanks to everyone who contributed to this release!
Noteworthy changes are:
For other improvements and bugfixes see the full changelog.
Noteworthy changes are:
Deprecated since this release:
Phile\Plugin\AbstractPlugin::initalizePlugin()
Phile\Plugin\AbstractPlugin::injectSettings()
For other improvements and bugfixes see the full changelog.
Thanks to everyone who contributed to this release.