Innovate faster and cut risk with PHP experts from Zend Services.
Explore Services
See How Zend Helps Leading Hosting Providers Keep Their Managed Sites on Secure PHP
Read More
Learn PHP from PHP experts with free, on-demand, and instructor led courses.
Explore Training
Submit support requests and browse self-service resources.
Explore Support
The compatibility classes provided with these migration guides use PSR-0 for greater compatibility with legacy autoloaders. If the project uses the Zend Framework 1 autoloader, just drop the Compatibility folder into the lib directory of the project, or whichever folder contains the Zend library. Example:
Compatibility
lib/ ├─ Compatibility/ ├─ Zend/
If no autoloader exists, here is the suggested PSR-0 autoloader implementation from the FIG website:
function autoload($className) { $className = ltrim($className, '\\'); $fileName = ''; $namespace = ''; if ($lastNsPos = strrpos($className, '\\')) { $namespace = substr($className, 0, $lastNsPos); $className = substr($className, $lastNsPos + 1); $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; } $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; require $fileName; } spl_autoload_register('autoload');
Alternatively, if you only need to use the class in one or two places, you can forego the autoloader and require the file directly, provided that the folder is in the include_path ini setting:
include_path
require_once 'Compatibility/Php56.php';
Increase security and cut risk by simplifying PHP application upgrades and migrations.
Long Term Support buys organizations time to migrate.