-
Notifications
You must be signed in to change notification settings - Fork 16
Upgrade guide
This page is intended for users of the old FACT-Finder-PHP-Framework (referred to as "the framework" in the following) who wish to upgrade to the new FACT-Finder-PHP-Library (referred to as "the library"). It explains the changes between the framework (as of v2.5.5) and the library (as of v1.0.0) along with information about how those changes may affect your integration. Note that this is not an in-depth manual: it assumes you are familiar with the framework and focuses only on the changes.
The minimum PHP version to use the library is 5.3 (the framework only needed 5.1.2). Make sure your server runs at least this version.
One of the main milestones of PHP 5.3 is the introduction of namespaces. So we ditched the pseudo-namespace naming conventions of the old framework in favor of actual namespaces. We still follow the Zend Framework conventions which means that the directory structure mirrors the name spaces. However, if you only want to use the library (as opposed to contributing to it), this barely affects you as long as you do obtain all your objects from the Loader.
The framework came with a convenient alias FF for the loader. However, now that we have namespaces we don't want to pollute the global namespace with the library. You can easily create the alias yourself though:
use \FACTFinder\Loader as FF;
Furthermore, class identifiers passed to the loader now use UpperCamelCase (or PascalCase is you prefer) instead of lowerCamelCase and backslashes instead of forward slashes. So where you might have done FF::getInstance('data/tagQuery'); before (this class didn't exist, but take it as an example), you would now do
FF::getInstance('Data\TagQuery');
Note that this is just just the fully qualified class name minus the leading \FACTFinder\. For more information on the loader, see Loader and name lookup.