<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>芳草苑 &#187; php</title>
	<atom:link href="http://blog.goods-pro.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.goods-pro.com</link>
	<description>草的家园，花在哪里？</description>
	<lastBuildDate>Wed, 08 Sep 2010 23:24:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>phpMyAdmin 2002 error</title>
		<link>http://blog.goods-pro.com/1841/phpmyadmin-2002-error/</link>
		<comments>http://blog.goods-pro.com/1841/phpmyadmin-2002-error/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 01:01:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1841</guid>
		<description><![CDATA[最近把家里的测试服务器 Zend Server php 5.2 卸载了，重新安装了 5.3。phpMyAdmin 随着 5.2 卸载也被卸载了。我用
yum install phpMyAdmin
重新安装了 phpMyAdmin。在 config.inc.php 设置了必要的参数，但 phpMyAdmin prompted:
#2002 &#8211; The server is not responding (or the local MySQL server&#8217;s socket is not correctly configured)
我浪费了很多时间检查了所有可能的错误，却解决不了问题。最后在 phpmyadmin.net 下载了源码，使用同样的 config.inc.php，顺利登录！
]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1841/phpmyadmin-2002-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Zend Server with Plesk</title>
		<link>http://blog.goods-pro.com/1753/install-zend-server-with-plesk/</link>
		<comments>http://blog.goods-pro.com/1753/install-zend-server-with-plesk/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 15:58:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1753</guid>
		<description><![CDATA[据说 Zend 正在跟 Plesk 探讨怎么让他们的产品相互兼容。
我没那么高深，无法让 Zend Server 完全兼容 Plesk，但可以做到——
前台用上 Zend Server 版的 php （Plesk 前后台使用两个安装的 php），尽管 Plesk 后台误认为 php module not installed。我强行修改了 psa 数据库里的数据，改了什么我不记得了。说实话，把 Zend Server 和 Plesk 跑在一起意义也不大。
]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1753/install-zend-server-with-plesk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When does php apc refresh cache data?</title>
		<link>http://blog.goods-pro.com/1712/when-does-php-apc-refresh-cache-data/</link>
		<comments>http://blog.goods-pro.com/1712/when-does-php-apc-refresh-cache-data/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 23:29:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1712</guid>
		<description><![CDATA[I did this experiment with php apc:
In php.ini I set include_path = /first/include/path:/second/include/path, but do not put a file in /first/include/path or /second/include/path, create test.php as simple as this

&#60;?php
require 'tobeincluded.php';

It will run into a fatal error. This error is obvious.
Then I create the file tobeincluded.php in /second/include/path, test.php now runs all right.
Then I create another [...]]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1712/when-does-php-apc-refresh-cache-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade zend server php 5.2 to 5.3</title>
		<link>http://blog.goods-pro.com/1674/upgrade-zend-server-php-5-2-to-5-3/</link>
		<comments>http://blog.goods-pro.com/1674/upgrade-zend-server-php-5-2-to-5-3/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 22:12:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1674</guid>
		<description><![CDATA[The correct command to remove php 5.2 before upgrade zend server to 5.3 is

yum -y remove zend-server-php-5.2 &#38;&#38; yum -y remove `rpm -qa&#124;grep zend&#124;xargs`
Use yum -y remove zend-server-php-5.2 is not enough.
After removal, run
yum install zend-server-ce-php-5.3
Of course, zend repository must be add to /etc/yum.repos.d before. (If not, where you got zend server php 5.2?)
The most recent [...]]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1674/upgrade-zend-server-php-5-2-to-5-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to detect current connection is secure using Php?</title>
		<link>http://blog.goods-pro.com/1670/how-to-detect-current-connection-is-secure-using-php/</link>
		<comments>http://blog.goods-pro.com/1670/how-to-detect-current-connection-is-secure-using-php/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 17:33:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1670</guid>
		<description><![CDATA[Over a long time I had believed there was a function or an environment variable I could use in Php to tell whether the current connection secure or not, i.e. a page requested via http or https protocol. Unfortunately I could not find a good solution. I can not find it does not mean it [...]]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1670/how-to-detect-current-connection-is-secure-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A tool to synchronise Magento database between servers</title>
		<link>http://blog.goods-pro.com/1657/a-tool-to-synchronise-magento-database-between-servers/</link>
		<comments>http://blog.goods-pro.com/1657/a-tool-to-synchronise-magento-database-between-servers/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 21:01:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1657</guid>
		<description><![CDATA[我时不时需要在测试服务器上加载生产服务器的实时数据，以前都是把数据下载到本地的测试服务器后，手工键入一些命令完成数据加载，每次都要花费几分钟时间。为了避免一再“浪费”这几分钟，我今天一次性投入了几小时完成了一个 php 脚本。虽然这是为 magento 的数据迁移而写的脚本，但我写完一看，用在其他地方也是可以的。
为了安全起见，该脚本是用 php 命令行运行的，所有输出针对 terminal 美化，不是 browser。保存源码为 data_mover.php，同一目录下要有 mysqldump 得到的经 gzip 的 sql 文件，文件名以 FILENAME_PREFIX 开头，以 .sql.gz 结尾。启动时只需键入
/path/to/php -f data_mover.php
即可。
初始化 PDO 对象时，按理只需要 host=localhost，不需要 unix_socket=MYSQL_SOCKET。但奇怪的是，如果通过 apache 调用本程序（虽然不是本程序的初衷，但我希望它在浏览器下也能运行），仅指定 host=localhost 作 PDO __construct() 参数，会产生一个莫名其妙的错误：
SQLSTATE[HY000] [2002] Can&#8217;t connect to local MySQL server through socket &#8216;/tmp/mysql.sock&#8217; (2) 
似乎是 PDO bug。可以通过 host=127.0.0.1 或者追加 unix_socket=MYSQL_SOCKET 来避免。如果通过 php 命令行启动则没有这个问题。
而后，还涉及怎么删除所有数据表的问题。看似简单的一个问题，我发现 mysql [...]]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1657/a-tool-to-synchronise-magento-database-between-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to override abstract class in Magento?</title>
		<link>http://blog.goods-pro.com/1648/how-to-override-abstract-class-in-magento/</link>
		<comments>http://blog.goods-pro.com/1648/how-to-override-abstract-class-in-magento/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 21:42:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1648</guid>
		<description><![CDATA[If you are googling &#8220;override abstract class in magento&#8221; to find my blog, probably you already tried Mage::getModel(&#8217;module/model_abstract&#8217;) as it worked for instantiatable classes.
The scenario when requires override an abstract class is overriding isActive() method in Mage_Shipping_Model_Carrier_Abstract. If Mage_Shipping_Model_Carrier_Abstract can be overridden, all carrier methods&#8217; isActive logic can be changed without changing each instantiatable class. [...]]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1648/how-to-override-abstract-class-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Discovery: PhProxy &amp; CHtml</title>
		<link>http://blog.goods-pro.com/1590/discovery-phproxy-chtml/</link>
		<comments>http://blog.goods-pro.com/1590/discovery-phproxy-chtml/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 23:33:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1590</guid>
		<description><![CDATA[我认为突破访问限制的终级方案是 VPN，可是设置 VPN 的技术含量有点高，到现在我还搞不掂 OpenVPN，只能徘徊于 PPTP。今天发现可爱的 php 也有了 proxy（或许早就有了，我不知道罢了），虽然我用不着，但对国内的朋友们确实是天大的福音。简单易行，一分钟就能搭一个！
我只发现 phproxy 三个不大的缺陷：

无法代理流文件（比如无法看 youtube 上的 video，但访问 youtube 没问题）
因为 phproxy 工具栏在网页顶部，如果代理网页在相同位置绝对定位，则会重叠在一起（比如 wikipedia，我想修改一下 style.css 就好了，或者做一个自动隐藏的工具栏）
有些被代理的网页自检而跳出代理，重定向到原来的 url（比如 google spreadsheet）

牛人真不少，还有一个 CHtml，竟然用 recaptcha 去实现突破，构思非常巧妙。
]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1590/discovery-phproxy-chtml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comparison in PHP</title>
		<link>http://blog.goods-pro.com/1478/comparison-in-php/</link>
		<comments>http://blog.goods-pro.com/1478/comparison-in-php/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 21:58:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1478</guid>
		<description><![CDATA[除非使用 === 或 !== 进行比较，PHP 尽可能地将值转化为数字进行比较。因此，看到比较 &#8220;10&#8243; == &#8220;1e1&#8243; 的结果是 true，千万不要大惊小怪。
“尽可能”如何理解？

如果等式一边是数字，另一边是字符串，那么字符串一定要 cast to int 后再比较。因此，比较 &#8220;10&#8243; == 1e1 的结果是 true，比较 &#8220;10 &#8221; == 1e1 的结果也是 true。
如果等式两边都是字符串，且字符串中均不含数学字符以外的字符（包括white space），那么两边的字符串会在 cast to int 后再比较；否则，直接比较字符串。因此，比较 &#8220;10&#8243; == &#8220;1e1&#8243; 的结果是 true，但比较 &#8220;10 &#8221; == &#8220;1e1&#8243; 的结果是 false。
如果等式有一边或两边是数组，则先比较数组结构是否相同，再逐个比较数组元素。在比较数组元素时，索引不会 cast，但值按上述两条规则“尽可能” cast。因此，比较 1 == array(1) 的结果是 false，比较 array(&#8221;10&#8243;) == array(&#8221;1e1&#8243;) 的结果是 true，比较 array(10 [...]]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1478/comparison-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do not use is_null()</title>
		<link>http://blog.goods-pro.com/1402/do-not-use-isnull/</link>
		<comments>http://blog.goods-pro.com/1402/do-not-use-isnull/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 12:49:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1402</guid>
		<description><![CDATA[测试一个变量是否为 NULL，我曾喜欢用 is_null() 函数，现在发现还比如直接用 === 比较来得快。
php.net 上有人写了个测试，得出的结论是 === 比 is_null() 快30倍。


$v = NULL;

$s = microtime(TRUE);
for($i=0; $i&#60;1000; $i++) {
    is_null($v);
}
print microtime(TRUE)-$s;
print &#34;&#60;br&#62;&#34;;

$s = microtime(TRUE);
for($i=0; $i&#60;1000; $i++) {
    $v===NULL;
}
print microtime(TRUE)-$s;

这是2007年的事情了，我不清楚他的环境配置。如今在我 Intel(R) Celeron(R) CPU 2.80GHz PC 充当的测试服务器上，running zend server php 5.2.9，得出的结论是 === 比 is_null() 快1-2倍。看来 php is_null() 的效率进步了不少，但还是慢。以后我得改用 NULL === $v 的方式了。
]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1402/do-not-use-isnull/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
