How to independently use single Zend Framework com

2020-03-23 02:10发布

Zend framework is well known for loosely coupled components.

I would like to use XML-RPC from zend framework, is there any dependency for XML-RPC? Like if I had taken out XML-RPC folder off Zend Framework Library and try to instantiate RPC object, would it throw error?

Where can I find the proper way of separating component from the framework?

Thanks

4条回答
▲ chillily
2楼-- · 2020-03-23 02:48

You should literally be able to copy the XmlRpc folder from your copy of Zend Framework and use it in your own projects. The only dependency that I can see is in XmlRpc/Exception.php as it requires a file in the root directory of Zend/ (Exception.php) you could simply copy this file along with the XmlRpc folder keeping the directory structure the same and it should work....

查看更多
再贱就再见
3楼-- · 2020-03-23 02:51

I wrote a tool which takes ZF components and their dependencies so you can easily take just one (or several) component from ZF.

http://epic.codeutopia.net/pack/

It doesn't have the latest ZF release 1.11 (because I'm lazy), but 1.10.6 should work just fine.

查看更多
家丑人穷心不美
4楼-- · 2020-03-23 02:53

My first question is why you would want to do that in the first place. It means that every time you upgrade Zend Framework you now need add a bunch of tooling to manage the removal of some components. One of the purposes of using a framework is so you don't have to manage a bunch of code. Removing parts of a framework is a step backwards IMHO. Disk space is cheap. Network transfer is cheap. If you are going to remove parts of a framework you should have a REALLY, REALLY good reason to do it.

查看更多
仙女界的扛把子
5楼-- · 2020-03-23 02:59

You should never split single components off a framework or library independent from Zend Framework, or any other. Especially when using PHP there is also no performance reason, because with PHPs autoloading functionality it will always just include the files, which are requested.

查看更多
登录 后发表回答