Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laminas Zendframework Bridge Laravel Package

laminas/laminas-zendframework-bridge

Provides compatibility bridge for Laminas to ease migration from Zend Framework. Maps legacy Zend class names to Laminas equivalents via autoloading, allowing existing Zend-based apps and libraries to run with minimal changes during upgrades.

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Install the package: composer require laminas/laminas-zendframework-bridge
  2. No configuration needed: Once installed, the bridge auto-registers via Composer’s autoloader—just ensure it’s included in your autoloading setup (it is by default).
  3. First use case: Start by updating dependencies—e.g., replace zendframework/zend-mvc with laminas/laminas-mvc—then run your app. Existing use Zend\... references in code continue to work thanks to namespace re-mapping.

Implementation Patterns

  • Namespace migration: Gradually update use Zend\... statements to use Laminas\... as you touch files. The bridge ensures both old and new namespaces resolve correctly during the transition.
  • Partial upgrades: Upgrade one component at a time (e.g., laminas/laminas-db while still using laminas/laminas-mvc), with the bridge resolving autoloading and class name conflicts behind the scenes.
  • Shared environments: In projects using both legacy Zend packages (e.g., zf1 components) and Laminas packages, the bridge prevents fatal class-redeclaration errors by ensuring only one canonical class per FQCN is loaded.
  • Testing during migration: Write tests against both old and new namespaces (e.g., Zend\ServiceManager and Laminas\ServiceManager) to validate full compatibility during refactoring.

Gotchas and Tips

  • Runtime autoloading conflicts: If you manually register Composer autoloaders after the bridge (e.g., via require vendor/autoload.php more than once), remapping may be skipped. Always include autoloader once, early.
  • Static analysis tools may complain: IDEs or PHPStan/Psalm may not resolve Zend\* aliases. Add explicit @method or @property annotations, or configure PHPStan to treat Zend\* as aliases for Laminas\*.
  • Configuration drift: The bridge does not update configuration keys (e.g., Zend\Navigation keys in config.global.php). Document and replace these manually or via script after verifying runtime compatibility.
  • Not a migration end-state: The bridge is temporary scaffolding. Aim to fully remove it once all Zend\* references are replaced—keep composer require --dev codeception/module-zendframework only if using legacy acceptance helpers.
  • Check for known issues: Some edge cases (e.g., trigger_error() usages for deprecated ZF APIs) may still require code updates despite the bridge’s best efforts. Review Laminas’ migration guide alongside.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport