Article
Adding Composer to a Zend Framework 1 Project
Adopt Composer for application autoloading and third-party packages without pretending ZF1 is a modern laminas-migration candidate.
Composer can still help ZF1 maintainers: autoload your namespaces, pull maintained utilities, and express PHP platform constraints. That is different from claiming ZF1 is on the official Laminas migrate path.
// MODERN composer.json excerpt for app code beside vendored ZF1
{
"name": "acme/legacy-zf1-app",
"require": {
"php": "^7.4"
},
"autoload": {
"psr-0": {
"MyCompany_": "library/"
}
},
"config": {
"platform": {
"php": "7.4.33"
}
}
}
// LEGACY — rely only on include_path / Zend Studio
require_once 'MyCompany/Service/Billing.php';
// MODERN — Composer autoload in public/index.php before bootstrap
require dirname(__DIR__) . '/vendor/autoload.php';
Rules of engagement
- Pin
config.platform.phpto the runtime you actually run—verify with platform checker. - Prefer maintained packages; read legacy Composer dependencies.
- Do not install
laminas/laminas-migrationinto this project expecting ZF1 conversion.
Related tools
- Composer.json Validator Validate composer.json structure and common mistakes without running composer install.
- Legacy PHP Risk Checker Paste PHP source for a static scan that classifies removed APIs, deprecated calls, and security-sensitive leg…
- PHP Deprecated Checker Find deprecated functions and patterns in pasted PHP to prioritize modernization work.
- PHP Environment Compare Compare two PHP environment summaries to find directive and extension mismatches.
- PHP Modernization Roadmap Build an ordered migration stage list from your PHP version, framework, Composer, database API, and deploymen…
- PHP Version Compatibility Checker Scan pasted PHP for version-sensitive syntax and APIs to plan upgrades across PHP releases.
Related reading
- Migrating Zend Framework to Laminas (Complete Guide) Deep, verified migration from ZF2/ZF3 (and Apigility/Expressive) to Laminas using laminas-migration: Composer…
- Zend Framework 1 and PHP 8: Compatibility Reality Check ZF1 is not covered by laminas-migration like ZF2/ZF3. Unverified “PHP 8 compatible” claims, typical breakages…
- Zend Framework History: ZF1, ZF2, ZF3, and Laminas A maintainer-focused timeline of Zend Framework major generations and why Laminas is the official open-source…
- Zend Framework 3 Components Inventory List the zendframework/zend-* components you actually use so Laminas migration and PHP upgrades stay proporti…
- Composer Practices for Zend Framework 3 Apps Lockfiles, platform config, abandoned zendframework packages, and safe preparation for laminas-migration.