Migrating to Mouf 2-beta 3 / Splash 4.2

Mouf 2 is getting near the stable release.

In the latest release, a few things have changed that might break your old application, so here is a very simple migration guide.

First of all, the ROOT_URL constant is no more declared in config.php. Instead, if you are using Splash, it will be automatically created for you. When migrating, to Splash 4.2 and Mouf 2-beta 3, you will have an error message telling you that the 'ROOT_URL' constant is already defined.

To solve this problem, connect to Mouf UI, go in the Project > Edit configuration page, and remove the `ROOT_URL` config parameter.

In the /vendor/mouf/mouf directory, delete the config.php file. It was generated by a previous version of Mouf, is no more needed, and might prevent you from accessing the configuration management page in Mouf.

The MoufUsers.php file has moved. It is now in the mouf/no_commit directory. Therefore, after upgrading, Mouf will ask you a reinstall. Just run the install process again by providing a login and password.

Also, when installing Splash 4.2, you will need to rewrite the .htaccess file.

To rewrite .htaccess, go to Packages > Installation tasks, and reinstall the Write .htaccess file. task.

The ROOT_URL is used by default in the APC cache service and the file cache service by default. You cannot anymore rely on those services. This means you must:

  1. Search for all UserService, ApcCache and FileCache instances
  2. Edit the prefix property and replace ROOT_URL by a random string. Ideally, you would create a "SECRET" constant in config.php, initialize it to some random value, and refer to this value.

Finally, you might want to commit your .htaccess file, since it is now the same file on all environments.