joacub/zf2-for-1 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

joacub/zf2-for-1

Composer 安装命令:

composer require joacub/zf2-for-1

包简介

Compatibility layer for ZF1 application allowing usage of ZF2 features

README 文档

README

Version 0.0.1 Created by Evan Coury and Xerkus.

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

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

  • Helper class to mimic zf1 request parameters fallback: route -> get -> post
  • Set of classes to mimic ContextSwitch behavior
  • More coming

Installation

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

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

There are a lot of ways this could be improved.

  • More features
  • Usage examples
  • Update README

License

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

joacub/zf2-for-1 适用场景与选型建议

joacub/zf2-for-1 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 02 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「zf2」 「ZF1」 「compatibility」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 joacub/zf2-for-1 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 joacub/zf2-for-1 我们能提供哪些服务?
定制开发 / 二次开发

基于 joacub/zf2-for-1 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 16
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-02-11