PHPackages                             roave/zf2-for-1 - 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. roave/zf2-for-1

AbandonedArchivedLibrary[Framework](/categories/framework)

roave/zf2-for-1
===============

Compatibility layer for ZF1 application allowing usage of ZF2 features

0.2.0(11y ago)3226.2k16[1 issues](https://github.com/Roave/zf2-for-1/issues)PHPPHP &gt;=5.3.3

Since Jan 31Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Roave/zf2-for-1)[ Packagist](https://packagist.org/packages/roave/zf2-for-1)[ Docs](https://github.com/Roave/zf2-for-1)[ RSS](/packages/roave-zf2-for-1/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

ZF 2-for-1
==========

[](#zf-2-for-1)

Version 0.0.1 Created by [Evan Coury](http://blog.evan.pro/) and [Xerkus](https://github.com/Xerkus/).

Introduction
------------

[](#introduction)

Original intention of ZF2-for-1 was to provide a compatibility layer for Zend Framework 1, allowing to use Zend Framework 2 features in ZF1 application. ZF2-for-1 provides some basic functionality for such integration indeed, but we believe that migrating to ZF2 is a way to go.

In fact it proved to be quite easy to move (M)VC layer of ZF1 application to ZF2. And much easier than to run both applications in parallel.
It is explained by the fact that ZF2 is **very** flexible while ZF1... well, not.
This opens possibility for fast straightforward migration, while keeping most of the application code intact, and for gradual refactoring towards modern zf2 application afterwards.

To outline said above: current goal of Zf2-for-1 is to reimplement some of the ZF1 features in ZF2 to make initial migration fast and easy.

Current Features
----------------

[](#current-features)

### Basic features for zf1 application

[](#basic-features-for-zf1-application)

- Registers the ZF2 autoloader
- Bootstraps ZF2 configuration and modules
- Makes ZF2 ServiceManager available to zf1 application
- Makes ZF1 application config and bootstrap object available to ServiceManager
- Registers ServiceManager in `Zend_Registry` under `'service_manager'` key

### Features for initial migration to ZF2

[](#features-for-initial-migration-to-zf2)

- Helper class to mimic zf1 request parameters fallback: route -&gt; get -&gt; post

Installation
------------

[](#installation)

### Composer install:

[](#composer-install)

- Add to you composer.json

```
"require": {
    "roave/zf2-for-1": "dev-master"
}

```

- Run composer install
- Add this to `application/configs/application.ini`:

```
pluginpaths.Zf2for1_Resource     = APPLICATION_PATH "/../vendor/roave/zf2-for-1/src/Zf2for1/Resource"

; This is path where Zf2for1 will be looking by default for zf2 application config
;resources.zf2.config_path = APPLICATION_PATH "/../config/"

;register service manager to Zend_Registry under the key 'service_manager'
resources.zf2.add_sm_to_registry = true
resources.view[] =
```

Example can be found [here](https://github.com/Xerkus/zf2-for-1-example)

### Alternative install:

[](#alternative-install)

- Clone this repository into `APPLICATION_PATH/../vendor/Zf2for1` directory.
- Download ZF2 and put the `library/Zend` directory in `APPLICATION_PATH/../vendor/ZF2/`(Resulting path should be vendor/ZF2/Zend)
- Add this to `application/configs/application.ini`:

```
pluginpaths.Zf2for1_Resource     = APPLICATION_PATH "/../vendor/Zf2for1/src/Zf2for1/Resource"

resources.zf2.zf2_path = APPLICATION_PATH "/../vendor/ZF2"
; This is path where Zf2for1 will be looking by default for zf2 application config
;resources.zf2.config_path = APPLICATION_PATH "/../config/"
```

Plans
-----

[](#plans)

There are a lot of ways this could be improved.

- More features
- Usage examples
- Update README

License
-------

[](#license)

ZF 2-for-1 is released under the New BSD license. See the included LICENSE file.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.2% 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 ~219 days

Total

3

Last Release

4052d ago

### Community

Maintainers

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

![](https://avatars.githubusercontent.com/u/725842?v=4)[Aleksei Khudiakov](/maintainers/Xerkus)[@Xerkus](https://github.com/Xerkus)

---

Top Contributors

[![Xerkus](https://avatars.githubusercontent.com/u/725842?v=4)](https://github.com/Xerkus "Xerkus (37 commits)")[![EvanDotPro](https://avatars.githubusercontent.com/u/5607?v=4)](https://github.com/EvanDotPro "EvanDotPro (8 commits)")

---

Tags

compatibilityzf2ZF1

### Embed Badge

![Health badge](/badges/roave-zf2-for-1/health.svg)

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

PHPackages © 2026

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