<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.ooso.net/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" 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/" version="2.0"><channel><atom:link href="http://feed.ooso.net" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/ooso" type="application/rss+xml"></fs:self_link><lastBuildDate>Mon, 27 Oct 2008 08:22:30 GMT</lastBuildDate><title>某人的栖息地</title><description>Linux + Apache + Mysql + Php + Flash</description><link>http://www.ooso.net</link><language>en</language><pubDate>Mon, 27 Oct 2008 08:23:17 GMT</pubDate><item><title>在CentOS / Red Hat下安装PHP 5.x PECL Filter Extension</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368470/5088797/1/item.html</link><content:encoded>&lt;p&gt;php 5.2之后，默认会装有filter extension，这个扩展可以帮助php开发者过滤用户输入的内容，由php的创始人之一Rasmus Lerdorf提供，可以见我&lt;a href=&quot;/index.php/archives/202&quot;&gt;早期的文章介绍&lt;/a&gt;。&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Q. How do I install filter extension for safely dealing with input parameters supplied via a web form using filter_var()?&lt;br /&gt;
A. This extension is part of PHP Core version 5.20 and above. Unfortunately, RHEL / CentOS comes with PHP version 5.1.6. So you need to install this extension by typing the following commands.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;由于RHEL / CentOS自带的php版本是5.1.6，那么只好手工安装filter扩展。安装过程：&lt;/p&gt;
&lt;h2&gt;安装php-devel&lt;/h2&gt;
&lt;p&gt;为了编译php extensions，需要安装php-devel包:&lt;br /&gt;
&lt;code&gt;# yum install php-devel&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;下载php的源码&lt;/h2&gt;
&lt;p&gt;php 5.1.6的源码树中没有包含php_pcre.h header文件, 所以需要另行下载一个php源码. 从php.net下载最新版本的源码并放到/opt目录:&lt;br /&gt;
&lt;code&gt;# cd /opt&lt;br /&gt;
# elinks http://cn2.php.net/get/php-5.2.6.tar.bz2/from/cn.php.net/mirror&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;保存之后解压:&lt;br /&gt;
&lt;code&gt;# tar -jxvf php-5.2.6.tar.bz2&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;下载filter extension&lt;/h2&gt;
&lt;p&gt;在&lt;a href=&quot;http://pecl.php.net&quot;&gt;pecl&lt;/a&gt;上找到最新的filter源码:&lt;br /&gt;
&lt;code&gt;# cd /opt&lt;br /&gt;
# wget http://pecl.php.net/get/filter-0.11.0.tgz&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;安装filter extension&lt;/h2&gt;
&lt;p&gt;解压文件:&lt;br /&gt;
&lt;code&gt;# tar -jxvf filter-0.11.0.tgz&lt;br /&gt;
# cd filter-0.11.0&lt;/code&gt;&lt;br /&gt;
打开logical_filters.c文件:&lt;br /&gt;
&lt;code&gt;# vi logical_filters.c&lt;/code&gt;&lt;br /&gt;
找到下面的代码行:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#include &quot;ext/pcre/php_pcre.h&quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;修改成 (php_pcre.h的绝对路径):&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#include &quot;/opt/php-5.2.6/ext/pcre/php_pcre.h&quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;保存并关闭文件. 最后输入下面命令来编译filter扩展:&lt;br /&gt;
&lt;code&gt;# phpize&lt;br /&gt;
# ./configure&lt;br /&gt;
# make install&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;配置Filter Extension&lt;/h2&gt;
&lt;p&gt;输入下列命令:&lt;br /&gt;
&lt;code&gt;# echo 'extension=filter.so' &gt; /etc/php.d/filter.ini &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;然后重启web server即可。&lt;/p&gt;
&lt;p&gt;原文: &lt;a href=&quot;http://www.cyberciti.biz/faq/rhel-cento-linux-install-php-pecl-filter/&quot;&gt;CentOS / Red Hat Linux Install PHP 5.x PECL Filter Extension&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/473/feed</wfw:commentRss><description>php 5.2之后，默认会装有filter extension，这个扩展可以帮助php开发者过滤用户输入的内容，由php的创始人之一Rasmus Lerdorf提供，可以见我早期的文章介绍。
Q. How do I install filter extension for safely dealing with input parameters supplied via a web form using filter_var()?
A. This extension is part of PHP Core version 5.20 and above. Unfortunately, RHEL / CentOS comes with PHP version 5.1.6. So you need to install this extension by typing the following commands.

				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/473&quot; title=&quot;在CentOS / Red Hat下安装PHP 5.x PECL Filter Extension&quot;&gt;阅读全文（1164字）&lt;/a&gt;&lt;/span&gt;</description><category>PHP</category><pubDate>Mon, 27 Oct 2008 16:22:30 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/473#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/473</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/473</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368470/5088797</fs:itemid></item><item><title>php 5.3带来了什么(三)</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368471/5088797/1/item.html</link><content:encoded>&lt;p&gt;之前介绍的php 5.3的新特性，都是方便开发人员的东东。下面介绍个很讨虚拟主机提供商喜欢的特性。&lt;/p&gt;
&lt;h2&gt;增强的ini文件支持&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;CGI/ FastCGI支持类似&lt;b&gt;.htaccess&lt;/b&gt;的INI配置&lt;/li&gt;
&lt;li&gt;每个目录下都可以有INI设置，ini的文件名取决于php.ini的配置，但是[PATH=/var/www/domain.com], [HOST=www.domain.com]段落的设置用户不能修改。&lt;/li&gt;
&lt;li&gt;增强的error handling&lt;/li&gt;
&lt;li&gt;允许在ini文件中定义变量和常量，可以在程序中直接调用。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;附上一段ini文件的例子&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-2&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-2'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-2&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;#用户自定义的php.&lt;span style=&quot;&quot;&gt;ini&lt;/span&gt;文件名 &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span style=&quot;&quot;&gt;htaccess&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;. 默认是&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;.user.ini&quot;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;user_ini.&lt;span style=&quot;&quot;&gt;filename&lt;/span&gt; = &lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;.user.ini&quot;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;#如果要禁用这个特性，设置为空值即可&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;user_ini.&lt;span style=&quot;&quot;&gt;filename&lt;/span&gt; =&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;#用户自定义的php.&lt;span style=&quot;&quot;&gt;ini&lt;/span&gt;文件TTL时长&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;time-to-live&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;，单位为秒，我理解为缓存过期时间。默认为&lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;300&lt;/span&gt;秒 &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;user_ini.&lt;span style=&quot;&quot;&gt;cache_ttl&lt;/span&gt; = &lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;300&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#91;&lt;/span&gt;PATH=/var/www/domain.&lt;span style=&quot;&quot;&gt;com&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;variables_order = GPC&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;safe_mode = &lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#91;&lt;/span&gt;my variables&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;somevar = “&lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;1234&lt;/span&gt;”&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;anothervar = $&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;somevar&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt; ; anothervar == somevar&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#91;&lt;/span&gt;ini arrays&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;foo&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#91;&lt;/span&gt;bar&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;foo&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;123&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;foo&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#93;&lt;/span&gt; = &lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;3&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/472/feed</wfw:commentRss><description>之前介绍的php 5.3的新特性，都是方便开发人员的东东。下面介绍个很讨虚拟主机提供商喜欢的特性。
增强的ini文件支持

CGI/ FastCGI支持类似.htaccess的INI配置

				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/472&quot; title=&quot;php 5.3带来了什么(三)&quot;&gt;阅读全文（606字）&lt;/a&gt;&lt;/span&gt;</description><category>PHP</category><pubDate>Wed, 24 Sep 2008 16:50:01 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/472#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/472</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/472</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368471/5088797</fs:itemid></item><item><title>memcached Binary协议的ppt</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368472/5088797/1/item.html</link><content:encoded>&lt;p&gt;memcached 1.3将开始支持Binary Protocol，下面是一篇介绍的ppt。&lt;/p&gt;
&lt;p&gt;&lt;object style=&quot;margin:0px&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slideshare.net/swf/ssplayer2.swf?doc=memcachednighttokyo-1221916987381523-9&amp;#038;stripped_title=memcached-binary-protocol-in-a-nutshell-presentation&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed src=&quot;http://static.slideshare.net/swf/ssplayer2.swf?doc=memcachednighttokyo-1221916987381523-9&amp;#038;stripped_title=memcached-binary-protocol-in-a-nutshell-presentation&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;p&gt;大概看了一遍，可以认为&lt;a href=&quot;/?tag=memcache&quot;&gt;memcache&lt;/a&gt;的binary协议相对原来基于文本的协议，略快一些。key的长度可以到65536(2 bytes)。而memcache 1.3将仍然保持向后兼容，同时支持文本协议和binary协议。&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/471/feed</wfw:commentRss><description>memcached 1.3将开始支持Binary Protocol，下面是一篇介绍的ppt。

大概看了一遍，可以认为memcache的binary协议相对原来基于文本的协议，略快一些。key的长度可以到65536(2 bytes)。而memcache 1.3将仍然保持向后兼容，同时支持文本协议和binary协议。</description><category>memcache</category><category>COMMON</category><pubDate>Tue, 23 Sep 2008 20:35:09 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/471#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/471</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/471</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368472/5088797</fs:itemid></item><item><title>php 5.3带来了什么(二)</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368473/5088797/1/item.html</link><content:encoded>&lt;p&gt;接上文&lt;/p&gt;
&lt;h2&gt;性能提升&lt;/h2&gt;
&lt;p&gt;php 5.3的总体性能提升了5 - 15%&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;md5()快了10-15%&lt;/li&gt;
&lt;li&gt;Better stack implementation in the engine&lt;/li&gt;
&lt;li&gt;Constants移到read-only内存里&lt;/li&gt;
&lt;li&gt;exception处理过程改进(简化，opcodes更少)&lt;/li&gt;
&lt;li&gt;(require/include)_once改进，去掉重复open&lt;/li&gt;
&lt;li&gt;Smaller binary size &amp;#038; startup size with gcc4&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;新语言特性&lt;/h2&gt;
&lt;h3&gt;__DIR__&lt;/h3&gt;
&lt;p&gt;在5.3以前，为了获得当前脚本的目录，需要一次函数调用&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-10&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-10'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-10&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;echo dirname&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;__FILE__&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// &amp;lt; PHP 5.3 &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;在5.3，只需要一个魔术常量__DIR__就解决了。&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-11&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-11'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-11&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;echo __DIR__; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// &amp;gt;= PHP 5.3 &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h3&gt;?:操作符&lt;/h3&gt;
&lt;p&gt;便捷的&lt;b&gt;?:&lt;/b&gt;操作符，可以从两个值/表达式中快速取得非空值。&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-12&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-12'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-12&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$a = true ?: false; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// true&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$a = false ?: true; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// true&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$a = &lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;&quot;&lt;/span&gt; ?: &lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;1&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// 1&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$a = &lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;0&lt;/span&gt; ?: &lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;2&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// 2&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$a = array&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; ?: array&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// array(1);&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$a = strlen&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; ?: strlen&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;a&quot;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// 1 &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h3&gt;__callStatic()&lt;/h3&gt;
&lt;p&gt;新增了魔术方法__callStatic，功能和__call类似，但是仅对static方法有效。&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-13&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-13'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-13&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;class helper &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        static function __callStatic&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$name, $args&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;                echo $name.&lt;span style=&quot;color:#CC0000;&quot;&gt;'('&lt;/span&gt;.&lt;span style=&quot;&quot;&gt;implode&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;','&lt;/span&gt;, $args&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color:#CC0000;&quot;&gt;')'&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;helper::&lt;span style=&quot;&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;foo&quot;&lt;/span&gt;,&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;bar&quot;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// test(foo,bar) &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h3&gt;动态调用static方法&lt;/h3&gt;
&lt;p&gt;动态的调用静态方法？动静结合。&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-14&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-14'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-14&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;class helper &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        static function foo&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt; echo __METHOD__; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$a = &lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;helper&quot;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$b = &lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;foo&quot;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$a::$b&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// helper::foo &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h3&gt;Late Static Binding&lt;/h3&gt;
&lt;p&gt;不知道怎么译，可能留个原文更容易理解。静态方法的事件处理时机有变化，以前是在编译期处理，现在是执行期间处理。&lt;/p&gt;
&lt;p&gt;在php 5.3之前，下面的代码会输出一个A，但是这不是咱们要的，whoami方法已经在class B中重新定义，它本该输出B才符合咱们想当然的思维。&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-15&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-15'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-15&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;class A &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   public static function whoami&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &amp;nbsp; &amp;nbsp;echo __CLASS__;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   public static function identity&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;     self::&lt;span style=&quot;&quot;&gt;whoami&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;class B extends A &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   public static function whoami&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      echo __CLASS__;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;B::&lt;span style=&quot;&quot;&gt;identity&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// A &amp;lt;-- PHP &amp;lt;5.3 &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;下面代码中使用了&lt;b&gt;static::whoami()&lt;/b&gt;来调用静态方法。php 5.3之后，由于__CLASS__是在执行期被处理，那么这个例子中能顺利抓到class B。&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-16&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-16'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-16&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;class A &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   public static function whoami&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      echo __CLASS__;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   public static function identity&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      static::&lt;span style=&quot;&quot;&gt;whoami&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;class B extends A &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   public static function whoami&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      echo __CLASS__;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;B::&lt;span style=&quot;&quot;&gt;identity&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// B &amp;lt;--&amp;gt;= PHP 5.3 &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h2&gt;mysqlnd&lt;/h2&gt;
&lt;p&gt;见&lt;a href=&quot;http://www.ooso.net/index.php/archives/464&quot;&gt;mysqlnd成为php 5.3中的默认mysql驱动&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;但是PDO_MySQL暂时还不支持mysqlnd，目前只有mysql(i)扩展可以用到&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/470/feed</wfw:commentRss><description>接上文
性能提升
php 5.3的总体性能提升了5 - 15%


				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/470&quot; title=&quot;php 5.3带来了什么(二)&quot;&gt;阅读全文（1275字）&lt;/a&gt;&lt;/span&gt;</description><category>PHP</category><category>MYSQL</category><pubDate>Sun, 21 Sep 2008 14:44:53 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/470#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/470</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/470</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368473/5088797</fs:itemid></item><item><title>php 5.3带来了什么(一)</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368474/5088797/1/item.html</link><content:encoded>&lt;p&gt;之前陆续介绍了&lt;a href=&quot;/index.php/archives/469&quot;&gt;php 5.3的一些新特性&lt;/a&gt;，正好上周看到ZendCon关于5.3的ppt，介绍的更为详细，那么这里做个归总或者说翻译:)&lt;/p&gt;
&lt;h2&gt;Namespaces&lt;/h2&gt;
&lt;p&gt;php 5.3最大的改动，毫无疑问就是Namespaces(此前有一篇相关的&lt;a href=&quot;http://www.ooso.net/index.php/archives/418&quot;&gt;PHP Namespaces FAQ&lt;/a&gt;)。这给php开发人员带来的好处不少，广为人们所诟病的函数命名问题也得到了解决。&lt;/p&gt;
&lt;h3&gt;代码更清晰&lt;/h3&gt;
&lt;p&gt;5.3之前常见的代码，需要自定义前缀区分函数和类名&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-24&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-24'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-24&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;function MY_wrapper&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;class MY_DB &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;define&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;'MY_CONN_STR'&lt;/span&gt;, &lt;span style=&quot;color:#CC0000;&quot;&gt;''&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;MY_wrapper&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;new MY_DB&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;MY_CONN_STR; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;使用名称空间之后，代码看上去更加clean。&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-25&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-25'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-25&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;namespace MY;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;function wrapper&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;class DB &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;const CONN_STR = &lt;span style=&quot;color:#CC0000;&quot;&gt;''&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;use MY AS MY;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;wrapper&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;new DB&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;CONN_STR; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h3&gt;一个文件中定义了多个namespace&lt;/h3&gt;
&lt;p&gt;如果一个文件中定义了多个namespace，应该怎样处理？&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-26&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-26'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-26&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;namespace LIB;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;class MySQL &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;class SQLite &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$b = new SQLite&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;namespace LIB_EXTRA;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;class MScrypt &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$a = new MScrypt&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;var_dump&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        get_class&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$a&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        get_class&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$b&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;以上代码输出为：&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-27&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-27'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-27&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;string&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;18&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;LIB_EXTRA::MScrypt&quot;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;string&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;11&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;LIB::SQLite&quot;&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;php是解释执行的语言，以上结果合情合理。&lt;/p&gt;
&lt;h3&gt;namespace的优先级&lt;/h3&gt;
&lt;p&gt;namespace中定义的函数，类和常量优先，其次才是全局的。&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-28&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-28'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-28&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;namespace foo;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;function strlen&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$foo&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt; return htmlentities&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$foo&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;echo strlen&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;test&quot;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// test &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;echo ::&lt;span style=&quot;&quot;&gt;strlen&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;test&quot;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// 4&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;echo namespace::&lt;span style=&quot;&quot;&gt;strlen&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;test&quot;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// test &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h3&gt;namespace和autoload的友情&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;autoload会根据namespace名称以及class名称来解析类文件位置&lt;/li&gt;
&lt;li&gt;仅当namespace和全局范围都没找到class定义的情况下，autoload才会被触发 &lt;/li&gt;
&lt;li&gt;在namespace中定义的__autoload不会被自动调用 &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-29&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-29'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-29&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;function __autoload&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$var&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt; var_dump&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$var&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// LIB::foo&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;require &lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;./ns.php&quot;&lt;/span&gt;; &lt;span style=&quot;color:#008000;&quot;&gt;/*&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#008000;&quot;&gt;        &amp;lt;?php&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#008000;&quot;&gt;                namespace LIB;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#008000;&quot;&gt;                new foo();&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#008000;&quot;&gt;*/&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h3&gt;namespace一些辅料&lt;/h3&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-30&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-30'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-30&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;namespace really::&lt;span style=&quot;&quot;&gt;long&lt;/span&gt;::&lt;span style=&quot;&quot;&gt;pointlessly&lt;/span&gt;::&lt;span style=&quot;&quot;&gt;verbose&lt;/span&gt;::&lt;span style=&quot;&quot;&gt;ns&lt;/span&gt;;  &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;__NAMESPACE__; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// 新增的魔法常量，表示当前namespace名称&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;class a&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;   &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;get_class&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;new a&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// really::long::pointlessly::verbose::ns::a&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;use really::&lt;span style=&quot;&quot;&gt;long&lt;/span&gt;::&lt;span style=&quot;&quot;&gt;pointlessly&lt;/span&gt;::&lt;span style=&quot;&quot;&gt;verbose&lt;/span&gt;::&lt;span style=&quot;&quot;&gt;ns&lt;/span&gt;::&lt;span style=&quot;&quot;&gt;a&lt;/span&gt; AS b; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// 从名称空间中引用一个类 &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;注：这里的内容节选自pdf &lt;a href=&quot;http://ilia.ws/archives/187-Introduction-to-PHP-5.3-Slides.html&quot;&gt;Introduction to PHP 5.3 Slides&lt;/a&gt;，后文不再复述。&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/469/feed</wfw:commentRss><description>之前陆续介绍了php 5.3的一些新特性，正好上周看到ZendCon关于5.3的ppt，介绍的更为详细，那么这里做个归总或者说翻译:)
Namespaces
php 5.3最大的改动，毫无疑问就是Namespaces(此前有一篇相关的PHP Namespaces FAQ)。这给php开发人员带来的好处不少，广为人们所诟病的函数命名问题也得到了解决。
代码更清晰

				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/469&quot; title=&quot;php 5.3带来了什么(一)&quot;&gt;阅读全文（1229字）&lt;/a&gt;&lt;/span&gt;</description><category>PHP</category><pubDate>Sun, 21 Sep 2008 08:49:31 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/469#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/469</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/469</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368474/5088797</fs:itemid></item><item><title>wget的亲戚 - wput</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368475/5088797/1/item.html</link><content:encoded>&lt;p&gt;&lt;b&gt;世界上最远的距离，是网通到电信&lt;/b&gt; —— 这简直是赤果果的真理！&lt;/p&gt;
&lt;p&gt;俺这个狗窝host在南方某个电信机房里，从北京访问页面，速度也还凑合着能过。但是要想通过ftp上传几个文件，几乎是不可能，只有三种情况会发生：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;timeout!&lt;/li&gt;
&lt;li&gt;timeout!&lt;/li&gt;
&lt;li&gt;timeout!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;这天我打算把wordpress升级到最新版本，更新文件就成了个大难题。那么只好找了个server做跳板，用wget的亲戚 - wput来解决文件批量上传的问题：&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-32&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-32'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-32&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;wput -B wordpress&lt;span style=&quot;color:#008000;&quot;&gt;/* ftp://xxxxxx.net/xxxx/ &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;这样一行命令就能把整个wordpress上传到ftp指定目录下。&lt;/p&gt;
&lt;h2&gt;wput的参数&lt;/h2&gt;
&lt;blockquote&gt;&lt;p&gt;
Usage: wput [options] [file]… [url]…&lt;br /&gt;
url ftp://[username[:password]@]hostname[:port][/[path/][file]]
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;注：如果username和password有:, @之类的字符，可以用urlencode编码&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/468/feed</wfw:commentRss><description>世界上最远的距离，是网通到电信 —— 这简直是赤果果的真理！
俺这个狗窝host在南方某个电信机房里，从北京访问页面，速度也还凑合着能过。但是要想通过ftp上传几个文件，几乎是不可能，只有三种情况会发生：

timeout!

				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/468&quot; title=&quot;wget的亲戚 - wput&quot;&gt;阅读全文（431字）&lt;/a&gt;&lt;/span&gt;</description><category>免费软件</category><category>COMMON</category><pubDate>Sat, 20 Sep 2008 19:22:50 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/468#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/468</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/468</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368475/5088797</fs:itemid></item><item><title>mysql proxy的常见问题</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368476/5088797/1/item.html</link><content:encoded>&lt;p&gt;最近试用&lt;a href=&quot;/?tag=mysql&quot;&gt;mysql&lt;/a&gt; proxy，遇到若干问题，好在一一找到了解决方案，列出来备忘。这次使用的版本是0.6.x，也许新版本就没有这些问题了。&lt;/p&gt;
&lt;h2&gt;无法通过mysql proxy连接mysql&lt;/h2&gt;
&lt;p&gt;在host,password正确的情况下，也会遇到无法连接mysql的情况，可以查查mysql server是不是使用了old_password，检查my.cnf里面是不是有
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-36&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-36'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-36&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;old_password = &lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;1&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
有的数据库是从老版本升级上来的，所以会开启这个选项，mysql proxy不支持old_password。另外也可以通过查看密码长度的方式来判断:&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-37&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-37'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-37&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;select length&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;password&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; from mysql.&lt;span style=&quot;&quot;&gt;user&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
如果长度为16位则是old_password无疑。&lt;/p&gt;
&lt;h2&gt;字符乱码&lt;/h2&gt;
&lt;p&gt;通过proxy连上数据库之后，查到的字符串始终是乱码，即便手工执行了&lt;b&gt;set names 'utf8'&lt;/b&gt;也没有效果。&lt;/p&gt;
&lt;p&gt;解决办法，mysql server必须设置&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-38&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-38'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-38&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#91;&lt;/span&gt;mysqld&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;skip-character-set-client-handshake&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;init-connect=&lt;span style=&quot;color:#CC0000;&quot;&gt;'SET NAMES utf8'&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;default-character-set=utf8 &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h2&gt;一台mysql slave当掉之后，mysql proxy会报错导致全部的mysql无法连接&lt;/h2&gt;
&lt;p&gt;安装了mysql proxy实现读写分离，有master x 1, slave x 2。为了测试failover，停掉了一个slave，然后mysql proxy会一直报错，提示无法连接。这个情况比单点的mysql还糟糕，挂掉一个就全挂掉！mysql的工程师给提供了一段代码，替换掉&lt;b&gt;src/network-mysqld-proxy.c&lt;/b&gt;的&lt;b&gt;NETWORK_MYSQLD_PLUGIN_PROTO&lt;/b&gt;函数可以解决这个问题。&lt;/p&gt;
&lt;p&gt;代码比较长，直接附上下载地址： &lt;a href=&quot;http://customcode.googlecode.com/files/network-mysqld-proxy-function.c&quot;&gt;network-mysqld-proxy-function.c&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;定期crash&lt;/h2&gt;
&lt;p&gt;这个问题也很糟糕，mysql proxy经常会自己悄悄的停止工作，所幸时间间隔很长。猜想是有内存泄漏的问题存在，希望以后的版本能解决。&lt;/p&gt;
&lt;p&gt;我采用的解决办法就是晚上定期重启它。&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/467/feed</wfw:commentRss><description>最近试用mysql proxy，遇到若干问题，好在一一找到了解决方案，列出来备忘。这次使用的版本是0.6.x，也许新版本就没有这些问题了。
无法通过mysql proxy连接mysql
在host,password正确的情况下，也会遇到无法连接mysql的情况，可以查查mysql server是不是使用了old_password，检查my.cnf里面是不是有
PLAIN TEXT

				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/467&quot; title=&quot;mysql proxy的常见问题&quot;&gt;阅读全文（915字）&lt;/a&gt;&lt;/span&gt;</description><category>MYSQL</category><pubDate>Sat, 20 Sep 2008 17:34:26 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/467#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/467</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/467</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368476/5088797</fs:itemid></item><item><title>sphinx新建索引的一般流程</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368477/5088797/1/item.html</link><content:encoded>&lt;p&gt;在sphinx中新建索引(不是新增数据)的一般流程：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;在sphinx.conf中增加index配置项&lt;/li&gt;
&lt;li&gt;手工重建索引，不要使用--rotate参数，例如
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-40&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-40'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-40&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;/usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/sphinx.&lt;span style=&quot;&quot;&gt;conf&lt;/span&gt; --all &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/li&gt;
&lt;li&gt;重启searchd&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这样才不会产生&lt;a href=&quot;/?tag=shpinx&quot;&gt;sphinx&lt;/a&gt;索引的临时.new.*文件&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/466/feed</wfw:commentRss><description>在sphinx中新建索引(不是新增数据)的一般流程：

在sphinx.conf中增加index配置项
手工重建索引，不要使用--rotate参数，例如

				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/466&quot; title=&quot;sphinx新建索引的一般流程&quot;&gt;阅读全文（196字）&lt;/a&gt;&lt;/span&gt;</description><category>sphinx</category><category>COMMON</category><pubDate>Sat, 20 Sep 2008 17:19:37 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/466#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/466</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/466</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368477/5088797</fs:itemid></item><item><title>从memcache中dump所有key的patch</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368478/5088797/1/item.html</link><content:encoded>&lt;p&gt;在邮件组里看到这个补丁，能够将&lt;a href=&quot;/?tag=memcache&quot;&gt;memcache&lt;/a&gt;中所有的key dump出来。&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;I have just finished a patch to dump all keys from memcached.&lt;br /&gt;
And I am glad to share this patch to anyone who wants to use it.&lt;/p&gt;
&lt;p&gt;In the attachment, there are two python scripts which are used for dump all keys from a memcached server,&lt;br /&gt;
you can find the usage in the example.py script.&lt;/p&gt;
&lt;p&gt;Any  questions or advice can mail  to  we_2002 at 163.com &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;用法见example.py&lt;/p&gt;
&lt;p&gt;下载:  &lt;a href=&quot;http://customcode.googlecode.com/files/memcached-hack.zip&quot;&gt;memcached-hack.zip&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/465/feed</wfw:commentRss><description>在邮件组里看到这个补丁，能够将memcache中所有的key dump出来。
I have just finished a patch to dump all keys from memcached.
And I am glad to share this patch to anyone who wants to use it.
In the attachment, there are two python scripts which are used for dump all keys from a memcached server,

				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/465&quot; title=&quot;从memcache中dump所有key的patch&quot;&gt;阅读全文（343字）&lt;/a&gt;&lt;/span&gt;</description><category>memcache</category><category>COMMON</category><pubDate>Sat, 23 Aug 2008 12:27:41 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/465#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=465</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/465</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368478/5088797</fs:itemid></item><item><title>mysqlnd成为php 5.3中的默认mysql驱动</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368479/5088797/1/item.html</link><content:encoded>&lt;p&gt;mysqlnd成为php 5.3中的默认mysql驱动，它有如下优点：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;mysqlnd更容易编译: 因为它是php源码树的一个组成部分&lt;/li&gt;
&lt;li&gt;mysqlnd和php内部机制结合更紧密，是优化过的mysql驱动&lt;/li&gt;
&lt;li&gt;mysqlnd更节省内存，从测试结果来看，比传统的mysql扩展节省40%的内存&lt;/li&gt;
&lt;li&gt;mysqlnd更快&lt;/li&gt;
&lt;li&gt;mysqlnd提供了丰富的性能统计功能&lt;/li&gt;
&lt;li&gt;mysqlnd使用了PHP license以避免不必要的版权纠纷&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;这个改动应同时对mysql和pdo_mysql扩展生效。&lt;/p&gt;
&lt;h3&gt;mysqlnd是什么&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://blogs.mysql.com/kaj/2006/10/25/69/&quot;&gt;mysqlnd&lt;/a&gt;是&lt;a href=&quot;/?tag=mysql&quot;&gt;mysql&lt;/a&gt;原装的php驱动&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/464/feed</wfw:commentRss><description>mysqlnd成为php 5.3中的默认mysql驱动，它有如下优点：

mysqlnd更容易编译: 因为它是php源码树的一个组成部分
mysqlnd和php内部机制结合更紧密，是优化过的mysql驱动

				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/464&quot; title=&quot;mysqlnd成为php 5.3中的默认mysql驱动&quot;&gt;阅读全文（255字）&lt;/a&gt;&lt;/span&gt;</description><category>PHP</category><category>MYSQL</category><pubDate>Wed, 06 Aug 2008 23:15:03 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/464#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=464</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/464</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368479/5088797</fs:itemid></item><item><title>php 5.3将提供改进的Lambda函数</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368480/5088797/1/item.html</link><content:encoded>&lt;h3&gt;从前的lambda函数&lt;/h3&gt;
&lt;p&gt;在php里面，传统方法是利用create_function来建立lambda函数，老实说，这个创建过程比较麻烦。拿php手册上的例子来说：&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-48&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-48'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-48&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;lt;?php&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$newfunc = create_function&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;'$a,$b'&lt;/span&gt;, &lt;span style=&quot;color:#CC0000;&quot;&gt;'return &amp;quot;ln($a) + ln($b) = &amp;quot; . log($a * $b);'&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;echo &lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;New anonymous function: $newfunc&lt;span style=&quot;color:#000099; font-weight:bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;echo $newfunc&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;2&lt;/span&gt;, M_E&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; . &lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;&lt;span style=&quot;color:#000099; font-weight:bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// outputs&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// New anonymous function: lambda_1&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// ln(2) + ln(2.718281828459) = 1.6931471805599&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;?&amp;gt; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;上头这样一段代码，恐怕一时半会还看不明白$newfunc到底是怎样的一个lambda函数。&lt;/p&gt;
&lt;h3&gt;php 5.3的lambda函数语法&lt;/h3&gt;
&lt;p&gt;改进的lambda基本语法&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-49&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-49'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-49&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;function &amp;amp; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;parameters&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; use &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;lexical vars&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt; body &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;创建一个简单lambda函数的例子。下面的例子看上去，语法和javascript甚至很接近了，对于我这样一个由javascript入门到php来的coder来说，这样的代码真是让人瞅着亲切。代码最后的&lt;b&gt;;&lt;/b&gt;号是不可省略的，否则会碰到语法错误。&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-50&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-50'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-50&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$lambda = function &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt; echo &lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;Hello World!&lt;span style=&quot;color:#000099; font-weight:bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;调用方法很多&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-51&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-51'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-51&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;$lambda &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;call_user_func &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$lambda&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;call_user_func_array &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$lambda, array &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;在函数中的简单调用&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-52&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-52'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-52&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;function replace_spaces &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$text&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; $replacement = function &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$matches&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; return str_replace &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$matches&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#93;&lt;/span&gt;, &lt;span style=&quot;color:#CC0000;&quot;&gt;' '&lt;/span&gt;, &lt;span style=&quot;color:#CC0000;&quot;&gt;'&amp;amp;nbsp;'&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color:#CC0000;&quot;&gt;' '&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; return preg_replace_callback &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;'/( +) /'&lt;/span&gt;, $replacement, $text&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;甚至可以把lambda函数作为结果返回，这样引申的语法变化会相当丰富，想想javascript就知道了&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-53&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-53'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-53&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;function getAdder&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$x&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; return function &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$y&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; use &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$x&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color:#FF9933; font-style:italic;&quot;&gt;// or: lexical $x;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return $x + $y;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;还可以导入外部变量到lambda函数，通过关键字&lt;strong&gt;use&lt;/strong&gt;完成。如果没有这个关键字，以前可能要通过&lt;strong&gt;global&lt;/strong&gt;来传递这些变量。&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-54&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-54'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-54&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;function replace_in_array &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$search, $replacement, $array&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; $map = function &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$text&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; use &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$search, $replacement&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;strpos &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$text, $search&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;gt; &lt;span style=&quot;color:#800000;color:#800000;&quot;&gt;50&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; return str_replace &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$search, $replacement, $text&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt; else &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; return $text;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; return array_map &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;$map, $array&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;这个patch由Christian Seiler, Dmitry Stogov提供，目前已经加入到php 5.3。&lt;/p&gt;
&lt;p&gt;原文见：&lt;a href=&quot;http://wiki.php.net/rfc/closures&quot;&gt;Request for Comments: Lambda functions and closures&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/463/feed</wfw:commentRss><description>从前的lambda函数
在php里面，传统方法是利用create_function来建立lambda函数，老实说，这个创建过程比较麻烦。拿php手册上的例子来说：
PLAIN TEXT
CODE:

				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/463&quot; title=&quot;php 5.3将提供改进的Lambda函数&quot;&gt;阅读全文（86字）&lt;/a&gt;&lt;/span&gt;</description><category>PHP</category><pubDate>Mon, 21 Jul 2008 09:32:24 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/463#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=463</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/463</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368480/5088797</fs:itemid></item><item><title>最简便的清空memcache的方法</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368481/5088797/1/item.html</link><content:encoded>&lt;p&gt;如果要清空memcache的items，常用的办法是什么？杀掉重启？如果有n台&lt;a href=&quot;/?tag=memcache&quot;&gt;memcache&lt;/a&gt;需要重启怎么办？挨个做一遍？&lt;/p&gt;
&lt;p&gt;很简单，假设memcached运行在本地的11211端口，那么跑一下命令行：&lt;br /&gt;
&lt;code&gt;$ echo ”flush_all” | nc localhost 11211&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;注：flush并不会将items删除，只是将所有的items标记为expired。&lt;/p&gt;
&lt;p&gt;原文：&lt;a href=&quot;http://willj.net/blog/2008/06/10/flushing-memcached-servers-the-easy-way/&quot;&gt;Flushing memcached servers the easy way&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/462/feed</wfw:commentRss><description>如果要清空memcache的items，常用的办法是什么？杀掉重启？如果有n台memcache需要重启怎么办？挨个做一遍？
很简单，假设memcached运行在本地的11211端口，那么跑一下命令行：
$ echo ”flush_all” &amp;#124; nc localhost 11211
注：flush并不会将items删除，只是将所有的items标记为expired。

				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/462&quot; title=&quot;最简便的清空memcache的方法&quot;&gt;阅读全文（210字）&lt;/a&gt;&lt;/span&gt;</description><category>memcache</category><category>PHP</category><pubDate>Sun, 20 Jul 2008 09:08:58 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/462#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/462</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/462</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368481/5088797</fs:itemid></item><item><title>Yahoo yui host提供combo handler服务</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368482/5088797/1/item.html</link><content:encoded>&lt;p&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/265&quot;&gt;Yahoo之前提供了公开的YUI Hosting&lt;/a&gt;，现在又在这个基础上进一步提供了combo handler服务。这项服务的目的是尽可能减少http请求的数目，以提高web前端的展现速度，这也是&lt;a href=&quot;http://www.space007.com/post/129.html&quot;&gt;高性能网页开发的14条军规&lt;/a&gt;之首。&lt;/p&gt;
&lt;p&gt;此前，如果要使用YUI Rich Text Editor，需要引用若干外部js。共计6个http请求。&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-57&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-57'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-57&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;lt;script type=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp;src=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-event.js&quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;lt;script type=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp;src=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;http://yui.yahooapis.com/2.5.2/build/container/container_core-min.js&quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt; &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;lt;script type=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp;src=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;http://yui.yahooapis.com/2.5.2/build/menu/menu-min.js&quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt; &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;lt;script type=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp;src=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;http://yui.yahooapis.com/2.5.2/build/element/element-beta-min.js&quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt; &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;lt;script type=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp;src=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;http://yui.yahooapis.com/2.5.2/build/button/button-min.js&quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;lt;script type=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp;src=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js&quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;如果使用combo handler，那么http请求数可以合并成一个，如下：   &lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-58&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-58'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-58&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;lt;script type=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;src=&lt;span style=&quot;color:#CC0000;&quot;&gt;&quot;http://yui.yahooapis.com/combo?2.5.2/build/yahoo-dom-event/yahoo-dom-event.js&amp;amp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;2.5.2/build/container/container_core-min.js&amp;amp;2.5.2/build/menu/menu-min.js&amp;amp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;2.5.2/build/element/element-beta-min.js&amp;amp;2.5.2/build/button/button-min.js&amp;amp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#CC0000;&quot;&gt;2.5.2/build/editor/editor-beta-min.js&quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt; &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;可惜这个host在国外，对国内的yui用户来说，没有什么帮助。&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/458/feed</wfw:commentRss><description>Yahoo之前提供了公开的YUI Hosting，现在又在这个基础上进一步提供了combo handler服务。这项服务的目的是尽可能减少http请求的数目，以提高web前端的展现速度，这也是高性能网页开发的14条军规之首。
此前，如果要使用YUI Rich Text Editor，需要引用若干外部js。共计6个http请求。
PLAIN TEXT
CODE:

				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/458&quot; title=&quot;Yahoo yui host提供combo handler服务&quot;&gt;阅读全文（252字）&lt;/a&gt;&lt;/span&gt;</description><category>JAVASCRIPT</category><category>yui</category><category>yahoo</category><pubDate>Thu, 17 Jul 2008 09:42:45 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/458#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/458</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/458</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368482/5088797</fs:itemid></item><item><title>google gears无法安装的问题解决</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368483/5088797/1/item.html</link><content:encoded>&lt;p&gt;&lt;a href=&quot;/?tag=wordpress&quot;&gt;wordpress&lt;/a&gt; 2.6集成了&lt;a href=&quot;http://gears.google.com&quot;&gt;google gears&lt;/a&gt;，据说缓存一些文件，大大提升后台访问速度。但是今天跑去下载gears安装，却始终提示安装失败。&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Connection errors. Please try again&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;在google的帮助系统中有相关提示：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Listed below are several possible causes for the connection error you're receiving. Please determine which of these causes may be applicable to you and follow the instructions to resolve the problem.&lt;/p&gt;
&lt;p&gt;................&lt;/p&gt;
&lt;p&gt;Your computer's Background Intelligent Transfer Service (BITS) isn't starting properly. If this is the case, you may want to verify that BITS is correctly configured. To ensure that BITS is enabled, please follow these steps:&lt;/p&gt;
&lt;p&gt;   1. Click the &quot;Start&quot; button in your Windows taskbar and select &quot;Settings&quot; &gt; &quot;Control Panel&quot; &gt; &quot;Administrative Tools&quot; &gt; &quot;Services.&quot;&lt;br /&gt;
   2. Select &quot;Background Intelligent Transfer Service&quot; from the list.&lt;br /&gt;
   3. Right-click “Background Intelligent Transfer Service” and choose &quot;Properties&quot; from the menu.&lt;br /&gt;
   4. From the &quot;General&quot; tab verify that the &quot;Startup&quot; type is set to either &quot;Automatic&quot; or &quot;Manual.&quot; Make sure this setting is not &quot;Disabled.&quot;
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;按照这个帮助找下去，发现BITS服务果然是没有打开，手工启动也会报错。那么继续在google上爬了一阵，得到一个看似很强大的解决方案：&lt;/p&gt;
&lt;p&gt;在dos命令行下执行:&lt;/p&gt;
&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-60&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;javascript:showCodeTxt('code-60'); return false;&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-60&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;c:&amp;gt;sc.&lt;span style=&quot;&quot;&gt;exe&lt;/span&gt; config bits start= auto&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;c:&amp;gt;sc.&lt;span style=&quot;&quot;&gt;exe&lt;/span&gt; sdset bits D:&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;A;;CCLCSWRPWPDTLOCRRC;;;SY&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;A;;CCLCSWLOCRRC;;;AU&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#40;&lt;/span&gt;A;;CCLCSWRPWPDTLOCRRC;;;PU&lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;font-weight: bold;color:#26536A;&quot;&gt;
&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;c:&amp;gt;sc.&lt;span style=&quot;&quot;&gt;exe&lt;/span&gt; start bits &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;如果启动成功，会得到下面的提示信息：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;SERVICE_NAME: bits&lt;br /&gt;
        TYPE               : 20  WIN32_SHARE_PROCESS&lt;br /&gt;
        STATE              : 2  START_PENDING&lt;br /&gt;
                                (NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)&lt;br /&gt;
        WIN32_EXIT_CODE    : 0  (0x0)&lt;br /&gt;
        SERVICE_EXIT_CODE  : 0  (0x0)&lt;br /&gt;
        CHECKPOINT         : 0x0&lt;br /&gt;
        WAIT_HINT          : 0x7d0&lt;br /&gt;
        PID                : 1808&lt;br /&gt;
        FLAGS              :
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;接着安装google gears，一切顺利。&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/455/feed</wfw:commentRss><description>wordpress 2.6集成了google gears，据说缓存一些文件，大大提升后台访问速度。但是今天跑去下载gears安装，却始终提示安装失败。
Connection errors. Please try again
在google的帮助系统中有相关提示：
Listed below are several possible causes for the connection error you're receiving. Please determine which of these causes may be applicable to you and follow the instructions to resolve the problem.

				&lt;span class=&quot;readmore&quot;&gt;&lt;a href=&quot;http://www.ooso.net/index.php/archives/455&quot; title=&quot;google gears无法安装的问题解决&quot;&gt;阅读全文（1377字）&lt;/a&gt;&lt;/span&gt;</description><category>WORDPRESS</category><category>GOOGLE</category><pubDate>Wed, 16 Jul 2008 21:57:34 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/455#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/455</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/455</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368483/5088797</fs:itemid></item><item><title>升级到wordpress 2.6失败</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368484/5088797/1/item.html</link><content:encoded>&lt;p&gt;第一时间往wordpress 2.6升级，这次不像往常那么顺利，升级完成之后给了一个好大的404错误提示页。根据往常的经验，这个应该是Permalinks的rewrite规则出现了问题，删除wordpress自动生成的.htaccess，就能显示首页，但是内容页通通显示无法找到 T_T&lt;/p&gt;
&lt;p&gt;在&lt;a href=&quot;http://wordpress.org/support/&quot;&gt;wordpress的支持论坛&lt;/a&gt;上也看到有相同情况的人，为数不少，看来2.6还真是个有瑕疵的版本。解决办法:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;给category和tag都设置一个初始值，比如&lt;b&gt;category&lt;/b&gt;以及&lt;b&gt;tag&lt;/b&gt;。&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;我的Permalinks是&lt;b&gt;/index.php/archives/%post_id%&lt;/b&gt;，因为原来的服务器不支持rewrite..&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.ooso.net/index.php/archives/445/feed</wfw:commentRss><description>第一时间往wordpress 2.6升级，这次不像往常那么顺利，升级完成之后给了一个好大的404错误提示页。根据往常的经验，这个应该是Permalinks的rewrite规则出现了问题，删除wordpress自动生成的.htaccess，就能显示首页，但是内容页通通显示无法找到 T_T
在wordpress的支持论坛上也看到有相同情况的人，为数不少，看来2.6还真是个有瑕疵的版本。解决办法:
给category和tag都设置一个初始值，比如category以及tag。
我的Permalinks是/index.php/archives/%post_id%，因为原来的服务器不支持rewrite..</description><category>WORDPRESS</category><pubDate>Wed, 16 Jul 2008 14:36:03 +0800</pubDate><author>Volcano</author><comments>http://www.ooso.net/index.php/archives/445#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/445</guid><dc:creator>Volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/445</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/129368484/5088797</fs:itemid></item><item><title>memcache遭遇out of memory错误</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/129368485/5088797/1/item.html</link><content:encoded>&lt;p&gt;今天在服务器上碰到&lt;a href=&quot;/?tag=memcache&quot;&gt;memcache&lt;/a&gt;的out of memory错误，这还是第一次遇到，稍稍有些慌。一共有15台服务器，每台服务器分配了1G内存给memcache，合计有15个G，遇到错误的时候，大概只使用了4个G不到的内存。&lt;/p&gt;
&lt;p&gt;现象比较很灵异，设置一个很小的value的时候就会出现这个错误&lt;br /&gt;
&lt;code&gt;[root@slave1 bin]# telnet localhost 11211&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to localhost (127.0.0.1).&lt;br /&gt;
Escape character is '^]'.&lt;br /&gt;
set key1 0 0 2&lt;br /&gt;
SERVER_ERROR out of memory&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;如果设置一个较大的value，反而Stored成功。&lt;/p&gt;
&lt;p&gt;翻看了几篇关于memcache内存分配的介绍，大概有一些了解。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://tech.idv2.com/2008/07/11/memcached-002/&quot;&gt;memcached全面剖析–2.理解memcached的内存存储&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://kevinminnick.blogspot.com/2006/01/understanding-memcached-memory.html&quot;&gt;Understanding memcached memory management&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;其中后一篇有实际操作的介绍，更为实用。根据个人理解先写个大概。&lt;/p&gt;
&lt;p&gt;Memcache为了避免产生内存碎片，采用Slab Allocation机制来整理内存。比如某前端机分配了1G内存给memcache，那么它