Michelangelo van Dam has a new post sharing a method he's come up with for boostrapping Zend Framework v1 components inside of an Apigility-based application.
Apigility is a Zend Framework 2 tool that provides a REST API management interface, which is very useful if you want to build an API. Apigility can directly connect with your database and offer a full REST API for your application, but in most cases you already have an application build with Zend Framework 1.x (ZF1). Let's assume you have incorporated a lot of business logic in this application so it would be a waste not to use it building a rich REST API.
He uses the gitmodules functionality to bring his entire ZF1 application into the Apigility app's structure (or, alternatively, Subversion). He shows how to use Composer to install the actual Zend Framework v1 copy and how to pull in other third-party libraries. He includes the code you'll need to use to create a "ZF2APP_PATH" constant to get to the application path of Zend Framework v2 instance. He then gets into the main part - the actual autoloading and bootstrapping of the ZF1 classes/services. He gives a brief introduction to working with Apigility to make a new service and shows the update to the resource class.
Link: http://www.dragonbe.com/2014/03/bootstrapping-zf1-application-in.html
没有评论:
发表评论