PHPackages                             bignall/zf1compat-for-zf2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. bignall/zf1compat-for-zf2

ActiveLibrary[Framework](/categories/framework)

bignall/zf1compat-for-zf2
=========================

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

v0.2.1(12y ago)0106MITPHP

Since Nov 12Pushed 9y ago1 watchersCompare

[ Source](https://github.com/bignall/ZF1CompatForZF2)[ Packagist](https://packagist.org/packages/bignall/zf1compat-for-zf2)[ RSS](/packages/bignall-zf1compat-for-zf2/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

ZF1CompatForZF2 [![Analytics](https://camo.githubusercontent.com/6b1f21b7d0515c5eb03937575e749df5100d67139c4776071951704054a45ad6/68747470733a2f2f67612d626561636f6e2e61707073706f742e636f6d2f55412d34343734383532312d382f5a4631436f6d706174466f725a46322f726561646d65)](https://github.com/igrigorik/ga-beacon)
================================================================================================================================================================================================================================================================================================================

[](#zf1compatforzf2-)

By [Rosina Bignall](http://rosinabignall.com/)

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.

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.

Installation
============

[](#installation)

To include it in your app via composer:

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

```

You may also clone the repo and set up your own loading

Zend Session Database SaveHandler Compatibility
===============================================

[](#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.

See a longer explanation on my blog:

Usage
-----

[](#usage)

Set up database table such as:

Oracle:

```
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.

```
$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
============

[](#contributing)

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

Thanks
======

[](#thanks)

The initial work on this was done as part of my work for [Social &amp; Scientific Systems, Inc.](http://www.s-3.com/).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~77 days

Total

3

Last Release

4411d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d58e58c0c0505ce1fda523b48b8a342ab921dac0be9fb7da6014cc0c5d1dd179?d=identicon)[bignall](/maintainers/bignall)

---

Top Contributors

[![bignall](https://avatars.githubusercontent.com/u/1179454?v=4)](https://github.com/bignall "bignall (12 commits)")

### Embed Badge

![Health badge](/badges/bignall-zf1compat-for-zf2/health.svg)

```
[![Health](https://phpackages.com/badges/bignall-zf1compat-for-zf2/health.svg)](https://phpackages.com/packages/bignall-zf1compat-for-zf2)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
