| Prev | Next |
PHP5 was a huge step in PHP histroy. It is completly other language then PHP4 (and older versions). POT is written for PHP5 but currently most PHP5 installations are done with PHP 5.1 and higher versions. PHP 5.0 differs from next versions in few details (or even not details, but huge changes, but those mostly doesn't affect POT). There are some important things you should know if you use POT with PHP 5.0.
POT requires PDO extension. It is bundled with PHP since 5.1 version. If you use PHP 5.0 you still can install PDO, but you need to do that using PECL extensions. Detailed information about how to do that are in PHP manual PDO page.
If you use PHP 5.0 you should include special compatibility assurance library. POT uses some mechanisms that exists since PHP 5.1 like Countable interface. It doesn't disallow you using POT with PHP 5.0. Compatibility library will create unexisting interfaces, classes, functions, constants etc. However keep in mind that you won't be able to use PHP 5.1 and newer language mechanisms as it is not possible to redefine PHP behaviour. Here is an example:
It is important to note that you have to load compat.php library before loading POT toolkit itself. This library by itself is not connected with POT in any way and you can freely separate it.
Compatibility library makes you sure, that POT scripts won't cause FATAL errors if you run them on older versions of PHP. However it doesn't introduce any new mechanisms so you won't find anything new in this package. It is safe to include compat.php file even if you work with PHP version 5.1 or newer, but there is no point in doing that.
POT registers own __autoload() handler with spl_autoload_register(). This function exists since PHP 5.1.2. Compatibility library defines this function as definer of another function - ordinary __autoload(). If you have own __autoload() function, compat's spl_autoload_register() won't redefine __autoload() to avoid E_ERROR. You then need to bind POT::loadClass() method to your __autoload() function manualy.
No way. POT was written using new PHP5 object engine - you cant use it with PHP4 and older versions of PHP, PHP/FI.
| Prev | Up | Next |
| Basics | POT | Database |