Phile Versions Save

A flat file CMS with a swappable parser and template engine.

1.11.1

3 years ago

Noteworthy Changes

  • Added support for PHP 7.4 #336 and dropping PHP 7.1

Update Notes

Developer Notes

  • [changed] PHPUnit was updated from version 7 to 8

For other improvements and bugfixes see the full changelog.

1.11.0

5 years ago

Noteworthy Changes

  • [added] setting for storage directory in file-persistent-storage-plugin

Update Notes

If you merge the composer.json manually don't miss the new "autoload": … key (symptom: Class <…> not found in <…> error).

Developer Notes

  • [changed] autoloads Phile core via composer #332
  • [changed] switches to Whoops for development error hander #333
  • [changed] refactores plugin handling #334

For other improvements and bugfixes see the full changelog.

1.10.0

6 years ago

Noteworthy Changes

  • Updates minimum PHP version to 7.1.0. #325
  • Changes default cache configuration (see Update Notes below). #329

Update Notes

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'];

Developer Notes

  • The Cache service is considered always available now, but only in-memory and non-persistent out of the box. #329
  • Improves PSR-15 middleware handling. #331
  • Moves middleware and HTTP related code to Phile\Http. #326
  • Improves error handling. Updates the Phile\ServiceLocator\ErrorhandlerInterface. #330

For other improvements and bugfixes see the full changelog.

1.9.0

6 years ago

Noteworthy Changes

  • The globals CONTENT_DIR and CONTENT_EXT are deprecated and set instead as 'content_dir' and 'content_ext' in config.php. #310
  • generator.php is removed #311
  • the build-in cache engine allows special chars in cache-keys again (regression from 1.8.0) #315
  • Phile\Model\Page got a new getter and setter for its repository now. #314

Update Notes

Configuration files are located in a new config/ directory now. Move your config.php to config/config.php.

Dev Notes

1.9 sees some significant core development. While it is still backwards compatible it is recommended to transition to the new facilities.

On a General Note

The two major stages in Phile are:

  1. bootstrap the environment (load configs, load plugins, populate services, …)
  2. process request into response (evaluate incoming request, find content, render content, serve response, …)

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.

Bootstrapping

The bootstrap-process isn't hardcoded in the core anymore. Advanced users can influence it in config/bootstrap.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.

// old:
Event::registerEvent('eventName', $listener);
// new:
Container::getInstance()
    ->get('Phile_EventBus')
    ->register('eventName', $listener);

Router access

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.

The Config Object

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.

Phile Globals Deprecated

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

Template variables derived from the global configuration are now available via Config::getTemplateVars().

PSR-7/PSR-15

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.

Sending a Custom Response

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.

1.8.0

6 years ago

Noteworthy Changes

  • updates minimum PHP version from 5.4 to 5.6
  • fixes composer issues #281, #303
  • updates phpFastCache from version 3 to 6 #306
    • The $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.
    • The following characters can't be used in cache keys ($key) anymore: {}()/\@:. An exception will be thrown if used.

For other improvements and bugfixes see the full changelog.

1.7.1

8 years ago

Noteworthy Changes

  • fix installation via composer (regression from 1.7.0)

For other improvements and bugfixes see the full changelog.

1.7.0

8 years ago

Noteworthy Changes

  • Fix plus sign + decoding in URL #271
  • Code follows PSR-2 conventions #272
  • Add GitHub contributing file (with fork info)
  • Use new travis-ci container infrastructure
  • Default to "ASC" if no sort order is provided
  • Trigger warning instead of failing silently if sort type isn't recognised
  • Add support for '---' meta tag fence and make meta-data fences config parameter #277
  • Update dependencies to prevent warnings
  • Cleanup version constraints
  • Remove version from composer.json
  • Cleanup root directory
  • Remove duplicate code the duplicate code in the exception handling make no sense.

For other improvements and bugfixes see the full changelog.

Update Notes

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.

Plugin/Dev Notes

Thanks

Thanks to everyone who contributed to this release!

1.6.0

8 years ago

Noteworthy Changes

  • add method Model\Page::getRawContent() #242
  • change default markdown tab width to 4 spaces1 #232/#233
  • improve ErrorHandler\Development #231
  • fix routing if a base-URL path-part also exists in content-URL #245/#246
  • setup-check is now performed in a plugin #247
  • lazy load 'pages' template variable2 #256/#257
  • include YAML parser for meta-data evaluation3 #259
  • remove theme/default/style.css4 #237/#264

For other improvements and bugfixes see the full changelog.

Update Notes

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.

Plugin/Dev Notes

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

Thanks to everyone who contributed to this release!

1.5.2

9 years ago

Noteworthy changes are:

  • fix composer doesn't pick up Phile version string

For other improvements and bugfixes see the full changelog.

1.5.1

9 years ago

Noteworthy changes are:

  • fix backwards incompatibility introduced in 1.5.0 #239/#240

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.