PHP模块系统 Witty

fmms 13年前
     <p>Witty想做的事很简单:方便模块开发,方便上传,方便安装,方便使用。</p>    <p>Witty提供了一些简单的模块开发标准,程序员可以按照这些标准写自己的模块,然后上传到网站,这样其他用户就可以通过简单的命令下载,使用该模块了。</p>    <p>说说开发Witty的初衷。这个是受python启发,python可以把自己开发的类库上传到<a href="/misc/goto?guid=4958333956265982457">pypi</a>, 这样就可以通过easy_install或pip安装了,甚是方便。而且这些库都可以独立使用(即使有依赖关系,easy_install/pip也会自 动处理)。本来这件事应该是pear来做的,但pear的开发规范太复杂,安装也比较麻烦,略显重量级。很多框架其实自带了很多好用的类库,但一般都需要 依赖框架本身。Zend Framework可以把类库单独拿出来,但也有不少问题,比如配置不统一、没有统一的初始化方法、每个模块没有放到单独的文件夹里、没有命令行安装功能 等等。于是创建Witty的想法就这么诞生了。</p>    <pre class="brush:php; toolbar: true; auto-links: false;"># install wget http://witty.leezhong.com/static/witty chmod +x witty ./witty install  # install module ./witty install http  # usage require_once '/path/to/witty.php'; Witty::init();  $http = Witty::instance('Http'); $http->execute('http://www.open-open.com');</pre>    <br />    <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1323606056937" target="_blank">http://www.open-open.com/lib/view/home/1323606056937</a></p>