<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>抚琴居 &#187; PHP</title> <atom:link href="http://yanbin.org/category/php/feed" rel="self" type="application/rss+xml" /><link>http://yanbin.org</link> <description>人虽不能要他想要的，但能做他想做的</description> <lastBuildDate>Thu, 11 Aug 2011 02:10:08 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Doctrine 2.0 is released</title><link>http://yanbin.org/archive/doctrine-2-is-released.html</link> <comments>http://yanbin.org/archive/doctrine-2-is-released.html#comments</comments> <pubDate>Wed, 22 Dec 2010 01:57:18 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Doctrine]]></category> <category><![CDATA[ORM]]></category><guid isPermaLink="false">http://yanbin.org/?p=333</guid> <description><![CDATA[这真是一个令人激动的消息。作为我一直都在关注、使用的 ORM 工具，Doctrine 终于在今天发布了 2.0 正式版。我最喜欢 Doctrine 2 的特性是它抛弃了以前的 Active Record 模型，转而采用了虽然是更复杂但也是最具灵活性的 Data Mapper 模型。这让我们在写应用程序时领可以忽略底层的数据库结构，完全关注在领域逻辑方面。 在 PHP 领域，Doctrine 可以说是目前我见过对 ORM 诠释最好的应用框架了，很让人期待它会在接下来的1～2年统治 PHP 方面 ORM 江湖。]]></description> <content:encoded><![CDATA[<p>这真是一个令人激动的消息。作为我一直都在关注、使用的 <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">ORM</a> 工具，<a href="http://www.doctrine-project.org">Doctrine</a> 终于在今天发布了 2.0 正式版。我最喜欢 Doctrine 2 的特性是它抛弃了以前的 <a href="http://martinfowler.com/eaaCatalog/activeRecord.html">Active Record</a> 模型，转而采用了虽然是更复杂但也是最具灵活性的 <a href="http://martinfowler.com/eaaCatalog/dataMapper.html">Data Mapper</a> 模型。这让我们在写应用程序时领可以忽略底层的数据库结构，完全关注在领域逻辑方面。</p><p>在 PHP 领域，Doctrine 可以说是目前我见过对 ORM 诠释最好的应用框架了，很让人期待它会在接下来的1～2年统治 PHP 方面 ORM 江湖。</p> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/doctrine-2-is-released.html/feed</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>基于 Zend Framework 的 Web 开发实践</title><link>http://yanbin.org/archive/web-development-with-zend-framework.html</link> <comments>http://yanbin.org/archive/web-development-with-zend-framework.html#comments</comments> <pubDate>Fri, 11 Jun 2010 01:57:53 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Zend Framework]]></category><guid isPermaLink="false">http://yanbin.org/?p=338</guid> <description><![CDATA[Think In LAMP 2010年6月聚会分享 Web development with zend framework View more presentations from thinkinlamp]]></description> <content:encoded><![CDATA[<p>Think In LAMP 2010年6月聚会分享</p><div style="width:510px" id="__ss_4436294"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/thinkinlamp/web-development-with-zend-framework" title="Web development with zend framework" target="_blank">Web development with zend framework</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/4436294" width="510" height="426" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/thinkinlamp" target="_blank">thinkinlamp</a></div></p></div> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/web-development-with-zend-framework.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Zend Framework 中英文手册 CHM 格式最新版（2010-02-01更新）</title><link>http://yanbin.org/archive/zend-framework-manual-zh.html</link> <comments>http://yanbin.org/archive/zend-framework-manual-zh.html#comments</comments> <pubDate>Mon, 01 Feb 2010 13:36:51 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Zend Framework]]></category> <category><![CDATA[手册]]></category><guid isPermaLink="false">http://www.yAnbiN.org/?p=264</guid> <description><![CDATA[Zend Framework 发布了 1.10.x 系列，手册也更新了很多内容。今天抽空从 SVN 拉下来了一份最新的拷贝，编译成了中英文的 CHM 版，共感兴趣的朋友取阅。下载地址见下： Zend Framework 手册 CHM 格式中文版（1.10.x） Zend Framework 手册 CHM 格式英文版（1.10.x）]]></description> <content:encoded><![CDATA[<p>Zend Framework 发布了 1.10.x 系列，手册也更新了很多内容。今天抽空从 SVN 拉下来了一份最新的拷贝，编译成了中英文的 CHM 版，共感兴趣的朋友取阅。下载地址见下：</p><p><a href="http://www.yanbin.org/download/zend_framework_manual_zh.zip">Zend Framework 手册 CHM 格式中文版（1.10.x）</a></p><p><a href="http://www.yanbin.org/download/zend_framework_manual_en.zip">Zend Framework 手册 CHM 格式英文版（1.10.x）</a></p> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/zend-framework-manual-zh.html/feed</wfw:commentRss> <slash:comments>30</slash:comments> </item> <item><title>PHP 5.3 以后的主版本将不再支持 VC6 编译</title><link>http://yanbin.org/archive/end-of-support-for-vc6-in-php-trunk.html</link> <comments>http://yanbin.org/archive/end-of-support-for-vc6-in-php-trunk.html#comments</comments> <pubDate>Wed, 23 Sep 2009 17:56:32 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[PHP 6]]></category> <category><![CDATA[php windows]]></category><guid isPermaLink="false">http://www.yAnbiN.org/?p=321</guid> <description><![CDATA[根据来自 PHP Windows 方面负责人 Pierre Joye 的消息，PHP 5.3 以后的主版本（比如 PHP6、PHP5.4？）将不再支持 VC6 编译。PHP6 的 windows 快照(snapshot)版本也将会在本月底停止发布。当然，PHP 5.3 目前依然支持 VC6 编译。 所以有个坏消息就是目前 Apache 还是用 VC6 编译的，届时可能会不能再使用 mod_php 模块了。当然也还有个好消息，未来的 Apache 2.4/3.0 的将会使用一个 mod_fcgid 模块来代替目前的 mod_php 作为 windows 平台的默认 php 处理模块。看来 fast-cgi 是大势所趋呀~:)]]></description> <content:encoded><![CDATA[<p>根据来自 PHP Windows 方面负责人 <a href="http://blog.thepimp.net/" target="_blank">Pierre Joye</a> 的消息，<a href="http://news.php.net/php.internals.win/615" target="_blank">PHP 5.3 以后的主版本（比如 PHP6、PHP5.4？）将不再支持 VC6 编译</a>。<a href="http://windows.php.net/snapshots/">PHP6 的 windows 快照(snapshot)版本</a>也将会在本月底停止发布。当然，PHP 5.3 目前依然支持 VC6 编译。</p><p>所以有个坏消息就是目前 Apache 还是用 VC6 编译的，届时可能会不能再使用 mod_php 模块了。当然也还有个好消息，未来的 Apache 2.4/3.0 的将会使用一个 mod_fcgid 模块来代替目前的 mod_php 作为 windows 平台的默认 php 处理模块。看来 fast-cgi 是大势所趋呀~:)</p> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/end-of-support-for-vc6-in-php-trunk.html/feed</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>PHP 官方准备将版本控制系统从 CVS 转为 SVN</title><link>http://yanbin.org/archive/php-source-moving-from-cvs-to-svn.html</link> <comments>http://yanbin.org/archive/php-source-moving-from-cvs-to-svn.html#comments</comments> <pubDate>Wed, 08 Jul 2009 14:01:17 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[新闻]]></category><guid isPermaLink="false">http://www.yAnbiN.org/?p=271</guid> <description><![CDATA[经过近一年的准备，php 官方决定从现在起冻结了所有的代码提交请求，且将于本周五（2009-07-10）将版本控制系统从现有的 CVS 转为 SVN，http://cvs.php.net 转为 http://svn.php.net/。 中间一度有人提议转为 GitHub，但由于准备时间较晚，目前只在进行小规模测试。至于以后是否还会继续转为 GitHub，待定。估计悬…… php 最近动作频繁呀~~~]]></description> <content:encoded><![CDATA[<p>经过近一年的准备，php 官方决定从现在起冻结了所有的代码提交请求，且将于本周五（2009-07-10）将版本控制系统从现有的 CVS 转为 SVN，<a href="http://cvs.php.net/" target="_blank" title="PHP CVS 格式源代码仓库">http://cvs.php.net</a> 转为 <a href="http://svn.php.net/viewvc/" target="_blank" title="PHP SVN 格式源代码仓库">http://svn.php.net/</a>。</p><p>中间一度<a href="http://news.php.net/svn.migration/255" target="_blank" title="Rasmus Lerdorf 提议使用 GitHub 版本控制系统">有人提议转为 GitHub</a>，但由于准备时间较晚，目前只在进行小规模测试。至于以后是否还会继续转为 GitHub，待定。估计悬……</p><p>php 最近动作频繁呀~~~</p> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/php-source-moving-from-cvs-to-svn.html/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>PHP 5.3 准备加入类型提示与转换（Type Hinting）？</title><link>http://yanbin.org/archive/type-hinting-will-be-pushed-into-php-5_3.html</link> <comments>http://yanbin.org/archive/type-hinting-will-be-pushed-into-php-5_3.html#comments</comments> <pubDate>Wed, 08 Jul 2009 10:01:28 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[PHP 5.3]]></category> <category><![CDATA[八卦]]></category><guid isPermaLink="false">http://www.yAnbiN.org/?p=266</guid> <description><![CDATA[最近 PHP 5.2.x 的 Release Manager Ilia Alshanetsky 提交了一个关于类型提示/转换(Type hinting/casting) 的 patch, 并且还发起了一个投票，决定是否将其作为 PHP 的一个新特性并入 PHP 开发代码。 可以说，绝大部分同志都对这个 patch 是持欢迎态度的，支持将其加入 PHP。但是对什么时候加入这个问题产生了巨大分歧。 PHP 5.3.x 的 Release Manager Lukas Kahwe Smith、PHP 创始人 Rasmus Lerdorf， Zend Engine 创始人之一 Zeev Suraski 等都反对在 PHP 5_3_X 分支添加这个功能。理由是 PHP 5_3_X 已经是个稳定分支（Stable Release），添加新特性的窗口期已过，建议在下一主要版本（Next Major Release，比如 PHP 5_4_X 甚至 PHP 6？）里添加。 而支持者除了 Ilia Alshanetsky、PHPUnit [...]]]></description> <content:encoded><![CDATA[<p>最近 PHP 5.2.x 的 Release Manager <a href="http://ilia.ws/" target="_blank">Ilia Alshanetsky</a> 提交了一个<a href="http://news.php.net/php.internals/44573" target="_blank" title="RFC: Type hinting revisited for PHP 5.3">关于类型提示/转换(Type hinting/casting) 的 patch</a>, 并且还发起了<a href="http://news.php.net/php.internals/44727" target="_blank" title="Type hinting/casting request for vote">一个投票</a>，决定是否将其作为 PHP 的一个新特性并入 PHP 开发代码。</p><p>可以说，绝大部分同志都对这个 patch 是持欢迎态度的，支持将其加入 PHP。但是对什么时候加入这个问题产生了巨大分歧。</p><p>PHP 5.3.x 的 Release Manager <a href="http://pooteeweet.org/blog/0/1516" title="Lukas 的反对意见" target="_blank">Lukas Kahwe Smith</a>、PHP 创始人 <a href="http://news.php.net/php.internals/44786" title="Rasmus Lerdorf 的反对意见" target="_blank">Rasmus Lerdorf</a>， Zend Engine 创始人之一 <a href="http://news.php.net/php.internals/44823" title="Zeev Suraski 大神的意见" target="_blank">Zeev Suraski</a> 等都反对在 PHP 5_3_X 分支添加这个功能。理由是 PHP 5_3_X 已经是个稳定分支（Stable Release），添加新特性的窗口期已过，建议在下一主要版本（Next Major Release，比如 PHP 5_4_X 甚至 PHP 6？）里添加。</p><p>而支持者除了 <a href="http://news.php.net/php.internals/44787" title="Ilia 的支持意见" target="_blank">Ilia Alshanetsky</a>、PHPUnit 作者 <a href="http://news.php.net/php.internals/44771" title="Sebastian Bergmann 的意见" target="_blank">Sebastian Bergmann</a> 外其他人虽不如反对者们大腕云集，但至少在数量上还是占据一定优势的。支持的理由就是 PHP 6 的发布太过遥远，倒腾了几年还没倒腾出来。而且就算发布了，估计还得上等一年半载的才会稳定下来。如此一来二去，黄花菜都凉了。所谓一万年太久，只争朝夕。择日不如撞日，干脆直接在 PHP 5_3_X 中加入算了。</p><p>目前双方仍在你来我往，唇枪舌剑，欢迎大家前去<a href="http://news.php.net/php.internals/44727" title="Type hinting 投票地址" target="_blank">围观</a>并发表自己的看法~ <img src='http://yanbin.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/type-hinting-will-be-pushed-into-php-5_3.html/feed</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>PHP 5.3.0 正式发布！</title><link>http://yanbin.org/archive/php-5_3_0-release.html</link> <comments>http://yanbin.org/archive/php-5_3_0-release.html#comments</comments> <pubDate>Tue, 30 Jun 2009 15:12:35 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[PHP 5.3]]></category><guid isPermaLink="false">http://www.yAnbiN.org/?p=259</guid> <description><![CDATA[在经历了 N 多的 RC 之后终于发布了 5.3 系列的正式版。根据平常俺的测试来看，还是有些烦人的 BUG 出现。待几个月后出了新的 release 后我再把服务器上的 php 给更新一下。不过平常用的开发到可以先尝试一下~~ ：D 与此同时， Firefox 也发布了 3.5 版本。5.3 vs 3.5？哈哈~~]]></description> <content:encoded><![CDATA[<p>在经历了 N 多的 RC 之后终于发布了 <a href="http://php.net/releases/5_3_0.php">5.3 系列的正式版</a>。根据平常俺的测试来看，还是有些烦人的 BUG 出现。待几个月后出了新的 release 后我再把服务器上的 php 给更新一下。不过平常用的开发到可以先尝试一下~~ ：D</p><p>与此同时， Firefox 也发布了 3.5 版本。5.3 vs 3.5？哈哈~~ <img src='http://yanbin.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/php-5_3_0-release.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>《PHP 运行机制初探》演讲幻灯片</title><link>http://yanbin.org/archive/pea-talk-php-internals.html</link> <comments>http://yanbin.org/archive/pea-talk-php-internals.html#comments</comments> <pubDate>Mon, 07 Apr 2008 15:27:13 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[PEA]]></category> <category><![CDATA[Talks]]></category><guid isPermaLink="false">http://www.yAnbiN.org/?p=55</guid> <description><![CDATA[三月底在上海 PEA 聚会上做了次关于“PHP 运行机制”的演讲，附件是演讲时用的幻灯片。这次演讲我给自己打 70 分，后面发挥得还不错，但整体上感觉内容组织还有改善的余地，演讲时有些话都重复了好几次，环视全场的机会也不多，以后有机会要注意改正。 ps: 其实单独看幻灯片估计也看不出什么东西来：D，有机会要把当时谈的内容给整理一下再发个 paper 上来。 《PHP 运行机制初探》幻灯片下载]]></description> <content:encoded><![CDATA[<p>三月底在<a href="http://www.phpchina.com/bbs/thread-53325-1-2.html" title="上海 08 年 3 月“扩展与框架”国际技术活动召集" target="_blank">上海 PEA 聚会</a>上做了次关于“PHP 运行机制”的演讲，附件是演讲时用的幻灯片。这次演讲我给自己打 70 分，后面发挥得还不错，但整体上感觉内容组织还有改善的余地，演讲时有些话都重复了好几次，环视全场的机会也不多，以后有机会要注意改正。</p><p>ps: 其实单独看幻灯片估计也看不出什么东西来：D，有机会要把当时谈的内容给整理一下再发个 paper 上来。</p><p><a href="http://www.yanbin.org/download/php-internals.pdf" title="《PHP 运行机制初探》幻灯片@上海 08年 3 月 PEA 聚会">《PHP 运行机制初探》幻灯片下载</a></p> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/pea-talk-php-internals.html/feed</wfw:commentRss> <slash:comments>23</slash:comments> </item> <item><title>SCWS &#8211; 简易中文分词系统 windows 版（更新至 1.0.0 版）</title><link>http://yanbin.org/archive/php-scws-windows-edtion.html</link> <comments>http://yanbin.org/archive/php-scws-windows-edtion.html#comments</comments> <pubDate>Thu, 21 Jun 2007 16:12:08 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[scws]]></category><guid isPermaLink="false">http://www.yAnbiN.org/scws-%e7%ae%80%e6%98%93%e4%b8%ad%e6%96%87%e5%88%86%e8%af%8d%e7%b3%bb%e7%bb%9f-windows-%e7%89%88/</guid> <description><![CDATA[抽空编译了这个 windows 版（附件已更新为 1.0.0 版链接）。这个版本主要是根据 hightman 大牛的 xNix 代码&#160;移植而来。主要改动集中在处理了一些 GCC 与 VC 的兼容性代码，Lock 部分借鉴了 PHP 在跨平台方面的一些成果，去掉了 MMAP 支持，改为普通文件操作。 这个是 SCWS 扩展 PHP 4.4.x 版二进制文件 这个是 SCWS 扩展 PHP 5.2.x 版二进制文件 这个是 SCWS 扩展源码及 VC6 工程文件 这里是 SCWS &#8211; 简易中文分词系统简介]]></description> <content:encoded><![CDATA[<p>抽空编译了这个 windows 版（附件已更新为 1.0.0 版链接）。这个版本主要是根据 <a title="大牛 hightman 的主页" href="http://hightman.cn/">hightman</a> 大牛的 <a title="SCWS - 简易中文分词系统 Linux/Unix 源码" href="http://www.hightman.cn/bbs/viewthread.php?tid=41" target="_blank">xNix 代码</a>&nbsp;移植而来。主要改动集中在处理了一些 GCC 与 VC 的兼容性代码，Lock 部分借鉴了 PHP 在跨平台方面的一些成果，去掉了 MMAP 支持，改为普通文件操作。</p><p><a title="SCWS - 简易中文分词系统 windows 版 for PHP 4.4.x" href="http://www.yanbin.org/download/scws-1.0.0_win32_php-4.4.x.zip">这个是 SCWS 扩展 PHP 4.4.x 版二进制文件</a></p><p><a title="SCWS - 简易中文分词系统 windows 版 for PHP 5.2.x" href="http://www.yanbin.org/download/scws-1.0.0_win32_php-5.2.x.zip">这个是 SCWS 扩展 PHP 5.2.x 版二进制文件</a></p><p><a title="SCWS - 简易中文分词系统 windows 版" href="http://www.yanbin.org/download/scws-1.0.0_win32.src.zip">这个是 SCWS 扩展源码及 VC6 工程文件</a></p><p><a title="SCWS - 简易中文分词系统主页" href="http://hightman.cn/index.php?scws" target="_blank">这里是 SCWS &#8211; 简易中文分词系统简介</a></p> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/php-scws-windows-edtion.html/feed</wfw:commentRss> <slash:comments>22</slash:comments> </item> <item><title>《PHP 源代码分析》第一章 构建系统 之 准备工具、库及需要具备的基础知识</title><link>http://yanbin.org/archive/commentary-on-php-chap1_1-prep.html</link> <comments>http://yanbin.org/archive/commentary-on-php-chap1_1-prep.html#comments</comments> <pubDate>Thu, 14 Jun 2007 05:06:45 +0000</pubDate> <dc:creator>yAnbiN</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[commentary on php]]></category><guid isPermaLink="false">http://www.yAnbiN.org/2007/06/14/%e3%80%8aphp-%e6%ba%90%e4%bb%a3%e7%a0%81%e5%88%86%e6%9e%90%e3%80%8b%e7%ac%ac%e4%b8%80%e7%ab%a0-%e6%9e%84%e5%bb%ba%e7%b3%bb%e7%bb%9f-%e4%b9%8b-%e5%87%86%e5%a4%87%e5%b7%a5%e5%85%b7%e3%80%81%e5%ba%93/</guid> <description><![CDATA[源码分析，首先得看源码。记事本可以看，EditPlus 也可以看，但显然具有语法着色功能的 EditPlus 要比记事本爽。更显然，M$ 的 Visual C++ 比 EditPlus 还要爽。：D 因此我推荐的第一款神兵就是 M$ Visual C++（Sorry, Linuxer~）。既然用了 Visual C++ 那么有一款它的插件我们不得不提：Visual Assist X，还没有她的朋友尽快拥有她吧～ OK，现在源码是可以看了，而且是很舒服地在看，但有时我们还想实地进行单步调试以一窥究竟。要调试自然得先编译。很不幸，PHP 在 Windows 环境下的编译和调试并不像想象中的那么简单。我们至少得比在 xNix 环境下多做一下几个步骤： 下载 PHP 使用的 DNS 解析器的源代码（http://www.php.net/extra/bindlib_w32.zip）并将其编译输出一个名为 resolv.lib 的库文件。 下载 win32 编译工具 http://www.php.net/extra/win32build.zip ，解压至某一目录（假定为 $work）。在 $work\lib 目录里面也有个 resolv.lib，我们把步骤 1 产生的 resolv.lib 复制到这个目录，覆盖之。 设置编译环境。把 $Work\bin 添加到系统 PATH 环境变量和 Visual C++ 的 Executable [...]]]></description> <content:encoded><![CDATA[<p>源码分析，首先得看源码。记事本可以看，EditPlus 也可以看，但显然具有语法着色功能的 <a title="EditPlus Homepage" href="http://www.editplus.com/">EditPlus</a> 要比记事本爽。更显然，M$ 的 <a title="Visual Studio Home" href="http://msdn2.microsoft.com/en-us/vstudio/default.aspx">Visual C++</a> 比 EditPlus 还要爽。：D 因此我推荐的第一款神兵就是 M$ Visual C++（Sorry, Linuxer~）。既然用了 Visual C++ 那么有一款它的插件我们不得不提：<a title="Visual Assist X" href="http://www.WholeTomato.com">Visual Assist X</a>，还没有她的朋友尽快拥有她吧～</p><p>OK，现在源码是可以看了，而且是很舒服地在看，但有时我们还想实地进行单步调试以一窥究竟。要调试自然得先编译。很不幸，PHP 在 Windows 环境下的编译和调试并不像想象中的那么简单。我们至少得比在 xNix 环境下多做一下几个步骤：</p><ol><li>下载 PHP 使用的 DNS 解析器的源代码（<a href="http://www.php.net/extra/bindlib_w32.zip">http://www.php.net/extra/bindlib_w32.zip</a>）并将其编译输出一个名为 resolv.lib 的库文件。</li><li>下载 win32 编译工具 <a href="http://www.php.net/extra/win32build.zip">http://www.php.net/extra/win32build.zip</a> ，解压至某一目录（假定为 $work）。在 $work\lib 目录里面也有个 resolv.lib，我们把步骤 1 产生的 resolv.lib 复制到这个目录，覆盖之。</li><li>设置编译环境。把 $Work\bin 添加到系统 PATH 环境变量和 Visual C++ 的 Executable files 目录；把 $work\lib 添加到 Library files 目录；把 $Work\include 添加到 Include files 目录。</li><li>下载 <a href="http://www.php.net/downloads.php">PHP 源文件</a>并解压至 $work 。</li><li>整理 PHP 的项目工程文件。PHP 4.x 的 VC 工程文件（$PHP\win32\php4ts*.dsw）是当时一直在维护的，因此可以直接拿来就用。PHP 5.x 增加了一种新的基于命令行的类 Unix 编译系统，使得编译 PHP 更为简单。于是相应的工程文件 php5ts*.dsw 便不再被 PHP 团队维护，也不能直接使用编译 PHP 5 了。但我们恰恰不想单纯的编译，我们想的是在 Visual C++ 里面进行编译然后下断点单步调试，因此我们就需要命令行编译系统的编译流程重建这个项目工程文件（可能还需要对某些文件做些必要的改动）。</li></ol><p>为方便大家不做重复性劳动，我把我现在用的 PHP 调试环境打包发上来，大家下载后直接解压到某一目录即可。所需另外做的也只是根据你解压的目录设置一下编译的环境变量（见步骤 3），之后就可直接进入 $work\win32 打开 php5ts.dsw。</p><p><a title="PHP win32 VC 编译项目包" href="http://www.yanbin.org/download/php-5.2.8-win32-src-work.zip">这里是该 PHP win32 VC 编译项目包。</a></p><p>工程文件说明：这其实是个“精简版”PHP 的工程文件，里面的 PHP 是 php 5.2.8 的源码，但只包含 date、filter、pcre、reflection、session、standard、tokenizer 这几个内建扩展。另外 php5apache2 的 sapi 不能编译，要想编译它得再去下一份 Apache 2 的源码。除此之外还删除了大部分的测试脚本。</p><p>最后再说一下分析 PHP 源代码所需要一些基础知识。首先当然得有一定的 C 语言基础。在最后分析 Zend Engine 时可能还需要一些编译器方面知识，最好能看懂一些 lex&#038;yacc 的语法文件（PHP 采用的是 flex 和 bison，但在语法层面相差无几）。最后是能有一定的调试技术。包括在 VC++ 环境下的有源码调试技术和无源码的二进制代码调试技术（这种情况下我一般用<a title="OllyDbg homepage" href="http://www.OllyDbg.de/">OllyDbg</a>）。其中 C 语言基础是必须的，而后面的两种知识/技术则可有可无，但有的话可以达到事半功倍之效。</p> ]]></content:encoded> <wfw:commentRss>http://yanbin.org/archive/commentary-on-php-chap1_1-prep.html/feed</wfw:commentRss> <slash:comments>23</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 5/27 queries in 0.009 seconds using apc
Object Caching 611/675 objects using apc
Content Delivery Network via N/A

Served from: yanbin.org @ 2012-05-19 00:20:15 -->
