<?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://icyleaf.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://icyleaf.com</link>
	<description>icyleaf&#039;s blog - 心外无理，心外无物，心外无事</description>
	<lastBuildDate>Tue, 13 Dec 2011 02:34:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>魔豆及其豆瓣 API 测试平台开源咯</title>
		<link>http://icyleaf.com/2011/05/modou-and-douban-api-console-is-open-source-now/</link>
		<comments>http://icyleaf.com/2011/05/modou-and-douban-api-console-is-open-source-now/#comments</comments>
		<pubDate>Mon, 02 May 2011 09:22:04 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[网络开发]]></category>
		<category><![CDATA[Kohana]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[魔豆]]></category>

		<guid isPermaLink="false">http://icyleaf.com/?p=873</guid>
		<description><![CDATA[这是作为 2011 年 5 月 1 日劳动节的福利发放，欢迎各位 Kohana 开发者及其爱好者围观领取，领取内容及其使用方式请前往本人 Github 的项目地址：https://github.com/icyleaf/modou]]></description>
			<content:encoded><![CDATA[<p>这是作为 2011 年 5 月 1 日劳动节的福利发放，欢迎各位 Kohana 开发者及其爱好者围观领取，领取内容及其使用方式请前往本人 Github 的项目地址：https://github.com/icyleaf/modou</p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2011/05/modou-and-douban-api-console-is-open-source-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何获取 Element 的 XPath [PHP/Javascript]</title>
		<link>http://icyleaf.com/2010/04/how-to-get-xpath-of-an-element-for-php-and-javascript/</link>
		<comments>http://icyleaf.com/2010/04/how-to-get-xpath-of-an-element-for-php-and-javascript/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 03:04:20 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[网络开发]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[XPath]]></category>

		<guid isPermaLink="false">http://icyleaf.com/?p=759</guid>
		<description><![CDATA[这两天研究 HTML 的 DOM 需要寻找某个 Element 元素的完整 XPath 路径，由于使用的是 PHP Simple HTML DOM Parser 开源库，这个库类的使用方法几乎兼容 Javascript 的 DOM 语法并附带 DOM 选择器。虽然功能强大但是并不能直接获取 Element 的 XPath。这个怎么办呢，依稀记得 Firebug 有一个功能，选择某个元素在它的控制台可以显示 XPath。嗯，着手实践一下发现不仅可以显示而且还可以复制 XPath。 于是想，如果可以找到 Javascript 版的相关代码就一定可以改成 PHP 版本的，结果在 Google 搜索找到了&#8230; var elt = document.getElementById('table'); var &#8230; <a href="http://icyleaf.com/2010/04/how-to-get-xpath-of-an-element-for-php-and-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>这两天研究 HTML 的 DOM 需要寻找某个 Element 元素的完整 XPath 路径，由于使用的是 <a href="http://simplehtmldom.sourceforge.net/manual.htm">PHP Simple HTML DOM Parser</a> 开源库，这个库类的使用方法几乎兼容 Javascript 的 DOM 语法并附带 DOM 选择器。虽然功能强大但是并不能直接获取 Element 的 XPath。这个怎么办呢，依稀记得 Firebug 有一个功能，选择某个元素在它的控制台可以显示 XPath。嗯，着手实践一下发现不仅可以显示而且还可以复制 XPath。</p>
<p>于是想，如果可以找到 Javascript 版的相关代码就一定可以改成 PHP 版本的，结果在 Google 搜索找到了&#8230;</p>
<pre lang="javascript" line="1" colla="+">
var elt = document.getElementById('table');
var xpath = getElementXPath(elt);
alert(xpath);

// Get full XPath of an element
function getElementXPath(elt)
{
	var path = "";
	for (; elt &#038;&#038; elt.nodeType == 1; elt = elt.parentNode)
	{
		idx = getElementIdx(elt);
		xname = elt.tagName;
		if (idx > 1) xname += "[" + idx + "]";
		path = "/" + xname + path;
	}

	return path;
}

// Get Idx of an element
function getElementIdx(elt)
{
    var count = 1;
    for (var sib = elt.previousSibling; sib ; sib = sib.previousSibling)
    {
        if(sib.nodeType == 1 &#038;&#038; sib.tagName == elt.tagName)	count++
    }

    return count;
}
</pre>
<p>PHP 改进版：</p>
<pre lang="php" line="1" colla="+">
// Use it before import PHP Simple HTML DOM Parser
$html = file_get_html('http://www.google.com/');
// find a sample element by id
$elt1 = $html->find('#footer', 0);
// find a sample element by tag name
$elt2= $html->find('div', 10);

// it will return if found it: //*[@id="footer"]
$xpath = getElementXPath($elt1);

// it will return if found it: html/body/div[10]
$xpath = getElementXPath($elt2);

function getElementXPath($elt)
{
	$path = '';
	$first = TRUE;
	for(; ($elt AND $elt->nodetype == 1); $elt = $elt->parent())
	{
		$xname = $elt->tag;
		$idx = getElementIdx($elt);

		if ($first AND isset($elt->attr['id']))
		{
			$path = '//*[@id="' . $elt->attr['id'] . '"]';
			break;
		}

		if ($idx > 1)
		{
			$xname .= '[' . $idx . ']';
		}

		$path = '/'.$xname.$path;

		$first = FALSE;
	}

	return $path;
}

function getElementIdx($elt)
{
    $count = 1;
    for($sib = $elt->prev_sibling(); $sib ; $sib = $sib->prev_sibling())
    {
        if($sib->nodetype == 1 &#038;&#038; $sib->tag == $elt->tag)
        {
        	$count++;
        }
    }

    return $count;
}
</pre>
<p>大家同样可以把上面的代码直接 crack 到 PHP Simple HTML DOM Parser 库中。</p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2010/04/how-to-get-xpath-of-an-element-for-php-and-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google App Engine 上 PHP 的使用</title>
		<link>http://icyleaf.com/2009/06/google-app-engine-on-the-use-of-php/</link>
		<comments>http://icyleaf.com/2009/06/google-app-engine-on-the-use-of-php/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 04:31:59 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[网络开发]]></category>
		<category><![CDATA[App Engine]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://icyleaf.com/?p=639</guid>
		<description><![CDATA[上次介绍了如何在 Google App Engine 运行 php 代码，这次是关于 GAE 上面 PHP 的使用方法。信息来源：PHPDeveloper 本日志转载摘文，主要有如何发电子邮件已经 PHP 的 SQL 使用。 如何使用 PHP 在 GAE 发送电子邮件 如何使用 PHP 在 GAE 创建，显示，更新和删除记录 pQg = PHP with SQL on GAE 如何使用 pQg]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="PHP on GAE" src="http://aralbalkan.com/wp-content/uploads/2009/04/appengine-java-php.jpg" alt="" width="496" height="323" /></p>
<p>上次介绍了<a href="http://icyleaf.com/2009/04/14/running-php-on-google-app-engine/" target="_self">如何在 Google App Engine 运行 php 代码</a>，这次是关于 GAE 上面 PHP 的使用方法。信息来源：<a href="http://www.phpdeveloper.org/news/12670" target="_self">PHPDeveloper</a></p>
<p>本日志转载摘文，主要有如何发电子邮件已经 PHP 的 SQL 使用。</p>
<ul>
<li><a href="http://blog.herbert.groot.jebbink.nl/2009/05/sending-email-with-php-at-gae.html">如何使用 PHP 在 GAE 发送电子邮件</a></li>
<li><a href="http://blog.herbert.groot.jebbink.nl/2009/05/creating-retrieving-updating-deleting.html">如何使用 PHP 在 GAE 创建，显示，更新和删除记录</a></li>
<li><a href="http://blog.herbert.groot.jebbink.nl/2009/05/rom-relational-object-mapping.html">pQg = PHP with SQL on GAE</a></li>
<li><a href="http://blog.herbert.groot.jebbink.nl/2009/06/how-to-use-rpg.html">如何使用 pQg</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2009/06/google-app-engine-on-the-use-of-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何让PHP在Google App Engine上运行</title>
		<link>http://icyleaf.com/2009/04/running-php-on-google-app-engine/</link>
		<comments>http://icyleaf.com/2009/04/running-php-on-google-app-engine/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 15:57:36 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[Webware]]></category>
		<category><![CDATA[App Engine]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Jetty]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Quercu]]></category>

		<guid isPermaLink="false">http://icyleaf.com/?p=594</guid>
		<description><![CDATA[话说前不久 Google App Engine 支持了第二种语言 Java，占据GAE需求排行榜的 java终于支持了，如果按这样的思路执行下去，那么不久的第三个语言肯定就是 PHP了！不过貌似大家都按耐不住这份心情，对 GAE 开始了各种的尝试，不过这里不能不说 java 是一个好东西，扩展和应用非常的广泛，于是乎就有了Quercu，它是一个 java 的应用，简单的说就是 PHP in Java。利用 Jetty（一款 Java 的web服务器）+ Quercus 就能让你在未开放 PHP语言支持的 GAE 上面运行 PHP代码，甚至把 Java 的类导入到 PHP里面执行！这就是 Quercus 的魔力。同样的如果你是 Ruby 用户，可以使用 JRuby 实现执行。好吧，下面开始实践：（方法来自：Brian’s World） 部署环境：Windows XP + Eclipse &#8230; <a href="http://icyleaf.com/2009/04/running-php-on-google-app-engine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>话说前不久 Google App Engine 支持了第二种语言 Java，占据GAE需求排行榜的 java终于支持了，如果按这样的思路执行下去，那么不久的第三个语言肯定就是 PHP了！不过貌似大家都按耐不住这份心情，对 GAE 开始了各种的尝试，不过这里不能不说 java 是一个好东西，扩展和应用非常的广泛，于是乎就有了<a href="http://www.caucho.com/resin-3.0/quercus/" target="_self">Quercu</a>，它是一个 java 的应用，简单的说就是 PHP in Java。利用 <a href="http://www.mortbay.org/jetty/" target="_self">Jetty</a>（一款 Java 的web服务器）+ Quercus 就能让你在未开放 PHP语言支持的 GAE 上面运行 PHP代码，甚至把 Java 的类导入到 PHP里面执行！这就是 Quercus 的魔力。同样的如果你是 Ruby 用户，可以使用 <a href="http://olabini.com/blog/2009/04/jruby-on-rails-on-google-app-engine/" target="_self">JRuby</a> 实现执行。好吧，下面开始实践：（方法来自：<a href="http://brian.brispace.net/2009/04/09/php-on-google-app-engine/" target="_self">Brian’s World</a>）</p>
<p>部署环境：Windows XP + Eclipse 3.4 + GAE for Java eclipse 3.4 plugins（如果使用官方教程无法安装，请参见另类<a href="http://ihere.appspot.com/2009/04/eclipse-google-plugin-installation-guide.html" target="_self">安装教程</a>）<br />
<span id="more-594"></span><br />
首先，下载支持库类。肯定得需要 Jetty，Quercus 的 jar 包（由于 GAE 的版本限制，或许只支持目前的版本包，如果链接失效请搜索同样版本的jar包或者在本文的末尾下载整个演示工程的 war 包），第一个是 <a href="http://www.java2s.com/Code/Jar/jetty-6.1.0/Downloadjettyutil610jar.htm" target="_self">jetty-util-6.1.0.jar</a>， quercus.jar（<span class="status-body"><span class="entry-content">Quercus 3.1.6 jars版本，最新版的</span></span><span class="status-body"><span class="entry-content"> 3.2.x 不支持</span></span><span class="status-body"><span class="entry-content">）</span></span> 以及 <span class="status-body"><span class="entry-content">Quercus 包中的</span></span> resin_util.jar（这两个的<a href="http://lportal.svn.sourceforge.net/viewvc/lportal/portal/trunk/lib/development/" target="_self">下载页面</a>），这三个下载完毕之后放置在 GAE 工程的 “<strong>war/WEB_INF/</strong><strong>lib</strong>” 目录下面并为把 lib 整个目录设置为编译环境（Build Path）。</p>
<p>然后开始 Quercus的参数配置，编辑 “<strong>war/WEB_INF/web.xml</strong>” 文件，在&lt;web-apps&gt;&lt;/web-apps&gt;中间的适当位置加入：</p>
<pre lang="xml">Quercus Servlet
com.caucho.quercus.servlet.QuercusServlet

ini-file
WEB-INF/php.ini

<!-- 其他配置 -->

Quercus Servlet
*.php</pre>
<p>上面的 “<strong>WEB-INF/php.ini</strong>” 是自己创建的文件，并非 PHP 环境下复制过来的哦，留空即可，貌似没有加入这个文件，就无法运行。</p>
<p>另外还需要在  “<strong>WEB-INF/appengine-web.xml</strong>” 加入下面代码：</p>
<p>以上完成之后，就可以进行 PHP 代码的测试了，把你要运行的 php 文件放在  “<strong>WEB-INF</strong>” 目录下面即可。然后通过部署上传就可以看到 php 的完美运行了，本人的测试地址：<a href="http://go-ogle.appspot.com/info.php" target="_self">http://go-ogle.appspot.com/info.php</a></p>
<p>更多使用方法请看 <a href="http://www.caucho.com/resin-3.0/quercus/" target="_self">Quercu</a> 官方网站的相关文档。</p>
<p>附图（图片来自<a href="http://brian.brispace.net/2009/04/09/php-on-google-app-engine/" target="_self">Brian’s World</a>，如果失效，请下载下面的整个工程查看）：<br />
<img src="http://brian.brispace.net/wp-content/uploads/2009/04/picture-1.png" alt="php on gae" /></p>
<p><img src="http://brian.brispace.net/wp-content/uploads/2009/04/picture-2.png" alt="php on gae" /></p>
<p>整个测试工程下载（包含上面必需的 jar 包和所有配置和测试文件）：<a href="http://www.boxcn.net/shared/mus66snm76" target="_self">下载@Box.net</a></p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2009/04/running-php-on-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>刷票脚本 PHP 版</title>
		<link>http://icyleaf.com/2008/12/grub-ticket-php-version/</link>
		<comments>http://icyleaf.com/2008/12/grub-ticket-php-version/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 07:37:54 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[网络开发]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[刷票]]></category>

		<guid isPermaLink="false">http://icyleaf.com/?p=455</guid>
		<description><![CDATA[有新版本发布，请点击这里：v0.5版本 （2009年1月13日） 新一年的又将慢慢走近，身在外地的你是否对春节买票做好了准备呢？我身处在北京，北京虽说遍地几百号的代售点也承受不了上千万的人口，回家买票确实难得要命，如果最终你没有买到票且必须要回家的话都会去买黄牛票或者在网上寻求富余的票，“喂，我想问你的票&#8230;..啊，已经卖出去了啊，哦，好谢谢&#8230;”，你是否也遇到这样的问题，是不是恨自己晚知道了，而导致别人先把票买走了，不要着急，我也怕这个情况所以写了一个脚本来帮助我完成这样的工作：刷票脚本 当然这里的刷票是刷火车票，呵呵，脚本抓取的信息来自酷讯网，特意写成了一个类，以下是相关的参数和使用方法： /** * grubTicket Class * @param (string) $from: 出发地 * @param (string) $id: 到达地（也可以是车次） * @param (string/array) $date: 车次时间，格式：(M)M-DD */ $from = '北京'; $tid = 'T61'; $date = '12-4'; // 或者 // $date = array('12-5', '12-6'); &#8230; <a href="http://icyleaf.com/2008/12/grub-ticket-php-version/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="买火车票" src="http://cimg2.163.com/cnews/2007/1/30/20070130162641cb662.jpg" alt="" width="500" height="307" /></p>
<blockquote><p>有新版本发布，请点击这里：<a href="http://icyleaf.com/2009/01/13/grub-ticket-php-version-05/" target="_self">v0.5版本</a> （2009年1月13日）</p></blockquote>
<p>新一年的又将慢慢走近，身在外地的你是否对春节买票做好了准备呢？我身处在北京，北京虽说遍地几百号的代售点也承受不了上千万的人口，回家买票确实难得要命，如果最终你没有买到票且必须要回家的话都会去买黄牛票或者在网上寻求富余的票，“喂，我想问你的票&#8230;..啊，已经卖出去了啊，哦，好谢谢&#8230;”，你是否也遇到这样的问题，是不是恨自己晚知道了，而导致别人先把票买走了，不要着急，我也怕这个情况所以写了一个脚本来帮助我完成这样的工作：<strong>刷票脚本</strong><br />
<span id="more-455"></span><br />
当然这里的刷票是刷火车票，呵呵，脚本抓取的信息来自<a href="http://piao.kuxun.cn" target="_self">酷讯网</a>，特意写成了一个类，以下是相关的参数和使用方法：</p>
<pre lang="php">/**
 * grubTicket Class
 * @param (string) $from: 出发地
 * @param (string) $id: 到达地（也可以是车次）
 * @param (string/array) $date: 车次时间，格式：(M)M-DD
 */

$from = '北京';
$tid = 'T61';
$date = '12-4';
// 或者
// $date = array('12-5', '12-6');

// 实例化
$gt = new grubTicket($from, $tid, $date);
// 设置匹配到后通知 email 地址
$gt->setMail('icyleaf.cn@gmail.com', '最新车票信息');
// 开始抓取
$gt->grub();</pre>
<p><strong>需要解决的问题</strong>：<br />
1. 此类没有定时刷新的功能，所以大家在使用的过程中需要配合js添加一个刷新的功能或者使用 meta 标签刷新：</p>
<pre lang="php"> <!-- 30秒 --></pre>
<p>2. 此类使用了一个发邮件的功能，这个需要 PHP 开启 mail 函数并设置相关设置。<br />
3. 必须一直开着网页才可以执行&#8230;有谁知道如何后台运行&#8230;</p>
<p>个人能力有限，也只能做成这个样子，希望可以解决的朋友能跟我交流一下，想要尝试的朋友请下载：[download id="3"]</p>
<blockquote><p>有新版本发布，请点击这里：<a href="http://icyleaf.com/2009/01/13/grub-ticket-php-version-05/" target="_self">v0.5版本</a> （2009年1月13日）</p></blockquote>
<p>希望能给回家买票的朋友一些帮助，呵呵</p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/12/grub-ticket-php-version/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP In Google App Engine?</title>
		<link>http://icyleaf.com/2008/10/php-in-google-app-engine/</link>
		<comments>http://icyleaf.com/2008/10/php-in-google-app-engine/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 01:48:38 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[网络开发]]></category>
		<category><![CDATA[App Engine]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://icyleaf.com/?p=420</guid>
		<description><![CDATA[文章来源：PHP In Google App Engine? 通过 App Engine Product Roadmap 最新发布的日志来看，它将会添加一种新的支持语言，在 Google Apps Small Business Solution Providers 的电子邮箱里这样说过： 特别令人感兴趣的，或许会添加一个新的运行语言来使用。但我不能说这个语言是什么，不过如果你们看过社区的发布的需求你们应该可以猜到是哪种语言。 下面让我们看看需求列表，Java 的需求量远远高于 PHP，Perl，Ruby。如果你没有申请，那么请给 “support for PHP” 添加一个星星投上一票（请不要在里面添加评论，这里会导致所有添加投票的用户均会受到一封 email 通知提示）。当然，我也希望 Zend Framework 作为选择框架并对所有的 App Engine 的 APIs 很好的支持。 == EOF == 无论最后 &#8230; <a href="http://icyleaf.com/2008/10/php-in-google-app-engine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>文章来源：<a href="http://bradley-holt.blogspot.com/2008/10/php-in-google-app-engine.html">PHP In Google App Engine?</a></p>
<p>通过 <a href="http://code.google.com/appengine/docs/roadmap.html">App Engine Product Roadmap</a> 最新发布的日志来看，它将会添加一种新的支持语言，在 Google Apps Small Business Solution Providers 的电子邮箱里这样说过：</p>
<blockquote><p>特别令人感兴趣的，或许会添加一个新的运行语言来使用。但我不能说这个语言是什么，不过如果你们看过社区的发布的需求你们应该可以猜到是哪种语言。</p></blockquote>
<p>下面让我们看看<a href="http://code.google.com/p/googleappengine/issues/list" target="_self">需求列表</a>，Java 的需求量远远高于 PHP，Perl，Ruby。如果你没有申请，那么请给 “<a href="http://code.google.com/p/googleappengine/issues/detail?id=13">support for PHP</a>” 添加一个星星投上一票（请不要在里面添加评论，这里会导致所有添加投票的用户均会受到一封 email 通知提示）。当然，我也希望 Zend Framework 作为选择框架并对所有的 App Engine 的 APIs 很好的支持。</p>
<p>== EOF ==</p>
<p>无论最后 App Engine 添加的是哪种新的语言，如果你喜欢 PHP，不妨也去投上一票，说不定那一天真的支持的就是 PHP了</p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/10/php-in-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Devunity：随心所欲在线编程</title>
		<link>http://icyleaf.com/2008/10/devunity-way-online-programming/</link>
		<comments>http://icyleaf.com/2008/10/devunity-way-online-programming/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 03:53:48 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[Webware]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://icyleaf.com/?p=388</guid>
		<description><![CDATA[Devunity 是一个极具创意性的在线编程服务网站，使用它就像是在使用系统的文本编辑器一样，支php，Python，Javascript，Perl，Html，Asp，Css，Ruby语言语法高亮，行数显示，支持 Tags。最大的特性还属创建项目，从SVN服务导入代码，支持多种服务的API（如 Twitter，Flickr，BOSS，Google Apps Engine,，Digg，Facebook等等）接口编程到团队协作，添加 Todos。 Devunity 是TechCrunch 最新评出来的 TC50 之一。目前这个服务还属于开发当作，之前只是申请才能获得邀请，过了一个10.1终于给了邀请，碰巧通过内测用户邀请是可以直接申请到用户，所以，如果你想尝试一下，留下你的 Email 地址吧:)]]></description>
			<content:encoded><![CDATA[<p><img style="border: none;" title="Devunity" usemap="#map_fixf94x5" src="http://kwout.com/cutout/f/ix/f9/4x5_bor_rou_sha.jpg" alt="http://www.devunity.com/user" width="508" height="284" /></p>
<p><a href="http://www.devunity.com/" target="_self">Devunity</a> 是一个极具创意性的在线编程服务网站，使用它就像是在使用系统的文本编辑器一样，支php，Python，Javascript，Perl，Html，Asp，Css，Ruby语言语法高亮，行数显示，支持 Tags。最大的特性还属创建项目，从SVN服务导入代码，支持多种服务的API（如 Twitter，Flickr，BOSS，Google Apps Engine,，Digg，Facebook等等）接口编程到团队协作，添加 Todos。</p>
<p><a href="http://www.devunity.com/" target="_self">Devunity</a> 是<a class="entry-source-title" href="http://www.google.com/reader/view/feed/http%3A%2F%2Ffeeds.feedburner.com%2FTechCrunch" target="_blank">TechCrunch</a> 最新评出来的 <a href="http://www.techcrunch.com/2008/09/08/announcing-the-techcrunch50-finalists/" target="_self">TC50</a> 之一。目前这个服务还属于开发当作，之前只是申请才能获得邀请，过了一个10.1终于给了邀请，碰巧通过内测用户邀请是可以直接申请到用户，所以，如果你想尝试一下，留下你的 Email 地址吧:)</p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/10/devunity-way-online-programming/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>如何使用PHP代码SEO你的URL</title>
		<link>http://icyleaf.com/2008/07/seo-friendly-url-in-php/</link>
		<comments>http://icyleaf.com/2008/07/seo-friendly-url-in-php/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 03:58:56 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[网络开发]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.icyleaf.cn/?p=225</guid>
		<description><![CDATA[原文翻译自：The html blog SEO是一个永恒的话题，今天我就发现了一篇关于如何使用PHP代码SEO你的URL的文章，其实内容很简单，最重要的也不需要确定你的空间提供商是否提供 mod_rewrite 模块，此文中提到： 大部分的教程都是关于如何使用 mod_rewrite 模块再配合.htaccess的内容达到SEO URL的效果，却很少人从动态的内容上优化URL。比如说，我现在从数据库提取出来一篇文章，那么改怎样把标题优化为URL？ 再举个例子，我想把标题“Welcome to Beijing 2008 Olympic Games”优化为“welcome-to-beijing-2008-olympic-games”，甚至是把法语“Guantanamo: le chauffeur de Ben Laden plaide non coupable à l&#8217;ouverture de son procès”优化为&#8221;guantanamo-le-chauffeur-de-ben-laden-plaide-non-coupable-a-l-ouverture-de-son-proces.html&#8221;，转换后的字母除去了法语所有的特殊符号。 我把自己实现的方法共享出来，希望对大家有所帮助： function friendlyURL($string){ $string = preg_replace("`\[.*\]`U","",$string); $string = preg_replace('`&#38;(amp;)?#?[a-z0-9]+;`i','-',$string); $string = &#8230; <a href="http://icyleaf.com/2008/07/seo-friendly-url-in-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://farm1.static.flickr.com/253/516400565_132600bf8a_o.gif" alt="SEO friendly" /></p>
<p>原文翻译自：<a href="http://htmlblog.net/" target="_blank">The html blog</a></p>
<p>SEO是一个永恒的话题，今天我就发现了一篇关于如何使用PHP代码SEO你的URL的文章，其实内容很简单，最重要的也不需要确定你的空间提供商是否提供 <a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" target="_blank">mod_rewrite</a> 模块，此文中提到：</p>
<p>大部分的教程都是关于如何使用 mod_rewrite 模块再配合.htaccess的内容达到SEO URL的效果，却很少人从动态的内容上优化URL。比如说，我现在从数据库提取出来一篇文章，那么改怎样把标题优化为URL？</p>
<p><span id="more-225"></span>再举个例子，我想把标题“Welcome to Beijing 2008 Olympic Games”优化为“welcome-to-beijing-2008-olympic-games”，甚至是把法语“Guantanamo: le chauffeur de Ben Laden plaide non coupable à l&#8217;ouverture de son procès”优化为&#8221;guantanamo-le-chauffeur-de-ben-laden-plaide-non-coupable-a-l-ouverture-de-son-proces.html&#8221;，转换后的字母除去了法语所有的特殊符号。</p>
<p>我把自己实现的方法共享出来，希望对大家有所帮助：</p>
<pre lang="php" line="1" colla="+">
function friendlyURL($string){
$string = preg_replace("`\[.*\]`U","",$string);
$string = preg_replace('`&amp;(amp;)?#?[a-z0-9]+;`i','-',$string);
$string = htmlentities($string, ENT_COMPAT, 'utf-8');
$string = preg_replace( "`&amp;([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);`i","\\1", $string );
$string = preg_replace( array("`[^a-z0-9]`i","`[-]+`") , "-", $string);
return strtolower(trim($string, '-'));
}
</pre>
<p>使用方法：</p>
<pre lang="php" line="1" colla="+">
$myFriendlyURL = friendlyURL("Welcome to Beijing 2008 Olympic Games");
echo $myFriendlyURL;   // 将会输出“welcome-to-beijing-2008-olympic-games"
</pre>
<p>你可以转换任何的输入的字符串(当然这个是对于西方人说的，汉语肯定是不行的)，对于法语的朋友，仅需要确保您的UTF-8编码即可，否则它将无法运行。</p>
<p>如果你使用的是 <a href="http://smarty.php.net/" target="_blank">Smarty</a> 模板，大家可以现在我做的一个小的插件，下载后解压放在Smarty/libs/plugins/文件夹下，使用方法：</p>
<pre colla="+">
{"Welcome to Beijing 2008 Olympic Games" | friendlyURL}
//或者设置变量
{$yourString | friendlyURL}
</pre>
<p>翻译到此结束，谢谢大家观看，翻译结束但下面还有话要说，说真的这个方法真的是非常的棒！也许有人会说可惜就是不支持中文，正好引出我要说的东西，我根据以上的代码以及<a href="http://www.storyday.com/" target="_blank"><strong>生活点滴</strong></a>的<strong>cosbeta</strong>所写的<a href="http://www.storyday.com/html/y2007/1202_auto-slug-translate-plugin.html" target="_blank">cos_slug_translator</a>插件的核心代码修改了一番，现在支持了中文，但不仅仅是中文哦，根据Google translate的功能，可以自动识别输入的语言（我测试过简体中文，繁体中文，日文和韩语均通过测试）。<br />
在线测试：<a href="http://labs.icyleaf.cn/tools/friendlyurl/index.php" target="_blank">Demo</a> | <a href="http://www.icyleaf.cn/labs/tools/friendlyurl/friendlyurl.zip">Download</a></p>
<p>核心代码分两个部分，一个是上面的friendlyURL()，另外一个是translate()，translate()函数中有两个参数：字符串和翻译的语言种类，目前可以输入&#8221;chinese&#8221;和&#8221;japanese&#8221;，同样也可以忽略掉第二个参数，默认为空，直接为检测自动翻译:)</p>
<p>还有什么不明白的可以留言给我，我会尽力解答，希望对大家有所帮助。</p>
<p><strong>update 1</strong>：那天糊涂了，错误连篇，十分感谢枫叶大哥的提醒- -!<br />
<strong>update 2</strong>：为CodeIgniter做了一个Helper函数，有用到CI框架的可以使用下，下载的文件里包含样例（使用方法）：下载<a href="http://www.icyleaf.cn/labs/tools/friendlyurl/ci_seo_url.zip">SEO_URL4CI</a></p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/07/seo-friendly-url-in-php/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>推荐5个最棒的Firebug扩展</title>
		<link>http://icyleaf.com/2008/07/the-5-best-firebug-extensions/</link>
		<comments>http://icyleaf.com/2008/07/the-5-best-firebug-extensions/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 02:53:30 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[网络开发]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[FireFox-Plugins]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.icyleaf.cn/?p=218</guid>
		<description><![CDATA[原文翻译自：The 5 Best Firebug Extensions 众所周知，Firefox浏览器外加Firebug插件是互联网开发的最佳平台和调试工具。与此同时，Firebug最人性化的地方还是可以再做插件扩展，下面将介绍的是WebMonkey推荐的5款最棒的Firebug扩展。（安装下面插件的之前必须先安装Firebug插件） 1. YSlow YSlow（why slow）是由Yahoo开发者团队发布的一款基于Firebug的插件，插件遵循雅虎10条网站开发的军规评测网页效率。这里推荐一篇文章《如何提高网页的效率（下篇）——Use YSlow to know why your web Slow》。 2. Firecookie Firecookie可以随时查看当前网页的所有变化的Cookies信息，同时还可以从firebug的面板设置是否接受或拒绝cookies信息，同时配合Firefox3的页面信息功能使用效果尤佳。Web Developer插件也有类似的功能。 3. FirePHP FirePHP的PHP调试信息都是通过在HTTP头里面添加“X-FirePHP-Data”信息串来标识，不会直接输出到页面上，这样也就避免对php正常输出产生影响。不过调试的时候需要加载一个FirePHP的库文件。如何使用大家可以参加这篇文章：《Debugging PHP with Firebug and FirePHP》这个也是我今天才找到的，里面的英文不是很难懂。 4. Pixel Perfect Pixel Perfect是专门为做设计的朋友准备，经过我的测试明白了它的用途，它可以添加图片到当前的页面上面，同时可以调整图片的透明度和位置，以方便调试网站的设计，我想光凭我说还是很难明白，大家看下官方的视频演示吧。 5. Rainbow Rainbow是一款使得JavaScript语法高亮的插件，因此此插件被命名为彩虹（Rainbow），默认的Javascript变量是绿色，保留字是蓝色，当然如果你不喜欢，你还可以随时更改，通过官方的颜色库可以改变，不过目前只有4种配色。 如果你对Firebug的插件有兴趣的话，可以参见Jan Odvarko列出来的Friebug的插件清单。当然，您也可以自己编写FIrebug插件。]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.webmonkey.com/blog/The_5_Best_Firebug_Extensions" target="_blank"></a><img src="http://blog.iyi.cn/start/2007/04/30/391953301_2101c534f2.jpg" alt="firebug" /><br />
原文翻译自：<a href="http://www.webmonkey.com/blog/The_5_Best_Firebug_Extensions" target="_blank">The 5 Best Firebug Extensions</a></p>
<p>众所周知，Firefox浏览器外加Firebug插件是互联网开发的最佳平台和调试工具。与此同时，Firebug最人性化的地方还是可以再做插件扩展，下面将介绍的是<a href="http://www.webmonkey.com" target="_blank">WebMonkey</a>推荐的5款最棒的Firebug扩展。（安装下面插件的之前必须先安装<a href="https://addons.mozilla.org/en-US/firefox/addon/5369" target="_self">Firebug</a>插件）<span id="more-218"></span></p>
<p><strong>1. </strong><strong><a href="http://developer.yahoo.com/yslow/" target="_blank">YSlow</a></strong><br />
<img src="http://us.i1.yimg.com/us.yimg.com/i/rt/yslow/perfview.png" alt="yslow" width="500" height="300" /></p>
<p>YSlow（why slow）是由<a title="Yahoo开发者团队" href="http://developer.yahoo.com/" target="_blank">Yahoo开发者团队</a>发布的一款基于Firebug的插件，插件遵循雅虎<a href="http://developer.yahoo.com/performance/index.html#rules" target="_self">10条网站开发的军规</a>评测网页效率。这里推荐一篇文章《<a href="http://www.cnblogs.com/JustinYoung/archive/2007/11/28/speeding-up-web-site-yslow.html" target="_blank">如何提高网页的效率（下篇）——Use YSlow to know why your web Slow</a>》。</p>
<p><strong>2. <a href="https://addons.mozilla.org/en-US/firefox/addon/6683" target="_blank">Firecookie</a></strong><br />
<img class="full" src="http://howto.wired.com/mediawiki/images/Firecookie.png" alt="Firecookie shows list of cookies in Firebug" width="500" height="128" /></p>
<p>Firecookie可以随时查看当前网页的所有变化的Cookies信息，同时还可以从firebug的面板设置是否接受或拒绝cookies信息，同时配合Firefox3的页面信息功能使用效果尤佳。<a href="https://addons.mozilla.org/firefox/addon/60" target="_self">Web Developer</a>插件也有类似的功能。</p>
<p><strong>3. <a href="https://addons.mozilla.org/en-US/firefox/addon/6149" target="_blank">FirePHP</a></strong><br />
<img class="full" src="http://howto.wired.com/mediawiki/images/Firephp.png" alt="FirePHP: PHP debugging in Firebug" /></p>
<p>FirePHP的PHP调试信息都是通过在HTTP头里面添加“X-FirePHP-Data”信息串来标识，不会直接输出到页面上，这样也就避免对php正常输出产生影响。不过调试的时候需要加载一个FirePHP的库文件。如何使用大家可以参加这篇文章：《<a title="Permanent Link: Debugging PHP with Firebug and FirePHP" href="http://www.developertutorials.com/blog/php/debugging-php-with-firebug-and-firephp-365/" target="_blank">Debugging PHP with Firebug and FirePHP</a>》这个也是我今天才找到的，里面的英文不是很难懂。</p>
<p><strong>4. <a href="https://addons.mozilla.org/en-US/firefox/addon/7943" target="_blank">Pixel Perfect</a></strong><br />
<img class="full" src="http://howto.wired.com/mediawiki/images/Pixelperfect.png" alt="Pixel Perfect help you be just that" /></p>
<p>Pixel Perfect是专门为做设计的朋友准备，经过我的测试明白了它的用途，它可以添加图片到当前的页面上面，同时可以调整图片的透明度和位置，以方便调试网站的设计，我想光凭我说还是很难明白，大家看下官方的<a href="http://www.pixelperfectplugin.com/" target="_blank">视频演示</a>吧。</p>
<p><strong>5. Rainbow</strong><br />
<img class="full" src="http://howto.wired.com/mediawiki/images/Rainbox-firebug.png" alt="Rainbow adds colors to your code" /></p>
<p>Rainbow是一款使得JavaScript语法高亮的插件，因此此插件被命名为彩虹（Rainbow），默认的Javascript变量是绿色，保留字是蓝色，当然如果你不喜欢，你还可以随时更改，通过官方的<a href="http://xrefresh.com/presets" target="_blank">颜色库</a>可以改变，不过目前只有4种配色。</p>
<p>如果你对Firebug的插件有兴趣的话，可以参见Jan Odvarko列出来的Friebug的<a href="http://www.softwareishard.com/blog/firebug/list-of-firebug-extensions/" target="_blank">插件清单</a>。当然，您也可以<a href="http://www.webmonkey.com/blog/How_to_Create_a_Firebug_Extension" target="_blank">自己编写FIrebug插件</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/07/the-5-best-firebug-extensions/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>UNA Editor：跨平台的实时协作开发编辑器</title>
		<link>http://icyleaf.com/2008/07/una-editor-cross-platform-development-of-real-time-collaboration-editor/</link>
		<comments>http://icyleaf.com/2008/07/una-editor-cross-platform-development-of-real-time-collaboration-editor/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 04:10:21 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[UNA]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[文本编辑器]]></category>

		<guid isPermaLink="false">http://www.icyleaf.cn/?p=213</guid>
		<description><![CDATA[N-Brain前不久发布了一款多平台（Windows/Linux/Mac）的编辑器软件：UNA Editor，外观有些类似于IDE，和Komodo Edit有些类似，体积适中比Komodo Edit大些，它不仅支持目前大多数语言的代码高亮，以及Komodo Edit等大多数文本编辑器的功能，它最大的功能是实时协作开发，这个和新发布的Eclipse3.4的结对功能差不多，不过Eclipse还是仅限于Java为主而且体积也较为庞大。对于非Java的开发者来说团队开发UNA Editor是一个不错的选择，而且它的制定性也很强，可以随意配置工具。如下图所示可以证明我说的不是夸夸其谈哦。（点击放大） 官方还提供了说明性的截图，以及还有专门录制的介绍性视频。最重要的目前此软件对于个人来说是免费的，大家下载的时候注意下载Personal Edition。 如果你是PHP开发者，可以参阅下面的视频，5分钟掌握UNA的PHP配置（视频片源） UNA &#38; PHP in 5 Minutes from N-BRAIN, Inc. on Vimeo.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.n-brain.net/" target="_blank">N-Brain</a>前不久发布了一款多平台（Windows/Linux/Mac）的编辑器软件：UNA Editor，外观有些类似于IDE，和<a href="http://www.icyleaf.cn/2008/03/11/komodo-edit-lightweight-cross-platform-free-editor/" target="_blank">Komodo Edit</a>有些类似，体积适中比Komodo Edit大些，它不仅支持目前大多数语言的代码高亮，以及Komodo Edit等大多数文本编辑器的功能，它最大的功能是实时协作开发，这个和新发布的Eclipse3.4的结对功能差不多，不过Eclipse还是仅限于Java为主而且体积也较为庞大。对于非Java的开发者来说团队开发UNA Editor是一个不错的选择，而且它的制定性也很强，可以随意配置工具。如下图所示可以证明我说的不是夸夸其谈哦。（点击放大）<br />
<a href="http://www.n-brain.net/assets/screenshots/una-screenshot.png" target="_blank"><img src="http://www.n-brain.net/assets/screenshots/una-screenshot.png" alt="" width="500" height="300" /></a></p>
<p><span id="more-213"></span>官方还提供了<a href="http://www.n-brain.net/features.htm" target="_blank">说明性的截图</a>，以及还有专门录制的<a href="http://www.n-brain.net/tour.htm" target="_blank">介绍性视频</a>。最重要的目前此软件对于个人来说是免费的，大家下载的时候注意下载Personal Edition。</p>
<p>如果你是PHP开发者，可以参阅下面的视频，5分钟掌握UNA的PHP配置（<a href="http://www.vimeo.com/1221238" target="_blank">视频片源</a>）<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="225" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.vimeo.com/moogaloop.swf?clip_id=1221238&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="225" src="http://www.vimeo.com/moogaloop.swf?clip_id=1221238&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<a href="http://www.vimeo.com/1221238?pg=embed&amp;sec=1221238">UNA &amp; PHP in 5 Minutes</a> from <a href="http://www.vimeo.com/user556779?pg=embed&amp;sec=1221238">N-BRAIN, Inc.</a> on <a href="http://vimeo.com?pg=embed&amp;sec=1221238">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/07/una-editor-cross-platform-development-of-real-time-collaboration-editor/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

