2017 © Pedro Peláez
 

library zf1compat-for-zf2

ZF1 (Zend Frameworks version 1) Compatibility Layer for ZF2 (Zend Frameworks version 2)

image

bignall/zf1compat-for-zf2

ZF1 (Zend Frameworks version 1) Compatibility Layer for ZF2 (Zend Frameworks version 2)

  • Monday, September 12, 2016
  • by bignall
  • Repository
  • 1 Watchers
  • 0 Stars
  • 94 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

ZF1CompatForZF2 Analytics

By Rosina Bignall, (*1)

ZF1CompatForZF2 is a compatibility layer for Zend Frameworks version 2 (ZF2) to allow it to work in conjunction with Zend Frameworks version 1 (ZF1) apps., (*2)

The goal is to allow you to write ZF2 Apps (or use pieces of ZF2 in other apps) that will work with a legacy ZF1 app., (*3)

Installation

To include it in your app via composer:, (*4)

"require": {
    "bignall/zf1compat-for-zf2": "dev-master"
}

You may also clone the repo and set up your own loading, (*5)

Zend Session Database SaveHandler Compatibility

ZF2 tracks the session name as well as the session id. ZF1 tracks only the session id. In order to make db session save handler compatible with ZF1 sessions (so that you can use the same session for both apps) we add a new save handler Zf1DbTableGateway., (*6)

See a longer explanation on my blog:, (*7)

Usage

Set up database table such as:, (*8)

Oracle:, (*9)

CREATE TABLE SYSTEM_SESSION ( 
    ID CHAR(32) NOT NULL ,
    NAME CHAR(32),
    MODIFIED INTEGER,
    LIFETIME INTEGER,
    DATA CLOB,
    CONSTRAINT MIS_SESSION_ID_PK PRIMARY KEY(ID) )

Note that while the ZF2 docs state that NAME is required, for ZF1 compatibility, NAME should not be required as ZF1 does not use it., (*10)

$tableGateway = new Zend\Db\TableGateway\TableGateway(...);
$saveHandler  = new ZF1CompatForZF2\Zend\Session\SaveHandler\Zf1DbTableGateway($tableGateway, new Zend\Session\SaveHandler\DbTableGatewayOptions($saveHandlerOptions));
$manager      = new Zend\Session\SessionManager();
$manager->setSaveHandler($saveHandler);

Contributing

Feel free to fork the repo, make your changes and send a pull request., (*11)

Thanks

The initial work on this was done as part of my work for Social & Scientific Systems, Inc.., (*12)

The Versions

12/09 2016

dev-master

9999999-dev

ZF1 (Zend Frameworks version 1) Compatibility Layer for ZF2 (Zend Frameworks version 2)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rosina Bignall

15/04 2014

v0.2.1

0.2.1.0

ZF1 (Zend Frameworks version 1) Compatibility Layer for ZF2 (Zend Frameworks version 2)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rosina Bignall

15/04 2014

v0.2.0

0.2.0.0

ZF1 (Zend Frameworks version 1) Compatibility Layer for ZF2 (Zend Frameworks version 2)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rosina Bignall

12/11 2013

v0.1.0

0.1.0.0

ZF1 (Zend Frameworks version 1) Compatibility Layer for ZF2 (Zend Frameworks version 2)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rosina Bignall