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

ActiveLibrary[Framework](/categories/framework)

joacub/zf2-for-1
================

Compatibility layer for ZF1 application allowing usage of ZF2 features

0.1.0(12y ago)016PHPPHP &gt;=5.3.3

Since Jan 31Pushed 11y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (3)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
- Optionally registers ServiceManager in `Zend_Registry`
- Provides access to ZF2 view helpers in the ZF1 view layer (`$this->zf2Helper('formRow')`or `$this->zf2Helper()->formRow()`)

### 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
- Set of classes to mimic ContextSwitch behavior
- More coming

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/"

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

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

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.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 ~73 days

Total

2

Last Release

4410d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c5ea80353eb117dbabb0def7d2a43079815acee0d55f690a6476c03e458c203?d=identicon)[joacub](/maintainers/joacub)

---

Top Contributors

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

---

Tags

compatibilityzf2ZF1

### Embed Badge

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

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

PHPackages © 2026

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