Migration from 2.0 to 2.1

1. Introduction

Version 2.1. is the second release of the 2.X series. It contains lots of new features and optimizations. Besides, it fixes some issues of version 2.0.

To run your application based on the new version small adaptions are necessary to your configuration files. To ease change the new version ships an automated migration and a tool to separate application from framework code.

The below chapters contain an in-depth description on how to switch to APF 2.1 and which kind of changes have to be applied to your existing application(s) to run them based on this version.

2. Automated migration

As you might already be familiar with from release 2.0 migration can be done using the migration script shipped along with the release. This release includes changes to configuration files. Using migrate-config.sh you can easily be adapted your existing application to the new scheme.

Please be sure to execute all steps described under Migration from 1.17 to 2.0. In case you are using an order version of the APF, please completely migrate to version 2.0. Instructions can be taken from Articles.

In case your development environment is windows, please install the latest cygwin version (download under cygwin.com). Migration for Windows Batch Scripts is not supported.

To update the configuration files to the latest scheme, please execute the script as follows:

Please change to the configuration directory before execution to avoid unexpected results.
Code
$ cd /path/to/my/config $ ../migration/migrate-config.sh /cygdrive/c/xampp/php/php ############################################# # APF 2.1 automatic configuration migration # ############################################# Checking PHP executable available ... [OK] Using given php executable at /cygdrive/c/xampp/php/php. PHP Version: 5.4.16. ############################################# Starting configuration migration ... * Front controller configuration files ... * Database configuration files ... ############################################# Migration done! Please check your configuration and follow instructions within migration documentation!

3. Manual migration

Unfortunately, not all components of your application can be migrated by the delivered scripts. This chapter lists all changes to be applied by hand.

Implementation of feature request ID#171 changed the transformation logic of DOM nodes. This means that the the content of the DOM note under transformation no longer is injected to the document controller field

PHP code
$this->content

For this reason, you can no longer access it using

PHP code
$this->getContent()

To access the content of the current DOM node, please refer to the current document via

PHP code
$this->getDocument()

Given the Document instance you can then query the content by

PHP code
$this->getDocument()->getContent()

or manipulate it with

PHP code
$this->getDocument()->setContent(...)
Please note that manipulation of DOM node content may lead to unexpected behaviour. Thus it is not recommended to change content within document controllers.

Comments

Do you want to add a comment to the article above, or do you want to post additional hints? So please click here. Comments already posted can be found below.
There are no comments belonging to this article.