2017 © Pedro Peláez
 

library zf1-module

Adds support for running ZF1 application in ZF2

image

xemlock/zf1-module

Adds support for running ZF1 application in ZF2

  • Monday, January 30, 2017
  • by xemlock
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Zf1Module

Zf1Module allows running ZF1 application in Zend Framework 2., (*1)

Installation

Via composer, (*2)

Configuration

Add Zf1Module to the module list in config/application.config.php and see the magic happens. Almost, because you need to configure it first:, (*3)

'zf1' => array(
    'environment' => 'production',
    'config' => 'path/to/application.ini',
)

Usage

By default the ZF1 application will be an instance of \Zend_Application. You can override this class by providing application_class setting. The only requirement is that this class constructor must follow the same arguments as that of \Zend_Application., (*4)

When instantiating application a ServiceLocator plugin resource is registered at bootstrap. This allows accessing ZF2 service locator in ZF1 in the following way:, (*5)

Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('ServiceLocator');

To access ZF1 resources in ZF2 code you can retrieve the bootstrap instance with:, (*6)

$serviceManager->get('Zf1Module\Application')->getBootstrap();

The Versions