承接 bignall/zf1compat-for-zf2 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

bignall/zf1compat-for-zf2

Composer 安装命令:

composer require bignall/zf1compat-for-zf2

包简介

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

README 文档

README

By Rosina Bignall

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

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

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

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

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

Thanks

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-11-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固