<?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>Becomin&#039; Charles &#187; 工作相关</title>
	<atom:link href="http://sexywp.com/cata/something-about-daily-work/feed" rel="self" type="application/rss+xml" />
	<link>http://sexywp.com</link>
	<description>Building another myself~~</description>
	<lastBuildDate>Fri, 27 Jan 2012 16:00:02 +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>Yii框架base包代码分析</title>
		<link>http://sexywp.com/yii-package-base-source-code-analysis.htm</link>
		<comments>http://sexywp.com/yii-package-base-source-code-analysis.htm#comments</comments>
		<pubDate>Sun, 20 Nov 2011 13:46:32 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Yii]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[code reading]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=466</guid>
		<description><![CDATA[周日闲来无事，打开Yii的源代码学习一下，今天主要看的代码都是base包里面的，也就是框架根目录下的base目录里的代码。这个目录里的代码不多，但是类很多，而且这些类对整个框架来说至关重要，都是非常基本的组件。老实说，这里面的代码，我已经看了无数次了，但是总觉得常看常新，转念一想，这也实属正常，毕竟这是原作者数年框架开发经验的结晶，岂是我这等工作一两年的菜鸟能随便吃透的？

最近又玩了两次Visual Paradigm这个软件，觉得自己操作水平又有进步，甚感欣喜，所以今天既然分析源代码，就正好再练练手，于是乎，我开始用VP UML开始画base包里的类，得图如下。（说明：这个图是基于Yii的1.1.8版本，另外这里面少了两个类，因为这两个类的功能比较特殊，我没有细看，所以也就没有画在图里，看后面是不是有兴致再来专门画一张，缺失的两个类是CSecurityManager和CStatePersister。）

<span class="readmore"><a href="http://sexywp.com/yii-package-base-source-code-analysis.htm" title="Yii框架base包代码分析">Keep Reading --- 2459 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架中验证器的allowEmpty属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Gii时出现403错误" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Gii时出现403错误</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>周日闲来无事，打开Yii的源代码学习一下，今天主要看的代码都是base包里面的，也就是框架根目录下的base目录里的代码。这个目录里的代码不多，但是类很多，而且这些类对整个框架来说至关重要，都是非常基本的组件。老实说，这里面的代码，我已经看了无数次了，但是总觉得常看常新，转念一想，这也实属正常，毕竟这是原作者数年框架开发经验的结晶，岂是我这等工作一两年的菜鸟能随便吃透的？</p>
<p>最近又玩了两次Visual Paradigm这个软件，觉得自己操作水平又有进步，甚感欣喜，所以今天既然分析源代码，就正好再练练手，于是乎，我开始用VP UML开始画base包里的类，得图如下。（说明：这个图是基于Yii的1.1.8版本，另外这里面少了两个类，因为这两个类的功能比较特殊，我没有细看，所以也就没有画在图里，看后面是不是有兴致再来专门画一张，缺失的两个类是CSecurityManager和CStatePersister。）<span id="more-466"></span></p>
<p><a href="https://picasaweb.google.com/lh/photo/zJ2ZqfcpDfOnu9JobQXA6w?feat=embedwebsite"><img src="https://lh5.googleusercontent.com/-SduLV1_OW1Y/Tsi7h2YNRcI/AAAAAAAAB7U/jSpUIlrODGg/s640/YiiFramework-base.png" height="640" width="545" /></a></p>
<p>从这个图里各个类占的面积里，我们不难看出，最重要的类有四个，CComponent，CModule，CApplication，CModel。事实上，这四个类也贯穿着Yii框架应用开发过程的始终，扮演着至关重要的角色。然而，如果你真的用Yii开发应用，可能一个应用做完了，却又没怎么见过这四个类的踪影，因为他们太基础了，始终处在水面之下，使得你可能根本就忽视了它们的存在。下面，我就一个一个来简单说一下我的学习心得。</p>
<p>CComponent类，是整个Yii框架组件模型的基础，Yii框架内几乎所有的对象都是组件，其基类都是CComponent。细看其方法，我们发现基本上可以归类为三种，一是魔术方法，就是一些双下划线开头的方法，一是跟Behavior有关的方法，最后是跟Event有关的方法。这也就引出了组件的三大主要特性。属性成员，事件驱动和行为。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架中验证器的allowEmpty属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Gii时出现403错误" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Gii时出现403错误</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/analytics" title="analytics" rel="tag">analytics</a>, <a href="http://sexywp.com/tags/code-reading" title="code reading" rel="tag">code reading</a>, <a href="http://sexywp.com/tags/framework" title="framework" rel="tag">framework</a>, <a href="http://sexywp.com/tags/source-code" title="source code" rel="tag">source code</a>, <a href="http://sexywp.com/tags/yii-2" title="yii" rel="tag">yii</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/yii-package-base-source-code-analysis.htm/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>怎么觉得Python这么混乱呢</title>
		<link>http://sexywp.com/why-python-code-mess.htm</link>
		<comments>http://sexywp.com/why-python-code-mess.htm#comments</comments>
		<pubDate>Mon, 03 Oct 2011 16:49:09 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=461</guid>
		<description><![CDATA[开始学习写Python，写了一两个小脚本后，就产生了非常奇怪的感觉，我怎么觉得Python看着这么混乱呢？

一个是没有大括号了，代码那种段落感没了，第二个是没有分号了，觉得一行总是没完似的。靠缩进来流程控制，觉得非常难受，总是习惯性地搞不清楚一个if和一个for的结束在什么地方，为啥不像pascal和VB那样，加个关闭之类的东西，也让人看着舒服点。代码说完，再说说文档，去官网查文档，感觉那文档视觉效果跟代码一样，没有括号，分号这样分块，断句的地方。那文档就是秘密麻麻一片，从上到下，页面长长的一串，而且还太宽，连个索引也没有，还得不停地ctrl+F来找函数。排版也忒鹾了吧？

<span class="readmore"><a href="http://sexywp.com/why-python-code-mess.htm" title="怎么觉得Python这么混乱呢">Keep Reading --- 296 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fwhy-python-code-mess.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm&from=http%3A%2F%2Fsexywp.com%2Fwhy-python-code-mess.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mac OS X上如何实现到Linux主机的ssh免登陆</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fwhy-python-code-mess.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-install-phpunit-on-debian.htm&from=http%3A%2F%2Fsexywp.com%2Fwhy-python-code-mess.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">如何在Debian上安装PHPUnit</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm&from=http%3A%2F%2Fsexywp.com%2Fwhy-python-code-mess.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">20101103 今天犯了好几个严重低级错误</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>开始学习写Python，写了一两个小脚本后，就产生了非常奇怪的感觉，我怎么觉得Python看着这么混乱呢？</p>
<p>一个是没有大括号了，代码那种段落感没了，第二个是没有分号了，觉得一行总是没完似的。靠缩进来流程控制，觉得非常难受，总是习惯性地搞不清楚一个if和一个for的结束在什么地方，为啥不像pascal和VB那样，加个关闭之类的东西，也让人看着舒服点。代码说完，再说说文档，去官网查文档，感觉那文档视觉效果跟代码一样，没有括号，分号这样分块，断句的地方。那文档就是秘密麻麻一片，从上到下，页面长长的一串，而且还太宽，连个索引也没有，还得不停地ctrl+F来找函数。排版也忒鹾了吧？</p>
<p>目前都还只是视觉上的别扭吧。估计Python的粉要来嘲我了。再往后学学吧～</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fwhy-python-code-mess.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm&from=http%3A%2F%2Fsexywp.com%2Fwhy-python-code-mess.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mac OS X上如何实现到Linux主机的ssh免登陆</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fwhy-python-code-mess.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-install-phpunit-on-debian.htm&from=http%3A%2F%2Fsexywp.com%2Fwhy-python-code-mess.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">如何在Debian上安装PHPUnit</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm&from=http%3A%2F%2Fsexywp.com%2Fwhy-python-code-mess.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">20101103 今天犯了好几个严重低级错误</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/linux" title="Linux" rel="tag">Linux</a>, <a href="http://sexywp.com/tags/python" title="python" rel="tag">python</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/why-python-code-mess.htm/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>如何配置RHEL的iptables开放端口</title>
		<link>http://sexywp.com/%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%aerhel%e7%9a%84iptables%e5%bc%80%e6%94%be%e7%ab%af%e5%8f%a3.htm</link>
		<comments>http://sexywp.com/%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%aerhel%e7%9a%84iptables%e5%bc%80%e6%94%be%e7%ab%af%e5%8f%a3.htm#comments</comments>
		<pubDate>Sun, 02 Oct 2011 03:53:47 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[rhel]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=460</guid>
		<description><![CDATA[要给一个朋友的服务器上架设ftp，一看，这哥们的服务器装的是RHEL AS4，看到这个发行版的名字，我就发怵了，果不其然，么有包管理器，我简直寸步难行，什么软件都没法装，各种依赖，太难解决了！！

看了一下已经安装的软件列表，发现已经装了vsftpd，就用这个吧，man了半天，最后配好了，但是一连，发现死活连不上，百思不得其解，各种google，各种百度，也不知道过了多少天，才发现问题的症结在iptables，原来，要使用passive mode登陆ftp，必须开一个范围的端口，而系统默认的iptables规则，不允许对这些端口的访问，导致ftp连不上。怎么开放iptables的端口呢？又是各种google，各种百度，搜到一个iptables的tutorial，竟然有290页之厚，太难用了。

<span class="readmore"><a href="http://sexywp.com/%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%aerhel%e7%9a%84iptables%e5%bc%80%e6%94%be%e7%ab%af%e5%8f%a3.htm" title="如何配置RHEL的iptables开放端口">Keep Reading --- 568 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2F%25E5%25A6%2582%25E4%25BD%2595%25E9%2585%258D%25E7%25BD%25AErhel%25E7%259A%2584iptables%25E5%25BC%2580%25E6%2594%25BE%25E7%25AB%25AF%25E5%258F%25A3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm&from=http%3A%2F%2Fsexywp.com%2F%25E5%25A6%2582%25E4%25BD%2595%25E9%2585%258D%25E7%25BD%25AErhel%25E7%259A%2584iptables%25E5%25BC%2580%25E6%2594%25BE%25E7%25AB%25AF%25E5%258F%25A3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mac OS X上如何实现到Linux主机的ssh免登陆</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm&from=http%3A%2F%2Fsexywp.com%2F%25E5%25A6%2582%25E4%25BD%2595%25E9%2585%258D%25E7%25BD%25AErhel%25E7%259A%2584iptables%25E5%25BC%2580%25E6%2594%25BE%25E7%25AB%25AF%25E5%258F%25A3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[WP开发环境]在NetBeans中配置FTP</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2F%25E5%25A6%2582%25E4%25BD%2595%25E9%2585%258D%25E7%25BD%25AErhel%25E7%259A%2584iptables%25E5%25BC%2580%25E6%2594%25BE%25E7%25AB%25AF%25E5%258F%25A3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwhy-python-code-mess.htm&from=http%3A%2F%2Fsexywp.com%2F%25E5%25A6%2582%25E4%25BD%2595%25E9%2585%258D%25E7%25BD%25AErhel%25E7%259A%2584iptables%25E5%25BC%2580%25E6%2594%25BE%25E7%25AB%25AF%25E5%258F%25A3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">怎么觉得Python这么混乱呢</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>要给一个朋友的服务器上架设ftp，一看，这哥们的服务器装的是RHEL AS4，看到这个发行版的名字，我就发怵了，果不其然，么有包管理器，我简直寸步难行，什么软件都没法装，各种依赖，太难解决了！！</p>
<p>看了一下已经安装的软件列表，发现已经装了vsftpd，就用这个吧，man了半天，最后配好了，但是一连，发现死活连不上，百思不得其解，各种google，各种百度，也不知道过了多少天，才发现问题的症结在iptables，原来，要使用passive mode登陆ftp，必须开一个范围的端口，而系统默认的iptables规则，不允许对这些端口的访问，导致ftp连不上。怎么开放iptables的端口呢？又是各种google，各种百度，搜到一个iptables的tutorial，竟然有290页之厚，太难用了。</p>
<p>几经周折又找到了一个图形化系统界面可以配置防火墙规则的，system-config-securitylevel-tui，通过这个东西，很容易就可以开放一个端口，但是这个东西也有问题，我要开10000号段的端口100个，就麻烦了，虽然网上说，用格式形如10000-10100:tcp这样的写法可以开放一个系列的端口，但是实际上，这么写是不管事的，也不知道是不是软件的版本的问题。</p>
<p>最后，知道这个ui界面生成的规则被写到了/etc/sysconfig/iptables文件里面，然后又看了一下man，研究了一下如果手动配置规则的话，端口范围的写法（--dport 10000:10100），先用ui工具生成一条一个端口的规则，然后手动改文件，将端口改成范围，一重启，发现终于一切都按照预期的搞定了，真是累死我了。</p>
<p>在RHEL下面，启动，重启，关闭，查询iptables状态的方法：</p>
<p><a href="http://sexywp.com/tags/usage" class="st_tag internal_tag" rel="tag" title="标签 usage 下的日志">Usage</a>: /etc/init.d/<a href="http://sexywp.com/tags/iptables" class="st_tag internal_tag" rel="tag" title="标签 iptables 下的日志">iptables</a> {start|stop|restart|condrestart|status|panic|save}</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2F%25E5%25A6%2582%25E4%25BD%2595%25E9%2585%258D%25E7%25BD%25AErhel%25E7%259A%2584iptables%25E5%25BC%2580%25E6%2594%25BE%25E7%25AB%25AF%25E5%258F%25A3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm&from=http%3A%2F%2Fsexywp.com%2F%25E5%25A6%2582%25E4%25BD%2595%25E9%2585%258D%25E7%25BD%25AErhel%25E7%259A%2584iptables%25E5%25BC%2580%25E6%2594%25BE%25E7%25AB%25AF%25E5%258F%25A3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mac OS X上如何实现到Linux主机的ssh免登陆</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-ftp-in-netbeans.htm&from=http%3A%2F%2Fsexywp.com%2F%25E5%25A6%2582%25E4%25BD%2595%25E9%2585%258D%25E7%25BD%25AErhel%25E7%259A%2584iptables%25E5%25BC%2580%25E6%2594%25BE%25E7%25AB%25AF%25E5%258F%25A3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[WP开发环境]在NetBeans中配置FTP</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2F%25E5%25A6%2582%25E4%25BD%2595%25E9%2585%258D%25E7%25BD%25AErhel%25E7%259A%2584iptables%25E5%25BC%2580%25E6%2594%25BE%25E7%25AB%25AF%25E5%258F%25A3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwhy-python-code-mess.htm&from=http%3A%2F%2Fsexywp.com%2F%25E5%25A6%2582%25E4%25BD%2595%25E9%2585%258D%25E7%25BD%25AErhel%25E7%259A%2584iptables%25E5%25BC%2580%25E6%2594%25BE%25E7%25AB%25AF%25E5%258F%25A3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">怎么觉得Python这么混乱呢</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/ftp" title="ftp" rel="tag">ftp</a>, <a href="http://sexywp.com/tags/iptables" title="iptables" rel="tag">iptables</a>, <a href="http://sexywp.com/tags/linux" title="Linux" rel="tag">Linux</a>, <a href="http://sexywp.com/tags/rhel" title="rhel" rel="tag">rhel</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%aerhel%e7%9a%84iptables%e5%bc%80%e6%94%be%e7%ab%af%e5%8f%a3.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X上如何实现到Linux主机的ssh免登陆</title>
		<link>http://sexywp.com/mac-os-x-ssh-key-pair-login-linux.htm</link>
		<comments>http://sexywp.com/mac-os-x-ssh-key-pair-login-linux.htm#comments</comments>
		<pubDate>Sun, 04 Sep 2011 03:53:53 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[usage]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=458</guid>
		<description><![CDATA[本文要讲的，就是如何简化从Mac登录Linux主机的操作步骤，提高效率。所谓的“免登陆”其实是不存在的，只是说，从验证密码的登录方式，改为公私钥对的登录验证方式。使用后者的方式，每次会由ssh客户端自动发送验证信息，所以就免去了人工输入密码，看起来好像“免登陆”一样。

关于这么做的原理，大家可以自己去Google，关键词是“非对称加密”，“RSA算法”，“基于ssh密钥对的自动登录”，等等，我就不多解释了。我直接说操作步骤吧：



<span class="readmore"><a href="http://sexywp.com/mac-os-x-ssh-key-pair-login-linux.htm" title="Mac OS X上如何实现到Linux主机的ssh免登陆">Keep Reading --- 810 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm&from=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">VIM常用小窍门收集</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fword2007-doesnot-show-pics.htm&from=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips]Word2007中看不到图片</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fcustom-mac-os-x-terminal.htm&from=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使Mac OS X的终端看起来更舒服</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>本文要讲的，就是如何简化从Mac登录Linux主机的操作步骤，提高效率。所谓的“免登陆”其实是不存在的，只是说，从验证密码的登录方式，改为公私钥对的登录验证方式。使用后者的方式，每次会由ssh客户端自动发送验证信息，所以就免去了人工输入密码，看起来好像“免登陆”一样。</p>
<p>关于这么做的原理，大家可以自己去Google，关键词是“非对称加密”，“RSA算法”，“基于ssh密钥对的自动登录”，等等，我就不多解释了。我直接说操作步骤吧：</p>
<ol>
<li>生成密钥对</li>
<li>用密码登录远程主机，将公钥拷贝过去</li>
<li>done</li>
</ol>
<p>怎么样，无敌简单吧？</p>
<h2>生成密钥对</h2>
<p>执行命令 <a href="http://sexywp.com/tags/ssh" class="st_tag internal_tag" rel="tag" title="标签 ssh 下的日志">ssh</a>-keygen -t rsa<br />
执行结果如下：</p>
<blockquote><p>
charles@mac:~ &gt; ssh-keygen -t rsa<br />
Generating public/private rsa key pair.<br />
Enter file in which to save the key (/Users/charles/.ssh/id_rsa):<br />
Created directory '/Users/charles/.ssh'.<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /Users/charles/.ssh/id_rsa.<br />
Your public key has been saved in /Users/charles/.ssh/id_rsa.pub.<br />
The key fingerprint is:<br />
c8:4b:85:87:90:7c:1a:67:b6:71:f5:51:0c:9d:a2:89 charles@TCMBP.local<br />
The key's randomart image is:<br />
+--[ RSA 2048]----+<br />
|   ...   .. o=.. |<br />
|    +.*o.  ...+  |<br />
|     Bo+o. o..   |<br />
|    ...+E o      |<br />
|      + S        |<br />
|     . .         |<br />
|      .          |<br />
|                 |<br />
|                 |<br />
+-----------------+
</p></blockquote>
<p>注意：提示enter passphrase的时候，不要输入，因为你本来就想少打一次密码的，这里如果设置了用密码保护私钥，那登录的时候还是要输密码，就白做了。</p>
<p>做完这个步骤后，cd ~/.ssh，你就可以看到你刚才生成的密钥对，id_rsa是私钥，id_rsa.pub是公钥。下一步，就是把公钥拷贝到目标主机上。</p>
<h2>将公钥拷贝到目标主机</h2>
<p>用ssh登录到目标主机，然后cd ~/.ssh目录，如果目录不存在，那么要自己创建mkdir -p ~/.ssh。你今后要用哪个帐户登录主机，就在哪个帐户的home目录下操作，如果要免登陆root，就要去/root下操作。使用~比较好，不用多想了。</p>
<p>有了.ssh目录后，进去，然后把id_rsa.pub传过去，可以用scp命令，这里要做的一个主要操作，就是将id_rsa.pub，的文件内容，写到一个叫authorized_keys的文件中去，如果目标主机的相应用户名下已经有了.ssh目录和authorized_keys文件，那你操作要小心一点，可能别人也做过免登陆的设置，这个时候你要小心不要把别人的设置给覆盖了。如果没有的话，就创建文件touch ~/.ssh/authorized_keys，然后执行cat id_rsa.pub >> authorized_keys，将你的公钥写入到authorized_keys中，公钥文件.pub里面只有一行信息，上面的命令相当于把那一行信息追加到authorized_keys文件最后一行。</p>
<p>如果.ssh目录是你主机刚刚创建的，那么可能还需要改变一下这个目录的权限，将权限放低，chmod -R 0600 ~/.ssh，到此，所有设置就算做完了，你可以退出登录，在自己的主机上试一下了，现在再敲入ssh命令后，不用密码就可以登录主机了。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm&from=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">VIM常用小窍门收集</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fword2007-doesnot-show-pics.htm&from=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips]Word2007中看不到图片</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fcustom-mac-os-x-terminal.htm&from=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使Mac OS X的终端看起来更舒服</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/diy" title="DIY" rel="tag">DIY</a>, <a href="http://sexywp.com/tags/linux" title="Linux" rel="tag">Linux</a>, <a href="http://sexywp.com/tags/ssh" title="ssh" rel="tag">ssh</a>, <a href="http://sexywp.com/tags/tips" title="tips" rel="tag">tips</a>, <a href="http://sexywp.com/tags/usage" title="usage" rel="tag">usage</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/mac-os-x-ssh-key-pair-login-linux.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>【边学边用】PHP5函数参数的按引用传递</title>
		<link>http://sexywp.com/php5-pass-param-by-ref.htm</link>
		<comments>http://sexywp.com/php5-pass-param-by-ref.htm#comments</comments>
		<pubDate>Fri, 26 Aug 2011 14:07:14 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[心得体会]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[usage]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=454</guid>
		<description><![CDATA[PHP是支持引用的，但是关于一个变量什么时候是引用，什么时候是值，我脑子里总是迷迷糊糊的，所以，想用引用的时候，就会不自觉地在所有的地方加上&#038;符号，真的很累赘。为了缓解这个问题，我特意写了下面这个代码片段来增进自己的理解。起初，我对这个东西的理解是，对于对象来说，PHP5就是按照引用传递的。但是我现在想，可能事情不是这么一回事情。下面的代码片段中，$obj其实是A的对象的一个引用，可以理解成一个指针，函数参数$o，其实还是对$obj的拷贝，只是拷贝的是引用本身，也即，$o其实是$obj的拷贝，只是由于其拷贝了$obj，所以，$o也指向A的对象。两个指针指向一个地方，这也是为什么函数changeObj可以改变A的对象的原因。我想，这样大概从技术来说，会更加合理一点。

<span class="readmore"><a href="http://sexywp.com/php5-pass-param-by-ref.htm" title="【边学边用】PHP5函数参数的按引用传递">Keep Reading --- 315 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm&from=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP 5.3.x中弃用的特性 Deprecated</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp-return.htm&from=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips] PHP中return的用法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>PHP是支持引用的，但是关于一个变量什么时候是引用，什么时候是值，我脑子里总是迷迷糊糊的，所以，想用引用的时候，就会不自觉地在所有的地方加上&#038;符号，真的很累赘。为了缓解这个问题，我特意写了下面这个代码片段来增进自己的理解。起初，我对这个东西的理解是，对于对象来说，<a href="http://sexywp.com/tags/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">PHP</a>5就是按照引用传递的。但是我现在想，可能事情不是这么一回事情。下面的代码片段中，$obj其实是A的对象的一个引用，可以理解成一个指针，函数参数$o，其实还是对$obj的拷贝，只是拷贝的是引用本身，也即，$o其实是$obj的拷贝，只是由于其拷贝了$obj，所以，$o也指向A的对象。两个指针指向一个地方，这也是为什么函数changeObj可以改变A的对象的原因。我想，这样大概从技术来说，会更加合理一点。</p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Blue;">&lt;?php</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">class</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">A</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Green;">public</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">$a</span><span style="color: Gray;">=</span><span style="color: Maroon;">1</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Green;">public</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">$b</span><span style="color: Gray;">=</span><span style="color: Maroon;">1</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">$obj</span><span style="color: Gray;"> = </span><span style="color: Green;">new</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">A</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">var_dump</span><span style="color: Olive;">(</span><span style="color: #00008b;">$obj</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">function</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">changeObj</span><span style="color: Olive;">(</span><span style="color: #00008b;">$o</span><span style="color: Olive;">)</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: #00008b;">$o</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">a</span><span style="color: Gray;"> = </span><span style="color: Maroon;">3</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: #00008b;">$o</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">b</span><span style="color: Gray;"> = </span><span style="color: Maroon;">5</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">changeObj</span><span style="color: Olive;">(</span><span style="color: #00008b;">$obj</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">var_dump</span><span style="color: Olive;">(</span><span style="color: #00008b;">$obj</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li></ol></div></div>
<p>执行结果如下：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">object(A)#1 (2) {</li>
<li>&nbsp; [&quot;a&quot;]=&gt;</li>
<li>&nbsp; int(1)</li>
<li>&nbsp; [&quot;b&quot;]=&gt;</li>
<li>&nbsp; int(1)</li>
<li>}</li>
<li>object(A)#1 (2) {</li>
<li>&nbsp; [&quot;a&quot;]=&gt;</li>
<li>&nbsp; int(3)</li>
<li>&nbsp; [&quot;b&quot;]=&gt;</li>
<li>&nbsp; int(5)</li>
<li>}</li></ol></div>
<p>然后再看一个普通变量的引用传递的例子，这个例子里面使用的是原生的整型变量，然后函数changeInt的函数声明里，也用一般方法声明参数，普通的调用，我们发现函数不能改变$x和$y的值，这符合我们的预期，但是第二个形式的调用，就是传参数时候，带上引用标志&#038;，结果我们发现，$x和$y的值也改变了，这是为什么呢，跟上面的例子是一个原因，函数的形式参数a和b其实是$x和$y的引用的拷贝，所以a和b也指向x和y，所以，a和b可以改变x和y的值。再看最下面的一种形式，这种是我认为的真正的按照引用传递参数。非常的绕乎对吧？我也觉得如此，确实太过灵活了。确实不利于学习和理解，代码也不容易维护，如果真的想用引用传递参数，推荐用最底下一种方式，明确告诉调用的人，这里其实是引用，千万别用changeInt(&#038;$x, &#038;$y);这种形式，这个代码散步在各处，将极难定位bug。</p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Blue;">&lt;?php</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">$x</span><span style="color: Gray;"> = </span><span style="color: Maroon;">1</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">$y</span><span style="color: Gray;"> = </span><span style="color: Maroon;">2</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">function</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">changeInt</span><span style="color: Olive;">(</span><span style="color: #00008b;">$a</span><span style="color: Gray;">, </span><span style="color: #00008b;">$b</span><span style="color: Olive;">)</span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: #00008b;">$a</span><span style="color: Gray;"> = </span><span style="color: Maroon;">3</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: #00008b;">$b</span><span style="color: Gray;"> = </span><span style="color: Maroon;">4</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">changeInt</span><span style="color: Olive;">(</span><span style="color: #00008b;">$x</span><span style="color: Gray;">,</span><span style="color: #00008b;">$y</span><span style="color: Olive;">)</span><span style="color: Gray;">; </span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">var_dump</span><span style="color: Olive;">(</span><span style="color: #00008b;">$x</span><span style="color: Gray;">, </span><span style="color: #00008b;">$y</span><span style="color: Olive;">)</span><span style="color: Gray;">; </span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">$x = 1, $y = 2</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">changeInt</span><span style="color: Olive;">(</span><span style="color: Gray;">&amp;</span><span style="color: #00008b;">$x</span><span style="color: Gray;">, &amp;</span><span style="color: #00008b;">$y</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">var_dump</span><span style="color: Olive;">(</span><span style="color: #00008b;">$x</span><span style="color: Gray;">, </span><span style="color: #00008b;">$y</span><span style="color: Olive;">)</span><span style="color: Gray;">; </span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">$x = 3, $y = 4</span></li>
<li><span style="color: Gray;">&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">function</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">changeIntByRef</span><span style="color: Olive;">(</span><span style="color: Gray;">&amp;</span><span style="color: #00008b;">$a</span><span style="color: Gray;">, &amp;</span><span style="color: #00008b;">$b</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: #00008b;">$a</span><span style="color: Gray;"> = </span><span style="color: Maroon;">5</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: #00008b;">$b</span><span style="color: Gray;"> = </span><span style="color: Maroon;">6</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">changeIntByRef</span><span style="color: Olive;">(</span><span style="color: #00008b;">$x</span><span style="color: Gray;">, </span><span style="color: #00008b;">$y</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">var_dump</span><span style="color: Olive;">(</span><span style="color: #00008b;">$x</span><span style="color: Gray;">, </span><span style="color: #00008b;">$y</span><span style="color: Olive;">)</span><span style="color: Gray;">; </span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">$x = 5, $y = 6</span></li></ol></div></div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm&from=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP 5.3.x中弃用的特性 Deprecated</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp-return.htm&from=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips] PHP中return的用法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/basic" title="basic" rel="tag">basic</a>, <a href="http://sexywp.com/tags/php" title="PHP" rel="tag">PHP</a>, <a href="http://sexywp.com/tags/usage" title="usage" rel="tag">usage</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/php5-pass-param-by-ref.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ExtJS 4 的MVC</title>
		<link>http://sexywp.com/extjs-4-mvc.htm</link>
		<comments>http://sexywp.com/extjs-4-mvc.htm#comments</comments>
		<pubDate>Sat, 09 Jul 2011 17:39:44 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[心得体会]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=445</guid>
		<description><![CDATA[ExtJS是我听说了很久的一个js框架了，但是从来就没有用过，读研期间寝室里有个小哥在用，不过那时候醉心于WordPress开发，也懒得理会了。现在公司里，有个上线系统用到了这个框架中的一个TreePanel组件，整个界面上，就正中间扔了一个tree panel，而且不知道什么原因，CSS还有bug，把按钮都搞破了，弄得丑陋不堪，我于是自告奋勇，仔细调试，终于修复了那个显示上的bug，从此算是初次结识了ExtJS。它真正吸引我的原因是，它能够把富客户端应用的开发，从美工和基础交互中解放出来，只需要专注于业务逻辑开发即可，从而让后台工程师也能够有能力快速开发外观专业的网站应用系统。我觉得这真是功德无量的一个事情。（如果我直觉没错，Flex框架也是这一类东西，这也是我对其有兴趣的原因，当然还没有时间尝试）

<span class="readmore"><a href="http://sexywp.com/extjs-4-mvc.htm" title="ExtJS 4 的MVC">Keep Reading --- 1529 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="MVC就是个选择题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC就是个选择题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Google AJAX Libraries API替换WordPress自带的js库" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freplace-the-wp-js-lib-by-googleapi.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/23/9256004.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Google AJAX Libraries API替换WordPress自带的js库</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略（08）---构建一个WordPress插件用户面板" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-08.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/26/9637574.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略（08）---构建一个WordPress插件用户面板</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>ExtJS是我听说了很久的一个js框架了，但是从来就没有用过，读研期间寝室里有个小哥在用，不过那时候醉心于WordPress开发，也懒得理会了。现在公司里，有个上线系统用到了这个框架中的一个TreePanel组件，整个界面上，就正中间扔了一个tree panel，而且不知道什么原因，CSS还有bug，把按钮都搞破了，弄得丑陋不堪，我于是自告奋勇，仔细调试，终于修复了那个显示上的bug，从此算是初次结识了ExtJS。它真正吸引我的原因是，它能够把富客户端应用的开发，从美工和基础交互中解放出来，只需要专注于业务逻辑开发即可，从而让后台工程师也能够有能力快速开发外观专业的网站应用系统。我觉得这真是功德无量的一个事情。（如果我直觉没错，Flex框架也是这一类东西，这也是我对其有兴趣的原因，当然还没有时间尝试）<span id="more-445"></span></p>
<p><a href="https://picasaweb.google.com/lh/photo/6w-l2AcPyxIcU35pqAdwTA?feat=embedwebsite"><img src="https://lh6.googleusercontent.com/-NjYqHh6WjX0/ThiD-8_-xxI/AAAAAAAAB5w/jjqmfY8JrZE/s800/ExtJS%2525E5%2525AF%2525B9%2525E8%2525B1%2525A1%2525E5%252585%2525B3%2525E7%2525B3%2525BB%2525E5%25259B%2525BE.png" height="310" width="499" alt="ExtJS 4 MVC"/></a></p>
<p>据官网介绍，还有据同事<a href="http://www.showframework.com/" target="_blank">ishow</a>的描述，<a href="http://sexywp.com/tags/extjs-2" class="st_tag internal_tag" rel="tag" title="标签 extjs 下的日志">ExtJS</a> 4.x 是一个变化很大的版本，相比已经应用广泛的 3.x 来说，变了很多、新特性也很多，MVC就是它提供的新特性之一。由于我最近半年都在学习MVC模式（主要是使用Yii框架），所以这个名词更是引起了我浓厚的兴趣，这几天都在官网上看这个框架MVC的例子，直到今天，总算是摸着一点门道，于是画了上面那个图。这个四不像的图，是我个人对框架的理解的第一个具体化产物。</p>
<p>下面简单描述一下这个图。</p>
<p>1. 每个应用都有一个实体，就是Application对象实例，而每个应用同样也采用单一入口结构，有个快捷函数就是Ext.application({config})，创建一个Application对象实例，并且运行它；这里行为表现和Yii框架的Application看起来很像，创建一个实例，然后run；</p>
<p>2. Application在创建之初，会去加载Controller类，加载完毕后，会正式的lunch；</p>
<p>3. Application在lunch的时候，会创建一个Viewport对象实例，这个东西就像一个骨架一样，上面可以拼装各种View，具体说，就是各种布局形式和窗体控件，可以说是应用界面的载体；</p>
<p>4. Controller的角色完全是个粘合剂，它在加载之初，会帮忙加载跟其有关的Model，Store，View类，而其真正的作用，是通过一系列的事件处理函数，确定了每个View上面界面组件对用户交互行为的响应方法，可以说是一堆事件处理器函数的集合；这里面主要通过一个control成员函数来进行事件绑定，通过另一个叫ComponentQuery的组件，使用类似css selector的语法来定位界面上的组件，并为其绑定事件处理器；</p>
<p>5. Model是对抽象数据的具体化，或者可以这么理解，就是数据库里面的一行记录，到底是怎么变成一个对象的，将数据库字段变成了对象的属性的对应关系；而这里比Yii框架MVC模型多出来的东西，就是Store这个东西，在Yii框架里面，有强大的ORM系统，还有强大的AR将Model直接连接到了DB上，数据一出来就直接变成了对象，而在ExtJS框架中，代码全在客户端，势必就出现了透过网络来加载数据需要，而我认为，Store就是对通过网络来加载数据的过程的一个抽象，Store依赖于Model，通过关联的Model对象来获知如何将取回的数据对象化，以方便View展现，所以View是依赖Store对象的；（这里岔开一点，感觉这个Store的设计理念或许可以借鉴，由于某些原因，我们在使用PHP框架的时候，不能让Model直接连接DB，是不是也可以把数据取回最终拼接成Model对象的这个过程给抽象化成类似ExtJS中Store的这套机制呢？）</p>
<p>6. View就纯粹是一个界面组件，或者说窗体控件的集合，通过Store来加载数据并且展现到界面上，界面控件的响应都写在Controller里面，View对Controller的存在全无所知，也没有代码上的依赖；</p>
<p>总结一下，感觉这套系统的好处是在于，将View和Model都给抽象了出来，以至于它们可以更加好地被复用，做好一个面板，所有的地方都可以调用，而真正业务逻辑又被很好的封装在了Controller里面，这样也便于去模块化地开发系统，基本感觉上，是一套非常优秀的框架，由于我对ExtJS 3系列版本，没有任何经验，也就没法做出其相对于先前版本是否有质的飞跃的判断，通过仔细的挖掘，我发现其易用性上确实比我原来想象的要好，开发人员可能没太多必要去纠结于内部原理，只要理解到跟我现在差不多的样子，就可以快速上手去做一些东西出来，当然还是必须看着文档按图索骥的，嘿嘿:)</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="MVC就是个选择题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC就是个选择题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="升级到WordPress2.7版本~~" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fupdate-to-wp27.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/30/26374211.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">升级到WordPress2.7版本~~</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="不可信的眼睛" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Funbelievable-eyes.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/09/16/31419056.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">不可信的眼睛</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="杭州游（二）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flive-in-hangzhou2.htm&from=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/07/03/15790859.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">杭州游（二）</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/analytics" title="analytics" rel="tag">analytics</a>, <a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/extjs-2" title="extjs" rel="tag">extjs</a>, <a href="http://sexywp.com/tags/mvc" title="MVC" rel="tag">MVC</a>, <a href="http://sexywp.com/tags/yii-2" title="yii" rel="tag">yii</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/extjs-4-mvc.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VIM常用小窍门收集</title>
		<link>http://sexywp.com/vim-tricks-collections.htm</link>
		<comments>http://sexywp.com/vim-tricks-collections.htm#comments</comments>
		<pubDate>Tue, 14 Jun 2011 14:31:30 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[心得体会]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[usage]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=440</guid>
		<description><![CDATA[vim应该是现在世界上最流行的编辑器，没有之一。就算你千般百般地不喜欢它，掌握它也成了一件必须的事情了。因为日后你如果做程序员，在非Win系列的服务器上搞开发，vim绝对是无法避免的。你日常能接触到的server，emacs可能没装，但是vi不可能没装，就这样。

特意开辟这个文章，用于收藏一些工作中常用的操作，主要有这么几个原则：



<span class="readmore"><a href="http://sexywp.com/vim-tricks-collections.htm" title="VIM常用小窍门收集">Keep Reading --- 615 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fthe-absolute-bare-minimum-vimrc.htm&from=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Vim最低配置单</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm&from=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mac OS X上如何实现到Linux主机的ssh免登陆</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fword2007-doesnot-show-pics.htm&from=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips]Word2007中看不到图片</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>vim应该是现在世界上最流行的编辑器，没有之一。就算你千般百般地不喜欢它，掌握它也成了一件必须的事情了。因为日后你如果做程序员，在非Win系列的服务器上搞开发，vim绝对是无法避免的。你日常能接触到的server，emacs可能没装，但是vi不可能没装，就这样。</p>
<p>特意开辟这个文章，用于收藏一些工作中常用的操作，主要有这么几个原则：</p>
<ol>
<li>非常有用</li>
<li>不常用</li>
<li>每次用都想不起来应该怎么用</li>
</ol>
<p>不知道大家是不是经常跟我一样有这种感受呢，我会把我遇到的这类操作，都详细写在这里。</p>
<h2>将配置文件中的指定列前面加上注释符号</h2>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">#fastcgi.conf</li>
<li>fastcgi_param&nbsp; GATEWAY_INTERFACE&nbsp; CGI/1.1;</li>
<li>fastcgi_param&nbsp; SERVER_SOFTWARE&nbsp; &nbsp; nginx;</li>
<li>fastcgi_param&nbsp; QUERY_STRING&nbsp; &nbsp; &nbsp; &nbsp;$query_string;</li>
<li>fastcgi_param&nbsp; REQUEST_METHOD&nbsp; &nbsp; &nbsp;$request_method;</li>
<li>fastcgi_param&nbsp; CONTENT_TYPE&nbsp; &nbsp; &nbsp; &nbsp;$content_type;</li>
<li>fastcgi_param&nbsp; CONTENT_LENGTH&nbsp; &nbsp; &nbsp;$content_length;</li>
<li>fastcgi_param&nbsp; SCRIPT_FILENAME&nbsp; &nbsp; $document_root$fastcgi_script_name;</li>
<li>fastcgi_param&nbsp; SCRIPT_NAME&nbsp; &nbsp; &nbsp; &nbsp; $fastcgi_script_name;</li>
<li>fastcgi_param&nbsp; REQUEST_URI&nbsp; &nbsp; &nbsp; &nbsp; $request_uri;</li>
<li>fastcgi_param&nbsp; DOCUMENT_URI&nbsp; &nbsp; &nbsp; &nbsp;$document_uri;</li>
<li>fastcgi_param&nbsp; DOCUMENT_ROOT&nbsp; &nbsp; &nbsp; $document_root;</li></ol></div>
<p>如上代码是一个很常见的配置文件，我现在要给第2-12行前面都加上一个#号，注释掉他们，在EmEditor里面这个事情无敌简单的，但是到了vi里面，你是不是总也想不起来应该怎么弄？</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">:2,12s/^/#/g</li></ol></div>
<p>解释一下，【2,12】在vi中叫range，看帮助的时候，如果看到range，这就是一种写法，表明第2行到12行。<br />
还有一种写法：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">:s/^/#/g 11</li></ol></div>
<p>将光标移动到第二行，然后执行上面的命令，后面的【11】代表，执行这个命令，重复11次。这里一直没解释里面那个至关重要的乱码串，那个就是替换的命令了。下次再说。</p>
<h2>删除的时候使用f和t</h2>
<p>删除是vim里面非常常用的功能，一个一个字幕删除，用x，可以代替del用。整行删除，dd，应该都会了。删除一个单词，用dw。这些都是简单提一下，我主要想两个很好用的功能，就是f和t。</p>
<p>f的本意是行查找，fa，就是从光标当前位置开始，在本行中，找到第一个字母a，和d结合起来以后，就非常方便了，比如：</p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Blue;">&lt;?php</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">function</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">test_php</span><span style="color: Olive;">(</span><span style="color: #00008b;">$a</span><span style="color: Gray;">,</span><span style="color: #00008b;">$b</span><span style="color: Gray;">,</span><span style="color: #00008b;">$c</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">return</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">true</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">}</span></li></ol></div></div>
<p>在这个代码里，你想删掉第一个参数，可以把光标放在(后面的第一个$上，然后按"df,"，就可以把$a连同后面的逗号都删掉，非常方便。当然了，你可以发挥一下，"d2f,"这个按键序列就是把$a和$b都删掉了，但是呢，用数字这种东西，在实际操作中，我感觉大脑经常反应不过来，需要思考，不实用。</p>
<p>在来说一下t，t这个东西，跟f非常像，区别就是t把找光标放到找到的那个字符前面一个位子，比如上面那个例子，我把光标放在第一个$上，然后按下"dt)"这个序列，可以把函数的3个参数都删掉，但是却不会删掉括号，非常舒服，在括号里删东西，我经常用这个功能。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fthe-absolute-bare-minimum-vimrc.htm&from=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Vim最低配置单</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm&from=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mac OS X上如何实现到Linux主机的ssh免登陆</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fword2007-doesnot-show-pics.htm&from=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips]Word2007中看不到图片</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/tips" title="tips" rel="tag">tips</a>, <a href="http://sexywp.com/tags/tricks" title="tricks" rel="tag">tricks</a>, <a href="http://sexywp.com/tags/usage" title="usage" rel="tag">usage</a>, <a href="http://sexywp.com/tags/vim" title="vim" rel="tag">vim</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/vim-tricks-collections.htm/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>给SVN客户端配置代理服务器</title>
		<link>http://sexywp.com/use-proxy-in-ur-svn-client.htm</link>
		<comments>http://sexywp.com/use-proxy-in-ur-svn-client.htm#comments</comments>
		<pubDate>Mon, 13 Jun 2011 13:39:47 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[小窍门]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[心得体会]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=439</guid>
		<description><![CDATA[最常见的SVN客户端其实是TortoiseSVN，我一直叫它作乌龟SVN。上班以后，我在办公室使用SVN连接非办公网络的服务器，发现无法连接，原来，是因为大多数办公网络都设置了防火墙，要连接外网的服务器，必须配置代理。如果使用的是TortoiseSVN，那么“右键”-》“Settings”-》“Networking”，就可以找到设置代理的地方：



我自己经常使用的是另一款SVN客户端，不知道国内有多少用户，总之我也提一下吧，下载的网站是这里：http://www.collab.net/，这家公司是SVN的幕后支持公司，他们开发基于命令行的各种操作系统的客户端，基于命令行，所以就非常的轻巧，最关键是装好以后，可以和NetBeans无缝集成，也不会弄一堆花花绿绿的图标在资源管理器里面，让你看了红色惊叹号凭空焦虑。

<span class="readmore"><a href="http://sexywp.com/use-proxy-in-ur-svn-client.htm" title="给SVN客户端配置代理服务器">Keep Reading --- 536 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinXP上搭建自己的SVN服务器</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">VIM常用小窍门收集</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>最常见的SVN客户端其实是TortoiseSVN，我一直叫它作乌龟SVN。上班以后，我在办公室使用SVN连接非办公网络的服务器，发现无法连接，原来，是因为大多数办公网络都设置了防火墙，要连接外网的服务器，必须配置代理。如果使用的是TortoiseSVN，那么“右键”-》“Settings”-》“Networking”，就可以找到设置代理的地方：</p>
<p><img src="http://niff.home.xs4all.nl/stuff/tortoiseproxy.png" alt="set proxy in tortoise svn" /></p>
<p>我自己经常使用的是另一款SVN客户端，不知道国内有多少用户，总之我也提一下吧，下载的网站是这里：http://www.collab.net/，这家公司是SVN的幕后支持公司，他们开发基于命令行的各种操作系统的客户端，基于命令行，所以就非常的轻巧，最关键是装好以后，可以和NetBeans无缝集成，也不会弄一堆花花绿绿的图标在资源管理器里面，让你看了红色惊叹号凭空焦虑。</p>
<p>给这个命令行客户端设置代理有点纠结，看不明白的童鞋，自动忽略好了。首先打开CMD，然后键入命令echo %APPDATA%，得到的结果，就是你的配置所在的根目录，进入那个目录，然后进入Subversion子目录，你会看到两个配置文件，一个叫config，一个叫servers，用写字板编辑那个servers的配置文件：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">[global]</li>
<li># http-proxy-exceptions = *.exception.com, www.internal-site.org</li>
<li>http-proxy-host = defaultproxy.whatever.com</li>
<li>http-proxy-port = 7000</li>
<li>http-proxy-username = defaultusername</li>
<li>http-proxy-password = defaultpassword</li></ol></div>
<p>配置好后，就可以实现给SVN客户端挂上了代理，如果只想给特定的域挂代理，就使用另一个section来配置代理：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">[groups]</li>
<li>group1 = *.googlecode.com</li>
<li># othergroup = repository.blarggitywhoomph.com</li>
<li># thirdgroup = *.example.com</li>
<li>&nbsp;</li>
<li>### Information for the first group:</li>
<li>[group1]</li>
<li>http-proxy-host = proxy.myoffice.com</li>
<li>http-proxy-port = 8080</li>
<li># http-proxy-username = blah</li>
<li># http-proxy-password = doubleblah</li>
<li># http-timeout = 60</li></ol></div>
<p>如上只是我的配置的一个节选，是我给googlecode这个域配置了一个代理。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinXP上搭建自己的SVN服务器</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">VIM常用小窍门收集</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/proxy" title="proxy" rel="tag">proxy</a>, <a href="http://sexywp.com/tags/subversion" title="subversion" rel="tag">subversion</a>, <a href="http://sexywp.com/tags/svn" title="svn" rel="tag">svn</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/use-proxy-in-ur-svn-client.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yii框架中验证器的allowEmpty属性</title>
		<link>http://sexywp.com/yii-validator-allwoempty-property.htm</link>
		<comments>http://sexywp.com/yii-validator-allwoempty-property.htm#comments</comments>
		<pubDate>Wed, 18 May 2011 08:13:08 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Yii]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[usage]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=435</guid>
		<description><![CDATA[Yii框架自带验证器这个包，提供了一组常见各类属性的验证器。如果使用Gii代码生成工具创建model，会根据数据库字段的属性默认生成一些验证器的配置。在配置验证器的时候，很多验证器都有以后属性叫做allowEmpty，这个属性的真正逻辑却不是看上去的那个意思。

数据库里的字段，有个属性，叫NULL，就是字段是否允许为空值，allowEmpty听起来跟这个NULL的约束是一样的，但是实际看验证器的代码：

&#160;&#160;protected&#160;function validateAttribute($object,$attribute)

<span class="readmore"><a href="http://sexywp.com/yii-validator-allwoempty-property.htm" title="Yii框架中验证器的allowEmpty属性">Keep Reading --- 664 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架base包代码分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/11/20/11182613.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架base包代码分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="工作中常用的Linux命令集锦" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Yii框架自带验证器这个包，提供了一组常见各类属性的验证器。如果使用Gii代码生成工具创建model，会根据数据库字段的属性默认生成一些验证器的配置。在配置验证器的时候，很多验证器都有以后属性叫做allowEmpty，这个属性的真正逻辑却不是看上去的那个意思。<span id="more-435"></span></p>
<p>数据库里的字段，有个属性，叫NULL，就是字段是否允许为空值，allowEmpty听起来跟这个NULL的约束是一样的，但是实际看验证器的代码：</p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Gray;">&nbsp;</span><span style="color: Green;">protected</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">function</span><span style="color: Gray;"> </span><span style="color: Blue;">validateAttribute</span><span style="color: Olive;">(</span><span style="color: #00008b;">$object</span><span style="color: Gray;">,</span><span style="color: #00008b;">$attribute</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$value</span><span style="color: Gray;">=</span><span style="color: #00008b;">$object</span><span style="color: Gray;">-&gt;</span><span style="color: #00008b;">$attribute</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">allowEmpty</span><span style="color: Gray;"> &amp;&amp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">isEmpty</span><span style="color: Olive;">(</span><span style="color: #00008b;">$value</span><span style="color: Olive;">)</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">return</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: Blue;">function_exists</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">mb_strlen</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> &amp;&amp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">encoding</span><span style="color: Gray;">!==</span><span style="color: Green;">false</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$length</span><span style="color: Gray;">=</span><span style="color: Blue;">mb_strlen</span><span style="color: Olive;">(</span><span style="color: #00008b;">$value</span><span style="color: Gray;">,</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">encoding</span><span style="color: Gray;"> ? </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">encoding</span><span style="color: Gray;"> : </span><span style="color: Blue;">Yii</span><span style="color: Gray;">::</span><span style="color: Blue;">app</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">charset</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">else</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$length</span><span style="color: Gray;">=</span><span style="color: Blue;">strlen</span><span style="color: Olive;">(</span><span style="color: #00008b;">$value</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">min</span><span style="color: Gray;">!==</span><span style="color: Green;">null</span><span style="color: Gray;"> &amp;&amp; </span><span style="color: #00008b;">$length</span><span style="color: Gray;">&lt;</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">min</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$message</span><span style="color: Gray;">=</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">tooShort</span><span style="color: Gray;">!==</span><span style="color: Green;">null</span><span style="color: Gray;">?</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">tooShort</span><span style="color: Gray;">:</span><span style="color: Blue;">Yii</span><span style="color: Gray;">::</span><span style="color: Blue;">t</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">yii</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">{attribute} is too short (minimum is {min} characters).</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">addError</span><span style="color: Olive;">(</span><span style="color: #00008b;">$object</span><span style="color: Gray;">,</span><span style="color: #00008b;">$attribute</span><span style="color: Gray;">,</span><span style="color: #00008b;">$message</span><span style="color: Gray;">,</span><span style="color: Green;">array</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">{min}</span><span style="color: #8b0000;">'</span><span style="color: Gray;">=&gt;</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">min</span><span style="color: Olive;">)</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">max</span><span style="color: Gray;">!==</span><span style="color: Green;">null</span><span style="color: Gray;"> &amp;&amp; </span><span style="color: #00008b;">$length</span><span style="color: Gray;">&gt;</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">max</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$message</span><span style="color: Gray;">=</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">tooLong</span><span style="color: Gray;">!==</span><span style="color: Green;">null</span><span style="color: Gray;">?</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">tooLong</span><span style="color: Gray;">:</span><span style="color: Blue;">Yii</span><span style="color: Gray;">::</span><span style="color: Blue;">t</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">yii</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">{attribute} is too long (maximum is {max} characters).</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">addError</span><span style="color: Olive;">(</span><span style="color: #00008b;">$object</span><span style="color: Gray;">,</span><span style="color: #00008b;">$attribute</span><span style="color: Gray;">,</span><span style="color: #00008b;">$message</span><span style="color: Gray;">,</span><span style="color: Green;">array</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">{max}</span><span style="color: #8b0000;">'</span><span style="color: Gray;">=&gt;</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">max</span><span style="color: Olive;">)</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">is</span><span style="color: Gray;">!==</span><span style="color: Green;">null</span><span style="color: Gray;"> &amp;&amp; </span><span style="color: #00008b;">$length</span><span style="color: Gray;">!==</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">is</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$message</span><span style="color: Gray;">=</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">message</span><span style="color: Gray;">!==</span><span style="color: Green;">null</span><span style="color: Gray;">?</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">message</span><span style="color: Gray;">:</span><span style="color: Blue;">Yii</span><span style="color: Gray;">::</span><span style="color: Blue;">t</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">yii</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">{attribute} is of the wrong length (should be {length} characters).</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">addError</span><span style="color: Olive;">(</span><span style="color: #00008b;">$object</span><span style="color: Gray;">,</span><span style="color: #00008b;">$attribute</span><span style="color: Gray;">,</span><span style="color: #00008b;">$message</span><span style="color: Gray;">,</span><span style="color: Green;">array</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">{length}</span><span style="color: #8b0000;">'</span><span style="color: Gray;">=&gt;</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">is</span><span style="color: Olive;">)</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">?&gt;</span></li></ol></div></div>
<p>来看其中一个细节：</p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Gray;">&nbsp;</span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">allowEmpty</span><span style="color: Gray;"> &amp;&amp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">isEmpty</span><span style="color: Olive;">(</span><span style="color: #00008b;">$value</span><span style="color: Olive;">)</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">return</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">?&gt;</span></li></ol></div></div>
<p>这一行什么意思，如果被验证属性为空，就认为完全合法，立刻返回，但是如果allowEmpty为false的话，就要通过函数后续的所有验证条件。那么对于一个传入的空值来说，allowEmpty无论是true还是false，极有可能都不会报错，上面节选的验证器是StringValidator，如果我没有设定min的值，那么一个空串在allowEmpty为false的情况下，还是不会报任何错误的。</p>
<p>如果希望一个属性值不能为空，最好还是用RequiredValidator来验证，allowEmpty是不靠谱的，建议一般就采取allowEmpty的默认值true，可以节省几次判断。然后不要中了Yii的这个小陷阱噢~~希望Yii的后续版本可以让这个功能显得更加自然一点，不要让我猜谜语。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架base包代码分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/11/20/11182613.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架base包代码分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="工作中常用的Linux命令集锦" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/usage" title="usage" rel="tag">usage</a>, <a href="http://sexywp.com/tags/yii-2" title="yii" rel="tag">yii</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/yii-validator-allwoempty-property.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web开发专用IDE：Aptana Studio 3.0</title>
		<link>http://sexywp.com/web-apps-ide-aptana-studio3.htm</link>
		<comments>http://sexywp.com/web-apps-ide-aptana-studio3.htm#comments</comments>
		<pubDate>Tue, 03 May 2011 01:37:02 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=429</guid>
		<description><![CDATA[Aptana Studio是一款专业的、开源的开发环境，主要用于Web应用开发。该开发环境支持最新的浏览器技术HTML5，CSS3，Javascript，除此之外，对服务器端语言Ruby（对RoR貌似有很好的支持），PHP，Python也有很好的支持。

目前能够在Web开发中对HTML，CSS，和JS同时提供编码帮助的IDE环境极其少见，Dreamweaver是我知道的做得比较好的，但是Dreamweaver对语言的支持只做到了静态语法检查和代码高亮，更进一步则无能为力了，只能算是准IDE，毕竟不是真正的IDE环境，NetBeans在这方面有不俗的表现，正是我选用此款IDE的原因。

<span class="readmore"><a href="http://sexywp.com/web-apps-ide-aptana-studio3.htm" title="Web开发专用IDE：Aptana Studio 3.0">Keep Reading --- 497 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="在WinCE上搭建Web服务" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Web服务器LiteSpeed" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="PHP 5.3.x中弃用的特性 Deprecated" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PHP 5.3.x中弃用的特性 Deprecated</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Aptana Studio是一款专业的、开源的开发环境，主要用于Web应用开发。该开发环境支持最新的浏览器技术HTML5，CSS3，<a href="http://sexywp.com/tags/javascript" class="st_tag internal_tag" rel="tag" title="标签 javascript 下的日志">Javascript</a>，除此之外，对服务器端语言Ruby（对RoR貌似有很好的支持），<a href="http://sexywp.com/tags/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">PHP</a>，Python也有很好的支持。</p>
<p>目前能够在Web开发中对HTML，CSS，和JS同时提供编码帮助的IDE环境极其少见，Dreamweaver是我知道的做得比较好的，但是Dreamweaver对语言的支持只做到了静态语法检查和代码高亮，更进一步则无能为力了，只能算是准IDE，毕竟不是真正的IDE环境，NetBeans在这方面有不俗的表现，正是我选用此款IDE的原因。</p>
<p>之所以注意到这款IDE，是因为有业内比较资深的工程师提到了这个东西，所以专门了解了一下，这个IDE基于Eclipse框架开发，专门针对Web应用开发领域，尤其强化了对HTML，CSS，JS等语言的支持，对于Server端的语言，选择的也都是专门用于Web开发的语言。本来我对其对PHP开发的支持抱有一定的期待，但是后来听说其将PHP模块从项目中移除，转而投向PDT Project，我就有点失望了，感觉PDT的能力真的只能算一般，不过在不是很了解Aptana的基础上，我还是可以说，那些用普通Eclipse+PDT开发的童鞋，完全可以转头Aptana的怀抱，因为你二者都不会失去，反而可以得到对HTML，CSS，JS的强大支持。使用NetBeans进行Web开发的童鞋，并且平常工作偏重于Server端PHP开发的，可以等待我的进一步体验报告。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="在WinCE上搭建Web服务" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Web服务器LiteSpeed" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="PHP 5.3.x中弃用的特性 Deprecated" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PHP 5.3.x中弃用的特性 Deprecated</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/ide" title="IDE" rel="tag">IDE</a>, <a href="http://sexywp.com/tags/php" title="PHP" rel="tag">PHP</a>, <a href="http://sexywp.com/tags/tools" title="tools" rel="tag">tools</a>, <a href="http://sexywp.com/tags/web" title="web" rel="tag">web</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/web-apps-ide-aptana-studio3.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google用于提高网站质量的工具：Page Speed工具集</title>
		<link>http://sexywp.com/page-speed-family.htm</link>
		<comments>http://sexywp.com/page-speed-family.htm#comments</comments>
		<pubDate>Mon, 02 May 2011 01:17:01 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[add-ons]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=428</guid>
		<description><![CDATA[应该就是离现在不太远的时候，Google推出了用于提高网页质量的工具集，Page Speed。我最早听说是在若干月前的PHP Classes的news letter上。最近才有时间来仔细看看这个东西。

Page Speed现在的形态是一个工具集，目前提供了客户端和服务器端的两种组件。服务器端提供了Apache服务器的模块mod_pagespeed，该模块可以自动优化网页和资源文件。客户端的工具是一个插件，分别提供了firefox、Chrome的版本，其功能更加类似于Yahoo推出的YSlow，也是真对一个页面进行诊断，给出相应的优化建议，Yahoo提出的东西在业界被称为是14条军规，从Page Speed插件给出的建议来看，基本也没有逃出这14条军规的范畴。除此之外，Google还推出了一个网页版本的Page Speed，只要键入网址，就可以自动分析页面的问题给出建议。

<span class="readmore"><a href="http://sexywp.com/page-speed-family.htm" title="Google用于提高网站质量的工具：Page Speed工具集">Keep Reading --- 308 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwhy-and-how-to-integrate-google-to-blog.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">为何以及如何整合Google搜索到WP博客</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">解决Flash内容总是漂浮于页面顶层的问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>应该就是离现在不太远的时候，Google推出了用于提高网页质量的工具集，Page Speed。我最早听说是在若干月前的PHP Classes的news letter上。最近才有时间来仔细看看这个东西。</p>
<p>Page Speed现在的形态是一个工具集，目前提供了客户端和服务器端的两种组件。服务器端提供了Apache服务器的模块mod_pagespeed，该模块可以自动优化网页和资源文件。客户端的工具是一个插件，分别提供了firefox、Chrome的版本，其功能更加类似于Yahoo推出的YSlow，也是真对一个页面进行诊断，给出相应的优化建议，Yahoo提出的东西在业界被称为是14条军规，从Page Speed插件给出的建议来看，基本也没有逃出这14条军规的范畴。除此之外，Google还推出了一个网页版本的Page Speed，只要键入网址，就可以自动分析页面的问题给出建议。</p>
<p>对于没有使用Apache作为Server的，Page Speed还放出了C++ SDK，支持第三方开发。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwhy-and-how-to-integrate-google-to-blog.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">为何以及如何整合Google搜索到WP博客</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">解决Flash内容总是漂浮于页面顶层的问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fpage-speed-family.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/add-ons" title="add-ons" rel="tag">add-ons</a>, <a href="http://sexywp.com/tags/chrome" title="chrome" rel="tag">chrome</a>, <a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/google" title="google" rel="tag">google</a>, <a href="http://sexywp.com/tags/tools" title="tools" rel="tag">tools</a>, <a href="http://sexywp.com/tags/web" title="web" rel="tag">web</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/page-speed-family.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web服务器LiteSpeed</title>
		<link>http://sexywp.com/litespeed-web-server.htm</link>
		<comments>http://sexywp.com/litespeed-web-server.htm#comments</comments>
		<pubDate>Sun, 01 May 2011 00:31:57 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[introduction]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=427</guid>
		<description><![CDATA[LiteSpeed Web Server is the leading high-performance, high-scalability web server. It is completely Apache interchangeable so LiteSpeed Web Server can quickly replace a major bottleneck in your existing web delivery platform. With its comprehensive range of features and easy-to-use web administration console, LiteSpeed Web Server can help you conquer the challenges of deploying an effective web serving architecture. 

<span class="readmore"><a href="http://sexywp.com/litespeed-web-server.htm" title="Web服务器LiteSpeed">Keep Reading --- 390 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm&from=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinXP上搭建自己的SVN服务器</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwe-should-care-more-about-ieer.htm&from=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">我们应该更关心IE的用户</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmake-all-my-browsers-tested.htm&from=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">折磨一下浏览器们，哈哈</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>LiteSpeed Web Server is the leading high-performance, high-scalability web server. It is completely <a href="http://sexywp.com/tags/apache" class="st_tag internal_tag" rel="tag" title="标签 apache 下的日志">Apache</a> interchangeable so LiteSpeed Web Server can quickly replace a major bottleneck in your existing web delivery platform. With its comprehensive range of <a href="http://sexywp.com/tags/features" class="st_tag internal_tag" rel="tag" title="标签 features 下的日志">features</a> and easy-to-use web administration console, LiteSpeed Web Server can help you conquer the challenges of deploying an effective web serving architecture. </p>
<p>LiteSpeed是一款先进的高性能，高扩展性Web服务器。它和Apache是完全可互换的，所以，它可以快速替换您Web分发平台的瓶颈。它拥有丰富的特性和易用的Web管理控制台，可以帮助您克服高效部署web服务器架构时的挑战。<span id="more-427"></span></p>
<p>LiteSpeed Web Server has superior performance in terms of both raw speed and scalability. Our benchmarks demonstrate that it is more than 6 times faster than Apache. When serving static content, LiteSpeed surpasses well-respected content accelerators including thttpd, boa and TUX. When it comes to dynamic content, LiteSpeed is more than 50% faster in <a href="http://sexywp.com/tags/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">PHP</a> content delivery than Apache with mod_<a href="http://sexywp.com/tags/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a>. </p>
<p>无论是速度还是可扩展性，LiteSpeed有出众的表现。我们的benchmark表明，它比Apache快6倍。当伺服静态内容时，它能超越广受好评的内容加速器包括thttpd，boa和TUX。而处理动态内容时，它处理PHP内容比Apache配合mod_php要快超过50%。</p>
<p>Since its 3.0 release, LiteSpeed Web Server works flawlessly alongside web hosting control panels including cPanel, DirectAdmin, etc. as a drop-in Apache replacement. Easily increase PHP performance and security while doubling server capacity. LiteSpeed is the best choice for shared hosting service providers.</p>
<p>从3.0release开始，LiteSpeed可以与Web托管控制面板如cPanel，DirectAdmin等做到配合无间。它很轻易就可以提高PHP的性能和安全性，同时还能将server的能力扩容到两倍。它尤其适合共享托管服务提供商。</p>
<p>======罪恶分割线======</p>
<p>这是一款不怎么常见的Web服务器，至少我以前没有听说过，不过我发现，现在我的这个博客使用的就是这个Web服务器。<a href="http://www.litespeedtech.com/litespeed-web-server-editions.html">这个服务器是一款商业软件，但是提供免费的标准版</a>，与之相对应的是企业版，能够在高并发的情况下提供<a href="http://www.litespeedtech.com/web-server-performance-comparison-litespeed-2.1-vs.html">两倍左右于Apache的性能</a>。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm&from=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinXP上搭建自己的SVN服务器</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwe-should-care-more-about-ieer.htm&from=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">我们应该更关心IE的用户</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmake-all-my-browsers-tested.htm&from=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">折磨一下浏览器们，哈哈</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/introduction" title="introduction" rel="tag">introduction</a>, <a href="http://sexywp.com/tags/web-server" title="Web Server" rel="tag">Web Server</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/litespeed-web-server.htm/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>工作中常用的Linux命令集锦</title>
		<link>http://sexywp.com/linux-commands-used-when-working.htm</link>
		<comments>http://sexywp.com/linux-commands-used-when-working.htm#comments</comments>
		<pubDate>Tue, 12 Apr 2011 12:37:33 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[心得体会]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[usage]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=419</guid>
		<description><![CDATA[tcpdump —— 打印出通过网口流入流出的数据内容，用于网络协议调试

tcpdump就是大家嘴里常说的抓包工具，在linux命令行下，使用tcpdump，可以查看服务器特定端口进出的数据包内容。

tcpdump -X -s0 -i any udp port 12009

<span class="readmore"><a href="http://sexywp.com/linux-commands-used-when-working.htm" title="工作中常用的Linux命令集锦">Keep Reading --- 1186 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm&from=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mac OS X上如何实现到Linux主机的ssh免登陆</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm&from=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">VIM常用小窍门收集</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fword2007-doesnot-show-pics.htm&from=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips]Word2007中看不到图片</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fnetbeans-plugins-i-used.htm&from=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">NetBeans 中我选用的插件</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<h3>tcpdump —— 打印出通过网口流入流出的数据内容，用于网络协议调试</h3>
<p>tcpdump就是大家嘴里常说的抓包工具，在linux命令行下，使用tcpdump，可以查看服务器特定端口进出的数据包内容。<br />
<code>tcpdump -X -s0 -i any udp port 12009</code><span id="more-419"></span><br />
上述命令是我在工作中常用的一组参数组合，其含义如下：</p>
<ul>
<li>-X 将每个包打印成16进制形式和ASCII形式，调试新协议的时候非常方便</li>
<li>-sN 每个包显示的（截断）字节数，N代表字节数，填0代表64K，为UDP包最大长度，实际实践中UDP包长1500字节左右，如果调试的协议只关心包头，一般查看前128个字节即可，可以视情况而选择。</li>
<li>-i 代表interface，可以认为是网卡，any代表任意，也可以填eth0，eth1，代表以太网口</li>
<li>udp port 12009是表达式，例子的含义就是UDP协议，12009端口。</li>
</ul>
<p><code>tcpdump [ -adeflnNOpqStvx ] [ -c 数量 ] [ -F 文件名 ][ -i 网络接口 ] [ -r 文件名] [ -s snaplen ][ -T 类型 ] [ -w 文件名 ] [表达式 ]</code></p>
<p>如上是tcpdump命令的完整格式，具体每个参数的含义，可以参看linux的man。</p>
<p>这里简单谈谈最后的那个“表达式”，这个表达式的写法是非常灵活的，使得tcpdump像一个可自由编程的调试工具一样，强大异常。这里可以把表达式理解成是一种编程语言的语句。</p>
<ol>
<li>表达式 = 语句 语句 语句 ……</li>
<li>语句 = 修饰符 | 修饰符 内容</li>
</ol>
<p>不知道我上面的描述方式，是不是说清楚了表达式的结构，表达式是一个又一个原语（primitives）组成的，每个原语又是由修饰符和数据组成。数据可以数字或者id或者ip或者range等。</p>
<p>修饰符有很多种：</p>
<ol>
<li>类型--可以是host（后面跟主机名），net（后面跟ip地址），port（和面跟端口号），如果不指定，默认是host</li>
<li>方向--可以是src，src or dst，src and dst，dst，主要是源端还是目的端，如果不指定，默认是src or dst</li>
<li>协议--就比较多了，常用的就udp和tcp，其他的可以看参考</li>
</ol>
<p>现在再来看看我给的例子，udp port 12009，表示使用UDP协议的，通过12009端口的（进入和出去的）包都显示出来。</p>
<p>tcpdump这个工具还是比较难以记住的，Charels觉得还是要注意理解这个命令的功能和原理，然后在用到的时候，才能快速的找到准确的用法。</p>
<h3>netstat —— 打印网络连接，路由表，网络数据统计等功能</h3>
<p>netstat是Linux服务器上最常用的命令之一，一般我总是用这个命令来诊断一些问题：mysql是否已经成功启动？<a href="http://sexywp.com/tags/web" class="st_tag internal_tag" rel="tag" title="标签 web 下的日志">web</a> server是否已经成功启动？哪些进程在侦听哪些端口，建立了哪些连接？<br />
<code>netstat -npl</code><br />
这是我最常用的参数组合，n代表使用数字，哪个进程在哪个IP上侦听哪个端口，你看到的结果列表里，是192.168.26.128:3306这种形式的，这个例子里是mysql正常启动的状态，一般mysql启动后，会有一个进程侦听在3306端口上，如果不是用n参数，netstat会试图找出主机和程序的名字，会显示成localhost:mysql类似这样。<br />
p代表program，也即程序，到底是哪个程序在侦听端口呢？这个进程的id是多少？就是用这个参数来显示的。所以，np一般一起用，前面用n现实IP，后面用p显示程序的名字。<br />
l代表listen，代表让命令只列出正在侦听端口的进程，对于那些不活跃的则不显示，与l相对应的参数是a，代表all，表示列出所有的socket，不管是在侦听还是没在侦听的。<br />
其他的参数还有很多，比如i可以现实所有的网卡，s可以现实所有包的统计，但是因为使用场景较少，我就不介绍了，大家可以自己去看man，不爽看woman也行:)</p>
<h3>lsof —— 待续</h3>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm&from=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mac OS X上如何实现到Linux主机的ssh免登陆</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm&from=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">VIM常用小窍门收集</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fword2007-doesnot-show-pics.htm&from=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips]Word2007中看不到图片</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fnetbeans-plugins-i-used.htm&from=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">NetBeans 中我选用的插件</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/command" title="command" rel="tag">command</a>, <a href="http://sexywp.com/tags/linux" title="Linux" rel="tag">Linux</a>, <a href="http://sexywp.com/tags/tips" title="tips" rel="tag">tips</a>, <a href="http://sexywp.com/tags/usage" title="usage" rel="tag">usage</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/linux-commands-used-when-working.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yii框架的Log系统的分析</title>
		<link>http://sexywp.com/how-to-use-log-in-yii-framework.htm</link>
		<comments>http://sexywp.com/how-to-use-log-in-yii-framework.htm#comments</comments>
		<pubDate>Wed, 30 Mar 2011 17:00:21 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Yii]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[心得体会]]></category>
		<category><![CDATA[日　　记]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=418</guid>
		<description><![CDATA[昨天阅读了Yii框架中log部分的源代码，框架提供了灵活、强大的log功能，如果不是非常特殊的需求，框架中自带的类就已经能够满足一般的应用的需求了。实现log功能的源代码被存放在 framework/logging 目录下，这个目录下的代码都包含在包system.logging中。本文简要介绍一下我昨天阅读代码的所得。





<span class="readmore"><a href="http://sexywp.com/how-to-use-log-in-yii-framework.htm" title="Yii框架的Log系统的分析">Keep Reading --- 1988 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架中验证器的allowEmpty属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架base包代码分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/11/20/11182613.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架base包代码分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="工作中常用的Linux命令集锦" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>昨天阅读了Yii框架中log部分的源代码，框架提供了灵活、强大的log功能，如果不是非常特殊的需求，框架中自带的类就已经能够满足一般的应用的需求了。实现log功能的源代码被存放在 <a href="http://sexywp.com/tags/framework" class="st_tag internal_tag" rel="tag" title="标签 framework 下的日志">framework</a>/logging 目录下，这个目录下的代码都包含在包system.logging中。本文简要介绍一下我昨天阅读代码的所得。<span id="more-418"></span></p>
<table style="width:auto;">
<tr>
<td><a href="https://picasaweb.google.com/lh/photo/o9iXH2bPs0j6RS1aWaAt5A?feat=embedwebsite"><img src="https://lh5.googleusercontent.com/_QYicOeu89Bk/TZNMKYScKKI/AAAAAAAAB3E/ardNZrMAYFM/s640/class-graph.jpg" height="471" width="640" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right"><a href="https://picasaweb.google.com/TangChao.ZJU/Illustration?feat=embedwebsite">system.logging 包类结构图</a></td>
</tr>
</table>
<p>首先，来看一下这个图，这是Charles昨夜工作的结晶，研究了logging目录下一共九个文件中的类的关系。YiiBase，<a href="http://sexywp.com/tags/yii-2" class="st_tag internal_tag" rel="tag" title="标签 yii 下的日志">Yii</a>，CWebApplication不属于logging目录，但是为了说明这些类如何发生作用，也放在了这种图里。我的初衷，是要画一张标准的UML图的，无奈于本科的知识都还给老师了，所以这个图只能算是个四不像，大家凑合看一下，后面我会给自己补补课，后续的文章画得图会趋于规范的。</p>
<p>言归正传，左下角的类CLogger，是在开发过程中，打log时候，真正调用的类，这个类作为所有应用最最基础的组件，被包含在了YiiBase中，任何时候，在代码中调用Yii::getLogger()函数，会得到一个CLogger类的实例，这里用的是一个单件模式（Singleton）。打印log，只要调用其log()方法即可，这个方法有三个参数，第一个是log的内容，第二个是级别（warning，debug，fatal等），第三个category，可以叫类别，也可以视作是一种标识符，可以用于log的过滤。</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Blue;">Yii</span><span style="color: Gray;">::</span><span style="color: Blue;">getLogger</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">log</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">here is a debug info.</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">debug</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">app.siteController</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></div></div>
<p>上面的代码片段给出了一个打印log的范例，任何时候想打log，只要这样写就好。从上面的代码片段中，我们看到，log系统的调用接口是极其简单的。接下来分析一下大家非常关心的，log到底会被怎么处理的问题。</p>
<p>在框架中这个log系统里，负责打log，和负责记录log的是两个对象，他们被很好的解耦合了。CLogger扮演了一个专门生产log的角色，其任务就是将用户使用log()函数记录的log放到一个数组里，可以认为是一个内存buffer，长度可配置。在buffer满了的时候，会激发flush（如果配置了autoFlush）的话，flush就是冲掉的意思，如果内存buffer满了，则清空之，继续接受log信息。在清空log buffer之前，这个类对象会触发一个事件，就是onFlush事件，后续其他的类hook到这个onFlush事件上，就可以在log信息被清空之前，有所动作了。</p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Gray;">&nbsp;</span><span style="color: Green;">public</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">function</span><span style="color: Gray;"> </span><span style="color: Blue;">log</span><span style="color: Olive;">(</span><span style="color: #00008b;">$message</span><span style="color: Gray;">,</span><span style="color: #00008b;">$level</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">info</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #00008b;">$category</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">application</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Olive;">{</span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">$this-&gt;_logs就是一个数组，也即存放log信息的内存缓冲，默认10000行</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">_logs</span><span style="color: Olive;">[</span><span style="color: Olive;">]</span><span style="color: Gray;">=</span><span style="color: Green;">array</span><span style="color: Olive;">(</span><span style="color: #00008b;">$message</span><span style="color: Gray;">,</span><span style="color: #00008b;">$level</span><span style="color: Gray;">,</span><span style="color: #00008b;">$category</span><span style="color: Gray;">,</span><span style="color: Blue;">microtime</span><span style="color: Olive;">(</span><span style="color: Green;">true</span><span style="color: Olive;">)</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">_logCount</span><span style="color: Gray;">++;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">autoFlush</span><span style="color: Gray;">&gt;</span><span style="color: Maroon;">0</span><span style="color: Gray;"> &amp;&amp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">_logCount</span><span style="color: Gray;">&gt;=</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">autoFlush</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">flush</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span><span style="color: Gray;">; </span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">缓冲满了后，会调用flush</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Green;">public</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">function</span><span style="color: Gray;"> </span><span style="color: Blue;">flush</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">onFlush</span><span style="color: Olive;">(</span><span style="color: Green;">new</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">CEvent</span><span style="color: Olive;">(</span><span style="color: #00008b;">$this</span><span style="color: Olive;">)</span><span style="color: Olive;">)</span><span style="color: Gray;">; </span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">激发onFlush事件</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">_logs</span><span style="color: Gray;">=</span><span style="color: Green;">array</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span><span style="color: Gray;">; </span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">清空缓冲</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">_logCount</span><span style="color: Gray;">=</span><span style="color: Maroon;">0</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">?&gt;</span></li></ol></div></div>
<p>这是一个生产者与消费者的故事，以上讲述的是生产者的故事。接下来，讲消费者的故事。CLogger已经在内存中生产了log，那么接下来就要来收集，分析，处理这些log，该记录的记录，该抛弃的抛弃，该报警的报警。当然，你可以不给系统提供消费者，那些log产生了，然后消失了，基本不会带来什么负载和泄露，轻轻松松。</p>
<p>log的生产者是系统中必然存在的，但是log的消费者不是，是通过配置文件配置到系统中的，打开位于/protected/config/main.php的配置文件，在components段，我们可以看到关于log组件的配置，如下所示：</p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">log</span><span style="color: #8b0000;">'</span><span style="color: Gray;">=&gt;</span><span style="color: Green;">array</span><span style="color: Olive;">(</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #8b0000;">'</span><span style="color: Red;">class</span><span style="color: #8b0000;">'</span><span style="color: Gray;">=&gt;</span><span style="color: #8b0000;">'</span><span style="color: Red;">CLogRouter</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #8b0000;">'</span><span style="color: Red;">routes</span><span style="color: #8b0000;">'</span><span style="color: Gray;">=&gt;</span><span style="color: Green;">array</span><span style="color: Olive;">(</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">array</span><span style="color: Olive;">(</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #8b0000;">'</span><span style="color: Red;">class</span><span style="color: #8b0000;">'</span><span style="color: Gray;">=&gt;</span><span style="color: #8b0000;">'</span><span style="color: Red;">CFileLogRoute</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #8b0000;">'</span><span style="color: Red;">levels</span><span style="color: #8b0000;">'</span><span style="color: Gray;">=&gt;</span><span style="color: #8b0000;">'</span><span style="color: Red;">error, warning</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">)</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #ffa500;">//</span><span style="color: #ffa500;"> uncomment the following to show log messages on web pages</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #ffa500;">/*</span></li>
<li><span style="color: #ffa500;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; array(</span></li>
<li><span style="color: #ffa500;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'class'=&gt;'CWebLogRoute',</span></li>
<li><span style="color: #ffa500;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ),</span></li>
<li><span style="color: #ffa500;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #ffa500;">*/</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">)</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">)</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">?&gt;</span></li></ol></div></div>
<p>负责采集处理log的真正对象，是一组以Route结尾的类，在上面类图中，位于右上角的那5个类。它们各有个的功能，发邮件的，写文件的，写Db的等等。前面也提了，对于一堆log，可能各自要使用不同的方法处理，比如debug信息抛弃，info信息记录在文件，而fatal信息发邮件给管理员，一个系统中很可能有这样那样的需求。所以，被以组件形式装进应用中的，并不是Route，而是类图中叫CLogRouter的对象。</p>
<p>对log的各种处理方法，都继承自一个叫CLogRoute的抽象类，提供了统一的调用接口，CLogRouter就是这些route的管理者，它主要负责的就是在onFlush事件发生的时候，把CLogger生产的log都接过来，然后，逐一地交付给自己旗下的Route们，分别处理。从上面的配置信息里，我们可以看到，LogRouter管理多少个Route也是通过配置文件配置的，也即route是router所依赖的组件。在具体开发过程中，你可以只配置一个，也可以配置一群。这种行为特征，真的有点像路由，怪不得叫router和route，我猜就这么个解释。</p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Gray;">&nbsp;</span><span style="color: Green;">public</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">function</span><span style="color: Gray;"> </span><span style="color: Blue;">collectLogs</span><span style="color: Olive;">(</span><span style="color: #00008b;">$event</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$logger</span><span style="color: Gray;">=</span><span style="color: Blue;">Yii</span><span style="color: Gray;">::</span><span style="color: Blue;">getLogger</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">foreach</span><span style="color: Olive;">(</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">_routes</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">as</span><span style="color: Gray;"> </span><span style="color: #00008b;">$route</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">{</span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">Router向每个route分发log，请求处理</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: #00008b;">$route</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">enabled</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$route</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">collectLogs</span><span style="color: Olive;">(</span><span style="color: #00008b;">$logger</span><span style="color: Gray;">,</span><span style="color: Green;">false</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Green;">public</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">function</span><span style="color: Gray;"> </span><span style="color: Blue;">processLogs</span><span style="color: Olive;">(</span><span style="color: #00008b;">$event</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$logger</span><span style="color: Gray;">=</span><span style="color: Blue;">Yii</span><span style="color: Gray;">::</span><span style="color: Blue;">getLogger</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">foreach</span><span style="color: Olive;">(</span><span style="color: #00008b;">$this</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">_routes</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">as</span><span style="color: Gray;"> </span><span style="color: #00008b;">$route</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">{</span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">Router向每个route分发log，请求处理</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Olive;">(</span><span style="color: #00008b;">$route</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">enabled</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">$route</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">collectLogs</span><span style="color: Olive;">(</span><span style="color: #00008b;">$logger</span><span style="color: Gray;">,</span><span style="color: Green;">true</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">?&gt;</span></li></ol></div></div>
<p>在操作实践中，我们完全可以自己继承CLogRoute，实现collectLogs方法，可以开发譬如名为NetLogRoute的类，将log从网络端口上以UDP包或者通过TCP连接形式发送到网络上专门的log服务器中，也可以开发名为MobileLogRoute的类，用来给管理员发送手机报警短信。</p>
<p>上面一直没有介绍到的Filter，其作用其实可以顾名思义，就是在log处理的时候，过滤用的，可以根据前文提到的category参数来过滤，也可以根据log等级类过滤，等等等等。Filter也是通过参数配置的形式被插入到route中的，完全可以创建自己特有的filter通过配置来替换默认filter，可以说，将灵活性发挥到了极致。不过，灵活还是有牺牲的，比如我就觉得，如果一个router下面挂上N个route之后，每个route都采用特定的filter，则会造成同一批log（10000条）被过滤的N遍。所以，比较好的模式，可能还是一个router，下面一个route，然后可以选择用或者不用filter，挂多个虽然理论可行，但是从实际代码来看，可能有一定性能损耗。</p>
<p>好了，终于啰嗦完了，最后问个问题，整个logging系统的这种结构，到底是哪一种设计模式呢？欢迎交流哈～</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架中验证器的allowEmpty属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架base包代码分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/11/20/11182613.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架base包代码分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="工作中常用的Linux命令集锦" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/framework" title="framework" rel="tag">framework</a>, <a href="http://sexywp.com/tags/source-code" title="source code" rel="tag">source code</a>, <a href="http://sexywp.com/tags/yii-2" title="yii" rel="tag">yii</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/how-to-use-log-in-yii-framework.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>视频教程：使用Yii框架开发Blog</title>
		<link>http://sexywp.com/video-guide-to-use-yii-framework.htm</link>
		<comments>http://sexywp.com/video-guide-to-use-yii-framework.htm#comments</comments>
		<pubDate>Sun, 20 Mar 2011 06:59:18 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Yii]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[develop]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=417</guid>
		<description><![CDATA[Yii框架的官方网站上，有一个教学用demo，就是使用Yii框架开发一个blog。有非常详尽的文字描述，步骤基本也比较清楚。一遍走下来，基本上就差不多都学懂了。

上周正好要在公司做分享，害怕当堂演示会说不好，浪费时间，就在家里自己将blog的开发过程录制成了视频，这是我第一次录制视频，觉得格外新鲜，遂决定在这里分享给大家。大家一起乐一乐，O(∩_∩)O哈哈~

第0集 Blog功能需求及应用骨架搭建

<span class="readmore"><a href="http://sexywp.com/video-guide-to-use-yii-framework.htm" title="视频教程：使用Yii框架开发Blog">Keep Reading --- 303 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架中验证器的allowEmpty属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Gii时出现403错误" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm&from=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Gii时出现403错误</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架base包代码分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm&from=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/11/20/11182613.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架base包代码分析</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Yii框架的官方网站上，有一个教学用demo，就是使用Yii框架开发一个blog。有非常详尽的文字描述，步骤基本也比较清楚。一遍走下来，基本上就差不多都学懂了。</p>
<p>上周正好要在公司做分享，害怕当堂演示会说不好，浪费时间，就在家里自己将blog的开发过程录制成了视频，这是我第一次录制视频，觉得格外新鲜，遂决定在这里分享给大家。大家一起乐一乐，O(∩_∩)O哈哈~<span id="more-417"></span></p>
<p>第0集 Blog功能需求及应用骨架搭建<br />
<embed src="http://player.youku.com/player.php/sid/XMjUyMjIxMDE2/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed></p>
<p>第1集 使用Gii代码生成工具<br />
<embed src="http://player.youku.com/player.php/sid/XMjUyMjI5MTI0/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed></p>
<p>第2集 使用数据库存储的用户信息来验证用户身份<br />
<embed src="http://player.youku.com/player.php/sid/XMjUyMjMzODc2/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed></p>
<p>第3集 Blog文章的创建和发布<br />
<embed src="http://player.youku.com/player.php/sid/XMjczMTc1Nzk2/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed><br />
to be continued...</p>
<p>多谢大家捧场了，欢迎留言告诉我大家是否喜欢这种形式~</p>
<p>最近新录了一个视频，不过不是关于blog demo的，是关于db部分的分析的，也一并放在这里吧，算是借点这里的人气了：）2012-1-27<br />
<embed src='http://player.youku.com/player.php/sid/XMzQ2NDM1NzUy/v.swf' quality='high' width='480' height='400' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash'></embed></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架中验证器的allowEmpty属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Gii时出现403错误" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm&from=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Gii时出现403错误</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架base包代码分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-package-base-source-code-analysis.htm&from=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/11/20/11182613.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架base包代码分析</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/develop" title="develop" rel="tag">develop</a>, <a href="http://sexywp.com/tags/framework" title="framework" rel="tag">framework</a>, <a href="http://sexywp.com/tags/php" title="PHP" rel="tag">PHP</a>, <a href="http://sexywp.com/tags/video" title="video" rel="tag">video</a>, <a href="http://sexywp.com/tags/yii-2" title="yii" rel="tag">yii</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/video-guide-to-use-yii-framework.htm/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>MVC最佳实践</title>
		<link>http://sexywp.com/mvc-best-practice.htm</link>
		<comments>http://sexywp.com/mvc-best-practice.htm#comments</comments>
		<pubDate>Mon, 07 Mar 2011 09:44:39 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Yii]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=414</guid>
		<description><![CDATA[前一段日子，写了一篇《MVC就是一个选择题》，重点描述了我对MVC模式的迷惑。随着我对这个模式应用时间的深入，渐渐感到得心应手，这个模式早在30多年前就已经发明了，确实经受了时间的考验，可以说是千锤百炼。但是，实践过程中，我也发现，更多的时候照猫画虎还是有很多弊端的，想要真正做好MVC的选择题，必须在项目中不断犯错误，不断修正，才能逐渐走上正轨。我参加的项目主要运用了Yii框架，是目前比较流行的一个Web开发框架。随着前不久，1.1.6版本的发布，我发现Yii框架的文档中，多了一篇MVC最佳实践的文章。我想，这个文章对于初学者来说，应该具备相当的指导性，而且指导相当具体。如果也有跟我相同的迷茫，应该好好钻研一下这篇文章，并且身体力行去验证之，这里给出链接。我在这篇文章中，就是概括简述一下那篇文档的内容。

<span class="readmore"><a href="http://sexywp.com/mvc-best-practice.htm" title="MVC最佳实践">Keep Reading --- 1394 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架中验证器的allowEmpty属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC就是个选择题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC就是个选择题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Dedian 5的PHP包缺少readline支持" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>前一段日子，写了一篇《<a href="http://sexywp.com/mvc-chose-where-to-put-your-code.htm">MVC就是一个选择题</a>》，重点描述了我对MVC模式的迷惑。随着我对这个模式应用时间的深入，渐渐感到得心应手，这个模式早在30多年前就已经发明了，确实经受了时间的考验，可以说是千锤百炼。但是，实践过程中，我也发现，更多的时候照猫画虎还是有很多弊端的，想要真正做好MVC的选择题，必须在项目中不断犯错误，不断修正，才能逐渐走上正轨。我参加的项目主要运用了Yii框架，是目前比较流行的一个Web开发框架。随着前不久，1.1.6版本的发布，我发现Yii框架的文档中，多了一篇MVC最佳实践的文章。我想，这个文章对于初学者来说，应该具备相当的指导性，而且指导相当具体。如果也有跟我相同的迷茫，应该好好钻研一下这篇文章，并且身体力行去验证之，<a href="http://www.yiiframework.com/doc/guide/1.1/en/basics.best-practices">这里给出链接</a>。我在这篇文章中，就是概括简述一下那篇文档的内容。<span id="more-414"></span></p>
<p>MVC的核心理念是代码的重用和关注点的分离（Separation of concern 我个人对这个理解就是将数据和表现进行分离）。如何正确遵循MVC的原理来编写代码是有一些基本指导原则可以遵循的。为了便于理解后面将要叙述的指导原则，我们这里认为一个典型的Web应用由以下几个子应用（部分）组成：</p>
<ul>
<li>前端——网站界面，面向普通用户</li>
<li>后台——一部分有管理权限的用户用于维护Web应用的正常运转</li>
<li>控制台——在终端中执行的命令，或者是定时任务如cronjob，用于日常运维</li>
<li>API——用于第三方合作，或者二次开发</li>
</ul>
<h3>Model</h3>
<p>模型用于表示底层数据结构，经常在整个应用的不同部分共享，有些模型在前后台、API中都会用到，所以一个模型应该遵循的指导原则有：</p>
<ul>
<li>包含属性用于描述特定的数据</li>
<li>应该包含业务逻辑，以确保数据能够满足表现的需要</li>
<li>应该包含数据操作的代码，比如数据存储、检索</li>
<li>不应该使用$_GET $_POST这样的只有在前端才会出现的数组，在控制台和API用到时候，可能就无法复用了</li>
<li>不应该出现HTML代码，负责表现的代码应该放到view文件中</li>
</ul>
<p>在上述指导原则下，可能会写出非常庞大的Model类（过多数据操作，业务逻辑代码包含其中）。这种情况下，建议进一步抽象，提炼出一个基类，包含最通用的功能，然后前端、后端和API在用到时候，将各个子应用才相关的逻辑放到基类继承出来的子类里面。</p>
<h3>View</h3>
<p>视图主要就用于前端表现的代码。</p>
<ul>
<li>包含HTML，以及所有负责表现的代码，可以出现PHP，但是只用于遍历数据、格式化数据</li>
<li>不应该包含DB请求</li>
<li>不应该出现引用$_GET $_POST这类数组的代码，这应该是Controller的工作。View只是专注于表现，布局等和页面呈现有关的业务，用户的请求数据应该由Controller和Model负责处理</li>
<li>如果必要，可以访问Model和Controller的属性，不过这是为了满足表现的需要</li>
</ul>
<p>可以使用诸如布局、部分视图、<a href="http://sexywp.com/tags/html" class="st_tag internal_tag" rel="tag" title="标签 html 下的日志">HTML</a> Helper类、Widget等框架特性来最大程度重用View的代码。</p>
<h3>Controller</h3>
<p>控制器是将模型、视图和其他组件组装在一起形成一个应用的粘合剂。控制器直接负责处理终端用户的请求。</p>
<ul>
<li>可以访问$_GET $_POST这样的用户请求数组</li>
<li>创建模型，并决定一个模型对象的生命周期</li>
<li>不应该出现SQL语句，数据库请求应该放到Model中</li>
<li>不应该出现HTML代码，而应该将其放入到View中</li>
</ul>
<p>在一个设计良好的MVC应用中，控制器是非常轻量级的，经常只有几十行代码的样子；而Model总是非常复杂而且庞大，包含了所有的用于表现的数据及其操作方法。这是因为由数据结构和业务逻辑组成的模型对每个应用来说，都是独特的，需要大量的定制化工作来满足应用的需求；控制器的逻辑经常遵循一个特定的套路，在各个应用中都差不多，因此可以被框架底层代码极大程度地简化（也就是说不是控制器代码少，而是Web开发框架已经都抽象出来并且都帮你做好了，这也就是框架的价值和能够实现快速开发的原因）。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架中验证器的allowEmpty属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC就是个选择题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC就是个选择题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Dedian 5的PHP包缺少readline支持" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/mvc" title="MVC" rel="tag">MVC</a>, <a href="http://sexywp.com/tags/programming" title="programming" rel="tag">programming</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/mvc-best-practice.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MVC就是个选择题</title>
		<link>http://sexywp.com/mvc-chose-where-to-put-your-code.htm</link>
		<comments>http://sexywp.com/mvc-chose-where-to-put-your-code.htm#comments</comments>
		<pubDate>Thu, 30 Dec 2010 06:04:28 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[心得体会]]></category>
		<category><![CDATA[design pattern]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=412</guid>
		<description><![CDATA[由于采用了Web开发框架来开发项目，所以我首次在真正的项目中采用MVC的开发模式。随着项目的不断深入，我也在不断反思，MVC设计模式到底给项目带来了什么？成倍的开发时间？复杂无比的目录结构？铺天盖地的文件数量？听起来都很难听对吗，但是确实如此。那么MVC所许诺的那些好处呢？清晰的代码结构，易于维护，易于扩展？真有吗？

当然，我不是在批判MVC，只是觉得，在使用MVC过程中，还是需要投入更深入的思考，到底怎样才能用好这个设计模式。MVC给我的感觉是，要求使用其的开发者有更高的觉悟，来正确选择存放一段代码的地方。从而实现解耦合，代码复用，和易于维护。为什么说使用MVC会有成倍的开发时间，主要就是因为在开发中，我们需要更多的时间去思考，这些代码放在哪里更合理一些。在MVC框架下代码被切割成一个又一个的小文件，分散在复杂的目录树中，那么到底怎样选择把代码写在哪里呢？这道选择题，并非有看起来那么容易。就我个人感受而言，更多的时候，无论将代码放在哪里都可以正确实现你的逻辑，MVC不是什么神兵利器，并不能通过其模式本身的约束，将开发者导入到一个正确的轨道上，反而会因为开发者本身错误的选择而让MVC自己变得一团糟。所以说，当一个团队确定要在一个项目中引入MVC时候，应该思考一下，每个团队成员是不是真的都有能力驾驭，如果没有对应的能力话，是不是要考虑前期对项目成员进行一定的培训。

<span class="readmore"><a href="http://sexywp.com/mvc-chose-where-to-put-your-code.htm" title="MVC就是个选择题">Keep Reading --- 1444 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">MVC最佳实践</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">ExtJS 4 的MVC</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">给SVN客户端配置代理服务器</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">VIM常用小窍门收集</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>由于采用了Web开发框架来开发项目，所以我首次在真正的项目中采用MVC的开发模式。随着项目的不断深入，我也在不断反思，MVC设计模式到底给项目带来了什么？成倍的开发时间？复杂无比的目录结构？铺天盖地的文件数量？听起来都很难听对吗，但是确实如此。那么MVC所许诺的那些好处呢？清晰的代码结构，易于维护，易于扩展？真有吗？<span id="more-412"></span></p>
<p>当然，我不是在批判MVC，只是觉得，在使用MVC过程中，还是需要投入更深入的思考，到底怎样才能用好这个设计模式。MVC给我的感觉是，要求使用其的开发者有更高的觉悟，来正确选择存放一段代码的地方。从而实现解耦合，代码复用，和易于维护。为什么说使用MVC会有成倍的开发时间，主要就是因为在开发中，我们需要更多的时间去思考，这些代码放在哪里更合理一些。在MVC框架下代码被切割成一个又一个的小文件，分散在复杂的目录树中，那么到底怎样选择把代码写在哪里呢？这道选择题，并非有看起来那么容易。就我个人感受而言，更多的时候，无论将代码放在哪里都可以正确实现你的逻辑，MVC不是什么神兵利器，并不能通过其模式本身的约束，将开发者导入到一个正确的轨道上，反而会因为开发者本身错误的选择而让MVC自己变得一团糟。所以说，当一个团队确定要在一个项目中引入MVC时候，应该思考一下，每个团队成员是不是真的都有能力驾驭，如果没有对应的能力话，是不是要考虑前期对项目成员进行一定的培训。</p>
<p>可能我说得话很装逼，但是我绝对不敢以一个专家的身份站到这里来说话，我只是一个初学者，我要把我的学习感受说出来。现在回归到MVC上，Controller给我的印象是一个协调者的形象，它知道谁能干什么，然后分配任务，构造哪个对象，初始化哪个视图，是Controller应该决定的事情。Model呢，应该是一个实干家的形象，负责所有肮脏而又细致的事情，所以我在编码实践中，将所有的业务逻辑都塞进Model里面，对Controller，提供一个简单接口，对Views，输出纯数据。View则是一个消费者的形象，给其的数据都是纯粹的，直接显示即可以。以上是我对MVC这道选择题给出的一个答案，当然我不是很确定这样做很对。</p>
<p>我在项目中就看到过这样的代码，将Model做成了一个工具箱，实际上是一个有各种方法的对象，每个方法看起来也提供了简单的调用接口，实际跟Controller配合时候呢，由Controller来操纵功能，安排各个方法被调用的顺序。这等于是由Controller来执行业务逻辑，但是却又对其封装了每个步骤的细节。而我个人倾向于连业务逻辑也对Controller封装。这两种选择各有优劣，而实际上从短期也难看出来谁更胜一筹。甚至，等项目上线后，最终也没法发现哪个做法更优一点。</p>
<p>所以说，MVC真的就是一个选择题。你有多重选择来实现同一个目的。我列举的例子只是九牛一毛，在实际项目开发中，还面临着更多的选择问题。我想，到底怎样交出自己的答案，还是应该在实践过程中不断积累，不断优化。我们只要把握好一些原则，就可以让自己不要偏离航向太远。第一，可维护性，代码逻辑一目了然应该是写代码时候的第一追求，因为看别人的代码是非常痛苦的，甚至最后回头来看自己写过的代码可能都会很痛苦，保持代码一目了然才是最重要的，给别人，给自己节省下时间。第二，可复用性，写内聚度高的代码，减少依赖，判定很简单，我写的这个代码，拷贝到别的项目里，是不是直接就能用，时刻问自己这个问题，就能保持代码的高内聚度。第三，封装变化，这个原则总体来说很难把握住，我自己的体会就是尽可能提供一个强大的接口，如果XXX改变了，那么调用我写的函数是不是格式不变？如果你写的函数，一会儿增加个参数，一会减少个参数，那么所有调用的地方都会跟着变化修改。</p>
<p>就到此为止了，一些愚见，请大家指正。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">MVC最佳实践</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fextjs-4-mvc.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">ExtJS 4 的MVC</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">给SVN客户端配置代理服务器</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm&from=http%3A%2F%2Fsexywp.com%2Fmvc-chose-where-to-put-your-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">VIM常用小窍门收集</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/design-pattern" title="design pattern" rel="tag">design pattern</a>, <a href="http://sexywp.com/tags/mvc" title="MVC" rel="tag">MVC</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/mvc-chose-where-to-put-your-code.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[Tips] PHP中return的用法</title>
		<link>http://sexywp.com/php-return.htm</link>
		<comments>http://sexywp.com/php-return.htm#comments</comments>
		<pubDate>Sat, 27 Nov 2010 03:20:20 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=407</guid>
		<description><![CDATA[这两天，Charles研究Yii框架的使用，注意到Yii的配置文件，采用一种写法。如下：

&#160;&#160;/**

&#160; * 注释若干

<span class="readmore"><a href="http://sexywp.com/php-return.htm" title="[Tips] PHP中return的用法">Keep Reading --- 238 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fword2007-doesnot-show-pics.htm&from=http%3A%2F%2Fsexywp.com%2Fphp-return.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips]Word2007中看不到图片</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fphp-return.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhide-admin-bar-use-3-line-code.htm&from=http%3A%2F%2Fsexywp.com%2Fphp-return.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[WordPress Tips] 教你3行代码隐藏Admin Bar</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm&from=http%3A%2F%2Fsexywp.com%2Fphp-return.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP 5.3.x中弃用的特性 Deprecated</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Fphp-return.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>这两天，Charles研究Yii框架的使用，注意到Yii的配置文件，采用一种写法。如下：</p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Gray;">&nbsp;</span><span style="color: #ffa500;">/*</span><span style="color: #ffa500;">*</span></li>
<li><span style="color: #ffa500;">&nbsp; * 注释若干</span></li>
<li><span style="color: #ffa500;">&nbsp; * 以下是一个格式如config.php的文件</span></li>
<li><span style="color: #ffa500;">&nbsp; </span><span style="color: #ffa500;">*/</span></li>
<li><span style="color: Gray;">&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">return</span><span style="color: Gray;">&nbsp;</span><span style="color: Green;">array</span><span style="color: Olive;">(</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: #8b0000;">'</span><span style="color: Red;">config1</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> =&gt; </span><span style="color: #8b0000;">'</span><span style="color: Red;">some value</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: #8b0000;">'</span><span style="color: Red;">config2</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> =&gt; </span><span style="color: #8b0000;">'</span><span style="color: Red;">some value</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">?&gt;</span></li></ol></div></div>
<p>在这个文件中，直接就写了一个return，这个用法又一次突破了我的常识。特意查询了一下文档，里面这样描述的：</p>
<blockquote><p>
<strong>return</strong></p>
<p>If called from within a function, the return() statement immediately ends execution of the current function, and returns its argument as the value of the function call. return() will also end the execution of an eval() statement or script file.</p>
<p>If called from the global scope, then execution of the current script file is ended. If the current script file was include()ed or require()ed, then control is passed back to the calling file. Furthermore, if the current script file was include()ed, then the value given to return() will be returned as the value of the include() call. If return() is called from within the main script file, then script execution ends. If the current script file was named by the auto_prepend_file or auto_append_file <a href="http://sexywp.com/tags/configuration" class="st_tag internal_tag" rel="tag" title="标签 configuration 下的日志">configuration</a> options in <a href="http://sexywp.com/tags/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a>.ini, then that script file's execution is ended.
</p></blockquote>
<p>return语句可以终止函数执行那自不必说了，这里还提到了可以终止eval过程的进行，并且如果处于被include的文件中，还能使return的值成为include和require函数的返回值。这样写的好处是，一个语句就可以得到配置项的内容了。</p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Gray;">&nbsp;</span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">原来这样写</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">require</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">./config.php</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">function</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">test</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">$config</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: #00008b;">$config</span><span style="color: Olive;">[</span><span style="color: #8b0000;">'</span><span style="color: Red;">a</span><span style="color: #8b0000;">'</span><span style="color: Olive;">]</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">b</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Green;">echo</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">hello</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp; </span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">现在</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Green;">function</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">test</span><span style="color: Olive;">(</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: #00008b;">$config</span><span style="color: Gray;"> = </span><span style="color: Green;">require</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">./config.php</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: #00008b;">$config</span><span style="color: Olive;">[</span><span style="color: #8b0000;">'</span><span style="color: Red;">a</span><span style="color: #8b0000;">'</span><span style="color: Olive;">]</span><span style="color: Gray;">==</span><span style="color: #8b0000;">'</span><span style="color: Red;">b</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Green;">echo</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">hello</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">}</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">?&gt;</span></li></ol></div></div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fword2007-doesnot-show-pics.htm&from=http%3A%2F%2Fsexywp.com%2Fphp-return.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips]Word2007中看不到图片</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fphp-return.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhide-admin-bar-use-3-line-code.htm&from=http%3A%2F%2Fsexywp.com%2Fphp-return.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[WordPress Tips] 教你3行代码隐藏Admin Bar</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm&from=http%3A%2F%2Fsexywp.com%2Fphp-return.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP 5.3.x中弃用的特性 Deprecated</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Fphp-return.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/php" title="PHP" rel="tag">PHP</a>, <a href="http://sexywp.com/tags/tips" title="tips" rel="tag">tips</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/php-return.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dedian 5的PHP包缺少readline支持</title>
		<link>http://sexywp.com/let-php5-support-readline.htm</link>
		<comments>http://sexywp.com/let-php5-support-readline.htm#comments</comments>
		<pubDate>Fri, 12 Nov 2010 06:33:40 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[工作相关]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=404</guid>
		<description><![CDATA[命令行下，PHP有一个很有趣的功能，就是interactive mode，在这种模式下，用户可以使用php shell，很自如的运行各种php函数。只要在shell下执行php -a命令即可。但是这个模式需要readline支持。

在Debian 5下，通过官方源使用apt安装的php5，不支持readline，所以，就无法使用interactive mode了。搜索了下，找到了解决办法。参见：http://www.dotdeb.org/instructions/ 这可能是一个组织，专门支持在Debian下搭建Web服务系统。

<span class="readmore"><a href="http://sexywp.com/let-php5-support-readline.htm" title="Dedian 5的PHP包缺少readline支持">Keep Reading --- 212 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm&from=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP 5.3.x中弃用的特性 Deprecated</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp-return.htm&from=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips] PHP中return的用法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>命令行下，PHP有一个很有趣的功能，就是interactive mode，在这种模式下，用户可以使用php shell，很自如的运行各种php函数。只要在shell下执行php -a命令即可。但是这个模式需要readline支持。</p>
<p>在Debian 5下，通过官方源使用apt安装的php5，不支持readline，所以，就无法使用interactive mode了。搜索了下，找到了解决办法。参见：http://www.dotdeb.org/instructions/ 这可能是一个组织，专门支持在Debian下搭建Web服务系统。</p>
<p>首先打开source.list，添加两个源：</p>
<p>deb http://packages.dotdeb.org stable all<br />
deb-src http://packages.dotdeb.org stable all</p>
<p>然后update，然后safe-upgrade，会发现跟web server相关的软件包都升级了，包括apache， php，mysql等。升级完成后，再尝试php -a，哈哈，php shell出来了！！</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm&from=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP 5.3.x中弃用的特性 Deprecated</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp-return.htm&from=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips] PHP中return的用法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>该日志未加标签。]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/let-php5-support-readline.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何在Debian上安装PHPUnit</title>
		<link>http://sexywp.com/how-to-install-phpunit-on-debian.htm</link>
		<comments>http://sexywp.com/how-to-install-phpunit-on-debian.htm#comments</comments>
		<pubDate>Wed, 10 Nov 2010 09:55:28 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpunit]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=403</guid>
		<description><![CDATA[Debian上安装PHPUnit最方便的做法，就是使用apt-get或者aptitude，当然，如果你想安装最新版本的PHPUnit，那又另当别论了。

安装最新版本的PHPUnit，我推荐使用pear来安装，不过前提是首先要安装最新版本的pear，Debian源里的pear，版本低于1.8.1，不能安装最新版的PHPUnit。

好，下面的代码用来安装pear，然后是PHPUnit：

<span class="readmore"><a href="http://sexywp.com/how-to-install-phpunit-on-debian.htm" title="如何在Debian上安装PHPUnit">Keep Reading --- 206 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-install-phpunit-on-debian.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-install-phpunit-on-debian.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-install-phpunit-on-debian.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-install-phpunit-on-debian.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mac OS X上如何实现到Linux主机的ssh免登陆</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-install-phpunit-on-debian.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP 5.3.x中弃用的特性 Deprecated</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Debian上安装PHPUnit最方便的做法，就是使用apt-get或者aptitude，当然，如果你想安装最新版本的PHPUnit，那又另当别论了。</p>
<p>安装最新版本的PHPUnit，我推荐使用pear来安装，不过前提是首先要安装最新版本的pear，Debian源里的pear，版本低于1.8.1，不能安装最新版的PHPUnit。</p>
<p>好，下面的代码用来安装pear，然后是PHPUnit：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"># 这里我试了wget是不行的，好像不支持管道，所以用curl</li>
<li>curl http://pear.php.net/go-pear | php</li>
<li># 安装pear可能让你指定目录，从后来我的安装结果来看，我推荐目录$prefix选 /usr/local</li>
<li># ……省略若干安装过程，接着安装PHPUnit</li>
<li>pear channel-discover pear.phpunit.de</li>
<li>pear channel-discover components.ez.no</li>
<li>pear channel-discover pear.symfony-project.com</li>
<li>pear install phpunit/PHPUnit</li></ol></div>
<p>好了，大功告成！</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-install-phpunit-on-debian.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-install-phpunit-on-debian.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-install-phpunit-on-debian.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-install-phpunit-on-debian.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mac OS X上如何实现到Linux主机的ssh免登陆</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-install-phpunit-on-debian.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP 5.3.x中弃用的特性 Deprecated</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/debian" title="debian" rel="tag">debian</a>, <a href="http://sexywp.com/tags/howto" title="howto" rel="tag">howto</a>, <a href="http://sexywp.com/tags/linux" title="Linux" rel="tag">Linux</a>, <a href="http://sexywp.com/tags/php" title="PHP" rel="tag">PHP</a>, <a href="http://sexywp.com/tags/phpunit" title="phpunit" rel="tag">phpunit</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/how-to-install-phpunit-on-debian.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5.3.x中弃用的特性 Deprecated</title>
		<link>http://sexywp.com/deprecated-features-in-php-5-3.htm</link>
		<comments>http://sexywp.com/deprecated-features-in-php-5-3.htm#comments</comments>
		<pubDate>Wed, 10 Nov 2010 05:58:01 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[工作相关]]></category>
		<category><![CDATA[deprecated]]></category>
		<category><![CDATA[features]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=402</guid>
		<description><![CDATA[今天在服务器上检查PHP的版本，发现了一条提示，说在PHP配置文件中，使用#号作为注释标记是已经被弃用（Deprecated）的特性了。特地去了解了一下这个问题，原来从PHP 5.3.x开始起，有很多特性已经被不建议使用了。

我这里整理了一下我日常工作中会用到的一些，剩下的大家看指南好了。



<span class="readmore"><a href="http://sexywp.com/deprecated-features-in-php-5-3.htm" title="PHP 5.3.x中弃用的特性 Deprecated">Keep Reading --- 232 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp-return.htm&from=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips] PHP中return的用法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">MVC最佳实践</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天在服务器上检查PHP的版本，发现了一条提示，说在PHP配置文件中，使用#号作为注释标记是已经被弃用（<a href="http://sexywp.com/tags/deprecated" class="st_tag internal_tag" rel="tag" title="标签 deprecated 下的日志">Deprecated</a>）的特性了。特地去了解了一下这个问题，原来从PHP 5.3.x开始起，有很多特性已经被不建议使用了。</p>
<p>我这里整理了一下我日常工作中会用到的一些，剩下的大家看<a href="http://php.net/manual/en/migration53.deprecated.php">指南</a>好了。</p>
<ul>
<li>配置文件中，#开始的注释语句，可以现在可以使用//来注释，就像在代码里一样</li>
<li>session_register，session_unregister, session_is_registered函数，现在直接操作$_SESSION数组即可</li>
<li>split函数，这个函数可以使用preg_split来替代</li>
<li>使用new创建的对象不再需要使用引用来传递</li>
<li>调用函数时，使用引用传递参数也不推荐使用了</li>
</ul>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp5-pass-param-by-ref.htm&from=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【边学边用】PHP5函数参数的按引用传递</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flet-php5-support-readline.htm&from=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dedian 5的PHP包缺少readline支持</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fphp-return.htm&from=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips] PHP中return的用法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Fdeprecated-features-in-php-5-3.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">MVC最佳实践</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/deprecated" title="deprecated" rel="tag">deprecated</a>, <a href="http://sexywp.com/tags/features" title="features" rel="tag">features</a>, <a href="http://sexywp.com/tags/php" title="PHP" rel="tag">PHP</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/deprecated-features-in-php-5-3.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用Gii时出现403错误</title>
		<link>http://sexywp.com/error-403-occured-when-use-gii.htm</link>
		<comments>http://sexywp.com/error-403-occured-when-use-gii.htm#comments</comments>
		<pubDate>Wed, 10 Nov 2010 01:57:08 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Yii]]></category>
		<category><![CDATA[develop]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=400</guid>
		<description><![CDATA[在Yii框架中，使用Gii代码生成工具之前，首先要编辑好配置文件才能访问。一般，都是默认在本地环境安装了Yii框架，所以书里的范例写的时候，很多都没有提，要配置IP限制。我正好在学习过程中，使用了Linux虚拟机来学习Yii开发，结果配置完了，发现访问Gii时候出现403错误。在网上查了一下，可以检查一下自己的配置是否限制了IP。

&#160;&#160;'gii'=&#62;array(

&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;'class'=&#62;'system.gii.GiiModule',

<span class="readmore"><a href="http://sexywp.com/error-403-occured-when-use-gii.htm" title="使用Gii时出现403错误">Keep Reading --- 188 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用FirePHP辅助AJAX应用开发" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm&from=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用FirePHP辅助AJAX应用开发</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架中验证器的allowEmpty属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>在Yii框架中，使用Gii代码生成工具之前，首先要编辑好配置文件才能访问。一般，都是默认在本地环境安装了Yii框架，所以书里的范例写的时候，很多都没有提，要配置IP限制。我正好在学习过程中，使用了Linux虚拟机来学习Yii开发，结果配置完了，发现访问Gii时候出现403错误。在网上查了一下，可以检查一下自己的配置是否限制了IP。</p>
<div class="hl-surround"><div class="hl-main"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li>&nbsp;<span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">gii</span><span style="color: #8b0000;">'</span><span style="color: Gray;">=&gt;</span><span style="color: Green;">array</span><span style="color: Olive;">(</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">class</span><span style="color: #8b0000;">'</span><span style="color: Gray;">=&gt;</span><span style="color: #8b0000;">'</span><span style="color: Red;">system.gii.GiiModule</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">password</span><span style="color: #8b0000;">'</span><span style="color: Gray;">=&gt;</span><span style="color: #8b0000;">'</span><span style="color: Red;">123456</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #ffa500;">//</span><span style="color: #ffa500;">书上的例子没有下面这行，要在数组里添加访问Gii的宿主机IP</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #8b0000;">'</span><span style="color: Red;">ipFilters</span><span style="color: #8b0000;">'</span><span style="color: Gray;">=&gt;</span><span style="color: Green;">array</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">localhost</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">192.168.26.1</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Olive;">)</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">?&gt;</span></li></ol></div></div>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="视频教程：使用Yii框架开发Blog" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvideo-guide-to-use-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9170385.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">视频教程：使用Yii框架开发Blog</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架的Log系统的分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-log-in-yii-framework.htm&from=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/22/9184865.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架的Log系统的分析</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用FirePHP辅助AJAX应用开发" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm&from=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用FirePHP辅助AJAX应用开发</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="MVC最佳实践" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmvc-best-practice.htm&from=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC最佳实践</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Yii框架中验证器的allowEmpty属性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Ferror-403-occured-when-use-gii.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/develop" title="develop" rel="tag">develop</a>, <a href="http://sexywp.com/tags/framework" title="framework" rel="tag">framework</a>, <a href="http://sexywp.com/tags/php" title="PHP" rel="tag">PHP</a>, <a href="http://sexywp.com/tags/yii-2" title="yii" rel="tag">yii</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/error-403-occured-when-use-gii.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于QQ和360我想说的几点东西</title>
		<link>http://sexywp.com/something-about-qq-360.htm</link>
		<comments>http://sexywp.com/something-about-qq-360.htm#comments</comments>
		<pubDate>Thu, 04 Nov 2010 11:34:18 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[360]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[qq]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=390</guid>
		<description><![CDATA[1. 当初我为什么要用360？

因为一开始我就知道，周鸿祎是所有流氓软件、恶意软件的始作俑者，我认为流氓老祖改行做警察，相当于反水，那么查杀能力应该比较出色。虽然我不知道所有其他流氓都死绝后，会怎么样，但是那是以后的事情。

2. 现在我为什么不用360？

<span class="readmore"><a href="http://sexywp.com/something-about-qq-360.htm" title="关于QQ和360我想说的几点东西">Keep Reading --- 1619 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm&from=http%3A%2F%2Fsexywp.com%2Fsomething-about-qq-360.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">20101103 今天犯了好几个严重低级错误</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flucene-note-06.htm&from=http%3A%2F%2Fsexywp.com%2Fsomething-about-qq-360.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Lucene笔记06</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flucene-note-04.htm&from=http%3A%2F%2Fsexywp.com%2Fsomething-about-qq-360.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Lucene笔记04</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flucene-note-03.htm&from=http%3A%2F%2Fsexywp.com%2Fsomething-about-qq-360.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Lucene笔记03</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-make-java-task-scheduled-excecute.htm&from=http%3A%2F%2Fsexywp.com%2Fsomething-about-qq-360.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">如何让Java程序定时运行</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>1. 当初我为什么要用360？</p>
<p>因为一开始我就知道，周鸿祎是所有流氓软件、恶意软件的始作俑者，我认为流氓老祖改行做警察，相当于反水，那么查杀能力应该比较出色。虽然我不知道所有其他流氓都死绝后，会怎么样，但是那是以后的事情。</p>
<p>2. 现在我为什么不用360？</p>
<p>很简单，我是一个喜欢清净的人，当360开始越来越多的“善意提示”的时候，他已经被我列入了黑名单。开机速度，拦截了什么，什么有风险等等，各类消息层出不穷。我觉得一款真正贴心的杀毒软件，应该静默。杀掉该杀的，留下正直的，遇上可疑的，也要靠自己的能力“艰难的”去判断，而不是把这些见鬼的选择题留给用户，是杀掉？删掉？隔离？修复？四选一，不是那么好做的。而且我很烦这个套路，难道让杀软用户为自己的选择负责么？？那要你干什么？</p>
<p>3. QQ有没有扫描用户的隐私？</p>
<p>这个问题真的很好，腾讯对这个问题也一直回避。因为这个问题真的很难回答。我谈一点个人看法。</p>
<p>第一，怎么定义隐私。其实聊天记录是相当隐私的东西，腾讯已经完全掌握了所有人的聊天记录。我想这是没法子的事情。所以，隐私的定义就比较暧昧。其实，我来定义的话，就是我不想被别人随便知道的那些东西，就是真正的隐私了。</p>
<p>第二，关于扫描。QQ到底有没有扫描用户磁盘？我个人认为，QQ是扫描了的。主要扫描什么呢？盗号木马，系统环境，比如你用什么系统Win，还是别的，哪个版本，XP还是Win 7，浏览器是什么，IE？Firefox？还是别的。这些估计都要扫描的，不扫不知道。而且，也必须知道。360呢，它更加扫描了，所有的磁盘文件，它都要扫描，不过大家觉得好像360是正义的，因为它是杀软，当然可以扫描。</p>
<p>第三，有没有上传？关于这一点，我没有什么直接证据。但是我想说，腾讯没必要干这个事情。我先前已经说了，聊天记录就是最大的隐私了，里面什么都有可能有，很多人聊天的时候来回报卡号，密码，身份证，都有。有了聊天记录，QQ有了一切。那么为什么要上传用户文件呢？我百思不得其解。假设，我是说，假设上传了，那么腾讯必须解决这么几个问题，存放问题，3亿活跃用户的海量文件，存在哪里呢？？难啊，做免费网络硬盘已经成本很高了。现在还要保存用户隐私文件，要消耗巨量的成本，腾讯是傻子么？？好，如果不保存，那么传上来干什么呢？那势必要分析，分析完了丢弃。那么难题来了，怎么分析呢？学过一点点计算机的人可能都知道，写一个程序有多麻烦。更不要提写一个分析各种用户文档形成有用数据的程序了。大家骂腾讯是个没技术，没创新的山寨公司时候很起劲，那么这个时候为什么又认为腾讯有能力分析那么海量的数据了呢？有那个能力，不会把搜搜做好一点去抢google饭碗吗？何必跟用户的私人文件过不去？</p>
<p>我说这么多，无非想说，不管这个事情有还是没有，它本来就不符合逻辑。大家自己可以好好判断。</p>
<p>第四，关于监控。我估计，这不是谁都敢谈的话题。我也不想多谈。我只想说，在中国，不监控可能么？虽然我也没有什么直接证据说明QQ监控了，或者没监控。但是想想应该不难推理的。你们懂的。</p>
<p>最后，是一个很好的建议：</p>
<p>如果大家觉得聊天内容本就无关紧要，那么请继续使用网络聊天。否则，请放弃网络聊天，只打电话，或者面谈。</p>
<p>如果大家继续选择网络聊天，那么我觉得选择QQ是完全可以的，因为你本就不在乎被知道些什么。</p>
<p>如果大家非要觉得QQ是邪恶的，那么不选择QQ也是完全没问题的。不会伤害我的感情。不过，我希望大家不要选择使用MSN。那样才会让我痛心。基于几个理由：</p>
<p>1，MSN是个很烂的软件，登录困难，广告难缠，体验差劲，功能缺失。</p>
<p>2，MSN采用明文传输聊天内容，等同于你的聊天内容在互联网上裸奔，没任何安全可言。</p>
<p>3，MSN也不是一个开放架构，而且还是另一个超级流氓微软的产品，曾经做过捆绑到Windows里，视图抹杀一切IM软件的邪恶事情。</p>
<p>那么我来给大家推荐一款很好的QQ替代品，那就是GTalk。</p>
<p>1. google出品，信誉保证。</p>
<p>2. 开放协议，保证透明。</p>
<p>3. 无穷多客户端，手机上至少10种客户端，pc上更是无穷多客户端，还有web版，那就是GMail。</p>
<p>4. 聊天内容加密传输，保护隐私。</p>
<p>最后，希望大家在网上冲浪愉快。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm&from=http%3A%2F%2Fsexywp.com%2Fsomething-about-qq-360.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">20101103 今天犯了好几个严重低级错误</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flucene-note-06.htm&from=http%3A%2F%2Fsexywp.com%2Fsomething-about-qq-360.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Lucene笔记06</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flucene-note-04.htm&from=http%3A%2F%2Fsexywp.com%2Fsomething-about-qq-360.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Lucene笔记04</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flucene-note-03.htm&from=http%3A%2F%2Fsexywp.com%2Fsomething-about-qq-360.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Lucene笔记03</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-make-java-task-scheduled-excecute.htm&from=http%3A%2F%2Fsexywp.com%2Fsomething-about-qq-360.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">如何让Java程序定时运行</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/360" title="360" rel="tag">360</a>, <a href="http://sexywp.com/tags/privacy" title="privacy" rel="tag">privacy</a>, <a href="http://sexywp.com/tags/qq" title="qq" rel="tag">qq</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/something-about-qq-360.htm/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>20101103 今天犯了好几个严重低级错误</title>
		<link>http://sexywp.com/20101103-green-hand-sucks.htm</link>
		<comments>http://sexywp.com/20101103-green-hand-sucks.htm#comments</comments>
		<pubDate>Wed, 03 Nov 2010 02:24:11 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=389</guid>
		<description><![CDATA[工作有半年多了，一直顺风顺水，今天一下子接连犯了几个严重的错误。记录下来，时刻惊醒。

1. 执行删除文件操作，一定要备份，应该让备份过程内化到自己的本质中去。以前在自己的电脑上，想怎么折腾，怎么折腾，文件丢了也没什么大不了，现在到了工作岗位，所有的文件都很重要，其中有些甚至关乎客户，文件数据直接等同于金钱，不能随便删除。这次我犯的错误只是丢失了服务器的log，后果还不是特别严重，估计产品经理会帮我掩盖过去，如果捅到用户那里，不追究就好，追究的话，我就得背一个事故在身上了。

2. 使用*NIX的crontab运行定时任务的时候，一定要使用绝对路径。这个错误实在是太低级了，我感觉自己就像个白痴。说明对Linux的理解，仍旧是一个小白级别的。正是因为填错了路径，造成我上面干的蠢事，把服务器log丢失了。以后执行任何自动化脚本，应该尽量使用绝对路径。这个也要内化到自己的本质中。本来自动化脚本就是写好了不用动的东西，为什么要偷懒少写一点路径呢？？蠢死了，路径用变量存储，已经非常省事了，还要再偷那么一点懒干什么呢？相对路径害死人啊。

<span class="readmore"><a href="http://sexywp.com/20101103-green-hand-sucks.htm" title="20101103 今天犯了好几个严重低级错误">Keep Reading --- 659 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm&from=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache虚拟主机</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdonot-use-peekchar-detect-eof.htm&from=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">不要使用PeekChar()判断EOF</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdom4j-xml-toolkit-java.htm&from=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Java的开源XML工具包dom4j</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>工作有半年多了，一直顺风顺水，今天一下子接连犯了几个严重的错误。记录下来，时刻惊醒。</p>
<p>1. <strong>执行删除文件操作，一定要备份，应该让备份过程内化到自己的本质中去。</strong>以前在自己的电脑上，想怎么折腾，怎么折腾，文件丢了也没什么大不了，现在到了工作岗位，所有的文件都很重要，其中有些甚至关乎客户，文件数据直接等同于金钱，不能随便删除。这次我犯的错误只是丢失了服务器的log，后果还不是特别严重，估计产品经理会帮我掩盖过去，如果捅到用户那里，不追究就好，追究的话，我就得背一个事故在身上了。</p>
<p>2. <strong>使用*NIX的crontab运行定时任务的时候，一定要使用绝对路径。</strong>这个错误实在是太低级了，我感觉自己就像个白痴。说明对Linux的理解，仍旧是一个小白级别的。正是因为填错了路径，造成我上面干的蠢事，把服务器log丢失了。<strong>以后执行任何自动化脚本，应该尽量使用绝对路径。</strong>这个也要内化到自己的本质中。本来自动化脚本就是写好了不用动的东西，为什么要偷懒少写一点路径呢？？蠢死了，路径用变量存储，已经非常省事了，还要再偷那么一点懒干什么呢？相对路径害死人啊。</p>
<p>3. <strong>不能相信实习生。</strong>以前，作为一名实习生，我要求自己要可靠。我想每个实习生也对自己有所要求。但是，说白了，责任不会让任何实习生承担的。不管他们多么负责，也轮不到他们来承担任何责任。所以，你分发出去的任务，本质上都是你的责任。出了问题也要你负责。别人可以帮你做事，但是不会帮你承担责任。所以，不要相信实习生。其实我对实习生没意见，只是想说，一定要对自己负责。<strong>要把所有从自己身上分出去的事情，都当成是自己的事情。</strong></p>
<p><strong>引以为戒，引以为戒！！</strong></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm&from=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache虚拟主机</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdonot-use-peekchar-detect-eof.htm&from=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">不要使用PeekChar()判断EOF</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdom4j-xml-toolkit-java.htm&from=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Java的开源XML工具包dom4j</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>该日志未加标签。]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/20101103-green-hand-sucks.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用FirePHP辅助AJAX应用开发</title>
		<link>http://sexywp.com/use-firephp-in-ajax-development.htm</link>
		<comments>http://sexywp.com/use-firephp-in-ajax-development.htm#comments</comments>
		<pubDate>Mon, 25 Oct 2010 08:56:00 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[develop]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=387</guid>
		<description><![CDATA[FirePHP 一款非常方便强大的PHP、AJAX调试工具，基于Firebug的框架开发，可以算是Firebug的插件。该插件帮助用户将PHP的调试信息展示在Firebug的控制台标签内，而不是直接打印到页面上，这样就避免了在调试页面时破坏了页面的DOM结构。

FirePHP的调试信息主要通过HTTP的Response Headers来发送，所以不会和HTTP的包体混在一起，极大程度地方便了AJAX应用的开发调试，是AJAX开发调试的利器。

全文下载链接

<span class="readmore"><a href="http://sexywp.com/use-firephp-in-ajax-development.htm" title="使用FirePHP辅助AJAX应用开发">Keep Reading --- 168 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Google AJAX Libraries API替换WordPress自带的js库" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freplace-the-wp-js-lib-by-googleapi.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/23/9256004.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Google AJAX Libraries API替换WordPress自带的js库</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略(11)---在你的WP插件中使用AJAX" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-11.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略(11)---在你的WP插件中使用AJAX</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="怎样增加AJAX的可靠性呢？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-ajax-correctly.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">怎样增加AJAX的可靠性呢？</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 开发资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 开发资源</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>FirePHP 一款非常方便强大的PHP、AJAX调试工具，基于Firebug的框架开发，可以算是Firebug的插件。该插件帮助用户将PHP的调试信息展示在Firebug的控制台标签内，而不是直接打印到页面上，这样就避免了在调试页面时破坏了页面的DOM结构。</p>
<p>FirePHP的调试信息主要通过HTTP的Response Headers来发送，所以不会和HTTP的包体混在一起，极大程度地方便了AJAX应用的开发调试，是AJAX开发调试的利器。</p>
<p><a href="http://download.csdn.net/source/2819249" target="_blank">全文下载链接</a><br />
<a href="http://wenku.baidu.com/view/04f50d2ce2bd960590c6771f.html" target="_blank">百度文库在线阅读</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用NetBeans IDE 6.5作为WordPress的开发环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-netbeans-to-develop-wp.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/02/10636076.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用NetBeans IDE 6.5作为WordPress的开发环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Google AJAX Libraries API替换WordPress自带的js库" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Freplace-the-wp-js-lib-by-googleapi.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/23/9256004.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Google AJAX Libraries API替换WordPress自带的js库</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="插件开发全攻略(11)---在你的WP插件中使用AJAX" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-write-a-wp-plugin-11.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">插件开发全攻略(11)---在你的WP插件中使用AJAX</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="怎样增加AJAX的可靠性呢？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-ajax-correctly.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">怎样增加AJAX的可靠性呢？</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WordPress 开发资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwordpress-developer-resource.htm&from=http%3A%2F%2Fsexywp.com%2Fuse-firephp-in-ajax-development.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WordPress 开发资源</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/ajax" title="ajax" rel="tag">ajax</a>, <a href="http://sexywp.com/tags/develop" title="develop" rel="tag">develop</a>, <a href="http://sexywp.com/tags/development" title="development" rel="tag">development</a>, <a href="http://sexywp.com/tags/php" title="PHP" rel="tag">PHP</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/use-firephp-in-ajax-development.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache虚拟主机</title>
		<link>http://sexywp.com/apache-virtual-host-1.htm</link>
		<comments>http://sexywp.com/apache-virtual-host-1.htm#comments</comments>
		<pubDate>Sun, 01 Aug 2010 12:55:51 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[configuration]]></category>

		<guid isPermaLink="false">http://sexywp.com/apache-virtual-host-1.htm</guid>
		<description><![CDATA[Apache的虚拟主机是一种允许在同一台机器上，运行超过一个网站的解决方案。虚拟主机有两种，一种叫基于IP的（IP-based），另一种叫基于名字的（name-based）。虚拟主机的存在，对用户来说是透明的。

 



<span class="readmore"><a href="http://sexywp.com/apache-virtual-host-1.htm" title="Apache虚拟主机">Keep Reading --- 835 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fconfigure-connection-pool-with-hibernate.htm&from=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在Hibernate里配置Proxool连接池</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fword2007-doesnot-show-pics.htm&from=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips]Word2007中看不到图片</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm&from=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">20101103 今天犯了好几个严重低级错误</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fport-80-was-occupied.htm&from=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">安装Apache时80端口被占</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Apache的虚拟主机是一种允许在同一台机器上，运行超过一个网站的解决方案。虚拟主机有两种，一种叫基于IP的（IP-based），另一种叫基于名字的（name-based）。虚拟主机的存在，对用户来说是透明的。</p>
<p> <span id="more-380"></span>
</p>
<h3>基于IP的虚拟主机：</h3>
<p>对于基于IP的虚拟主机来说，必须为每个虚拟主机配备一个单独的IP。也就是说你的服务器必须有多个IP地址。对于这种方式，我们在本地就可以做一个实验来进行配置。</p>
<p>配置基于IP的虚拟主机，有两种方法：一是启动多个apache伺服程序，每个实例使用单独的配置文件，一般来说，在同一台机器上，架设两个网站，这两个网站互相之间不希望对方访问自己的文件，就使用这种方式，每个apache实例都是用单独的用户名，组来启动，并且放到不同的目录下，这种方式只要在apche的配置文件中，为Listen命令配置不同的ip即可；</p>
<p>第二种方法是只启动一个单一的apache进程，使用VirtualHost指令来为不同的站点，配置不同的值，这种配置方式，我们可以在本地做个试验的，由于127.0.0.*的所有ip都是指向本机的，所以，我们可以随便拿两个出来做实验，按照如下方式配置apache，之后，在hosts文件中，将域名绑定到配置的ip上，就可以实现在本地运行多个wp系统的一个配置：</p>
<blockquote><p>&lt;VirtualHost 127.0.0.1:80&gt;     <br />&#160;&#160;&#160; ServerAdmin yourname@domain.com      <br />&#160;&#160;&#160; DocumentRoot &quot;E:/sexywp.com/wordpress-latest&quot;      <br />&#160;&#160;&#160; ServerName wplatest.com      <br />&#160;&#160;&#160; ServerAlias www.wplatest.com      <br />&#160;&#160;&#160; ErrorLog &quot;logs/wplatest.com-error.log&quot;      <br />&#160;&#160;&#160; CustomLog &quot;logs/wplatest.com-access.log&quot; combined      <br />&lt;/VirtualHost&gt; </p>
<p>&lt;VirtualHost 127.0.0.2:80&gt;     <br />&#160;&#160;&#160; ServerAdmin yourname@domain.com      <br />&#160;&#160;&#160; DocumentRoot &quot;E:/sexywp.com/wordpress-2.9.2&quot;      <br />&#160;&#160;&#160; ServerName wpstable.com      <br />&#160;&#160;&#160; ServerAlias www.wpstable.com      <br />&#160;&#160;&#160; ErrorLog &quot;logs/wpstable.com-error.log&quot;      <br />&#160;&#160;&#160; CustomLog &quot;logs/wpstable.com-access.log&quot; combined      <br />&lt;/VirtualHost&gt;</p>
</p>
</blockquote>
<h3>基于名字的虚拟主机：</h3>
<p>基于名字的虚拟主机比起基于IP的来说，配置要更加简单，它只要依靠客户端发送的HTTP头信息中的HOST字段来判断，服务器到底要服务哪个虚拟主机。一般情况下，还是比价推荐使用这种方式。因为IP资源日渐稀缺，对于一般用户来说，为一台服务器购买多个IP也是成本较高的。</p>
<p>使用这种方式配置时，首先是用NameVirtualHost指令，配置次apache实例监听的IP地址和端口号，然后使用VirtualHost指令来配置不同的虚拟主机，上述的例子，用这种方式配置的话，配置方法如下（注意，在这种方式中，ServerName是必填字段）：</p>
<blockquote><p>NameVirtualHost 127.0.0.1:80</p>
<p>&lt;VirtualHost *:80&gt;     <br />&#160;&#160;&#160; ServerAdmin yourname@domain.com      <br />&#160;&#160;&#160; DocumentRoot &quot;E:/sexywp.com/wordpress-latest&quot;      <br />&#160;&#160;&#160; ServerName wplatest.com      <br />&#160;&#160;&#160; ServerAlias www.wplatest.com      <br />&#160;&#160;&#160; ErrorLog &quot;logs/wplatest.com-error.log&quot;      <br />&#160;&#160;&#160; CustomLog &quot;logs/wplatest.com-access.log&quot; combined      <br />&lt;/VirtualHost&gt; </p>
<p>&lt;VirtualHost *:80&gt;     <br />&#160;&#160;&#160; ServerAdmin yourname@domain.com      <br />&#160;&#160;&#160; DocumentRoot &quot;E:/sexywp.com/wordpress-2.9.2&quot;      <br />&#160;&#160;&#160; ServerName wpstable.com      <br />&#160;&#160;&#160; ServerAlias www.wpstable.com      <br />&#160;&#160;&#160; ErrorLog &quot;logs/wpstable.com-error.log&quot;      <br />&#160;&#160;&#160; CustomLog &quot;logs/wpstable.com-access.log&quot; combined      <br />&lt;/VirtualHost&gt;</p>
</blockquote>
<p>此种配置方法，也可以在本地简单地进行实验。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fconfigure-connection-pool-with-hibernate.htm&from=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在Hibernate里配置Proxool连接池</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fword2007-doesnot-show-pics.htm&from=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[Tips]Word2007中看不到图片</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm&from=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">20101103 今天犯了好几个严重低级错误</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fport-80-was-occupied.htm&from=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">安装Apache时80端口被占</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/apache" title="apache" rel="tag">apache</a>, <a href="http://sexywp.com/tags/configuration" title="configuration" rel="tag">configuration</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/apache-virtual-host-1.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>腾讯微博邀请码几枚</title>
		<link>http://sexywp.com/tencent-microblog-inviting-code.htm</link>
		<comments>http://sexywp.com/tencent-microblog-inviting-code.htm#comments</comments>
		<pubDate>Sun, 25 Jul 2010 10:04:48 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=376</guid>
		<description><![CDATA[不定期更新~

据小道消息，目前腾讯微博开始了灰度发布，也即有几百万左右的幸运儿不需要邀请码，就可以使用了。剩下的童鞋请持续关注本帖。有新邀请码，我会直接放出。

http://t.qq.com/invite/3dc90484c8fdd622575b

<span class="readmore"><a href="http://sexywp.com/tencent-microblog-inviting-code.htm" title="腾讯微博邀请码几枚">Keep Reading --- 79 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Ftencent-microblog-inviting-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdom4j-xml-toolkit-java.htm&from=http%3A%2F%2Fsexywp.com%2Ftencent-microblog-inviting-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Java的开源XML工具包dom4j</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm&from=http%3A%2F%2Fsexywp.com%2Ftencent-microblog-inviting-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">20101103 今天犯了好几个严重低级错误</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm&from=http%3A%2F%2Fsexywp.com%2Ftencent-microblog-inviting-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache虚拟主机</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Ftencent-microblog-inviting-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>不定期更新~<br />
据小道消息，目前腾讯微博开始了灰度发布，也即有几百万左右的幸运儿不需要邀请码，就可以使用了。剩下的童鞋请持续关注本帖。有新邀请码，我会直接放出。</p>
<p><del datetime="2010-08-21T15:26:13+00:00">http://t.<a href="http://sexywp.com/tags/qq" class="st_tag internal_tag" rel="tag" title="标签 qq 下的日志">qq</a>.com/invite/3dc90484c8fdd622575b</del><br />
<del datetime="2010-08-21T15:26:13+00:00">http://t.qq.com/invite/bc9fbbe2527f4e07b223</del><br />
<del datetime="2010-08-21T15:26:13+00:00">http://t.qq.com/invite/a2dea5bee7eaafbfd63d</del><br />
<del datetime="2010-08-05T04:25:25+00:00">http://t.qq.com/invite/e0bef8a933f753710ccb</del><br />
<del datetime="2010-08-05T04:25:25+00:00">http://t.qq.com/invite/09291b3c0cc00cf6b961</del><br />
<del datetime="2010-08-05T04:25:25+00:00">http://t.qq.com/invite/ca6ea733ee41271a3e45</del><br />
<del datetime="2010-07-25T11:39:43+00:00">http://t.qq.com/invite/0c84567aaaf775d0b6b5</del><br />
<del datetime="2010-07-25T12:50:02+00:00">http://t.qq.com/invite/e3bd56cc0ceb8a42b86b</del><br />
<del datetime="2010-07-25T12:50:02+00:00">http://t.qq.com/invite/b60fb0c3bf693489e9d3</del><br />
<del datetime="2010-07-25T12:50:02+00:00">http://t.qq.com/invite/b25891d763e4c27f2e97</del><br />
<del datetime="2010-07-25T12:50:02+00:00">http://t.qq.com/invite/f988157f2db89ddca795</del><br />
<del datetime="2010-07-25T16:57:00+00:00">http://t.qq.com/invite/77c1162217bb48e70d39</del><br />
<del datetime="2010-07-25T17:04:37+00:00">http://t.qq.com/invite/cc56196d250ccff534f9</del><br />
<del datetime="2010-07-25T16:57:00+00:00">http://t.qq.com/invite/0287ebfb74404af3202d</del><br />
<del datetime="2010-07-25T16:57:00+00:00">http://t.qq.com/invite/234a83e34565eae3ad23</del><br />
<del datetime="2010-07-29T15:08:50+00:00">http://t.qq.com/invite/04fd33dcbcd6e76d931f</del><br />
<del datetime="2010-07-29T15:08:50+00:00">http://t.qq.com/invite/b2f00ad2f60495a76d39</del><br />
<del datetime="2010-07-29T15:08:50+00:00">http://t.qq.com/invite/0351eb26ee82eb6f98b5</del><br />
<del datetime="2010-07-31T12:31:06+00:00">http://t.qq.com/invite/205290c5f93c030f0f2d</del></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Ftencent-microblog-inviting-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdom4j-xml-toolkit-java.htm&from=http%3A%2F%2Fsexywp.com%2Ftencent-microblog-inviting-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Java的开源XML工具包dom4j</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm&from=http%3A%2F%2Fsexywp.com%2Ftencent-microblog-inviting-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">20101103 今天犯了好几个严重低级错误</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fapache-virtual-host-1.htm&from=http%3A%2F%2Fsexywp.com%2Ftencent-microblog-inviting-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache虚拟主机</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Ftencent-microblog-inviting-code.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/share" title="share" rel="tag">share</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/tencent-microblog-inviting-code.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>显示彩色的manpages</title>
		<link>http://sexywp.com/show-colorful-manpages.htm</link>
		<comments>http://sexywp.com/show-colorful-manpages.htm#comments</comments>
		<pubDate>Sat, 06 Feb 2010 14:35:16 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[man]]></category>
		<category><![CDATA[manpages]]></category>
		<category><![CDATA[usage]]></category>

		<guid isPermaLink="false">http://sexywp.com/?p=360</guid>
		<description><![CDATA[man是Linux下最最常用的命令之一，用来显示某个命令的手册。

一般在命令行下，manpages通过粗体和下划线来标记关键信息，有多种方法来使man命令显示彩色的manpages。

man是调用less来显示manpages的，可以更换这个程序，使用most来显示，这是一个方法。但是长期以来使用less，已经习惯，most又有一套操作方法，后来我又发现了一种方案，非常简单，只要通过在bashrc中设定环境变量，就可以高亮彩显manpages，非常方便。

<span class="readmore"><a href="http://sexywp.com/show-colorful-manpages.htm" title="显示彩色的manpages">Keep Reading --- 267 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm&from=http%3A%2F%2Fsexywp.com%2Fshow-colorful-manpages.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mac OS X上如何实现到Linux主机的ssh免登陆</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fshow-colorful-manpages.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Ftemplate-tags-usage.htm&from=http%3A%2F%2Fsexywp.com%2Fshow-colorful-manpages.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Template Tags（模板标签）使用指南</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm&from=http%3A%2F%2Fsexywp.com%2Fshow-colorful-manpages.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">VIM常用小窍门收集</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fleopard-admin.htm&from=http%3A%2F%2Fsexywp.com%2Fshow-colorful-manpages.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Leopard Admin</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>man是Linux下最最常用的命令之一，用来显示某个命令的手册。</p>
<p>一般在命令行下，manpages通过粗体和下划线来标记关键信息，有多种方法来使man命令显示彩色的manpages。</p>
<p>man是调用less来显示manpages的，可以更换这个程序，使用most来显示，这是一个方法。但是长期以来使用less，已经习惯，most又有一套操作方法，后来我又发现了一种方案，非常简单，只要通过在bashrc中设定环境变量，就可以高亮彩显manpages，非常方便。</p>
<p>设定方法如下，在.bashrc末尾添加如下几行：<br />
<code><br />
export LESS_TERMCAP_mb=$'\E[01;31m'<br />
export LESS_TERMCAP_md=$'\E[01;31m'<br />
export LESS_TERMCAP_me=$'\E[0m'<br />
export LESS_TERMCAP_se=$'\E[0m'<br />
export LESS_TERMCAP_so=$'\E[01;44;33m'<br />
export LESS_TERMCAP_ue=$'\E[0m'<br />
export LESS_TERMCAP_us=$'\E[01;32m'<br />
</code></p>
<p>如此，即可以为manpages添加红绿两色，虽然不多，但是远好过了单调的黑白页面。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fmac-os-x-ssh-key-pair-login-linux.htm&from=http%3A%2F%2Fsexywp.com%2Fshow-colorful-manpages.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mac OS X上如何实现到Linux主机的ssh免登陆</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fshow-colorful-manpages.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Ftemplate-tags-usage.htm&from=http%3A%2F%2Fsexywp.com%2Fshow-colorful-manpages.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Template Tags（模板标签）使用指南</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm&from=http%3A%2F%2Fsexywp.com%2Fshow-colorful-manpages.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">VIM常用小窍门收集</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fleopard-admin.htm&from=http%3A%2F%2Fsexywp.com%2Fshow-colorful-manpages.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Leopard Admin</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/color" title="color" rel="tag">color</a>, <a href="http://sexywp.com/tags/linux" title="Linux" rel="tag">Linux</a>, <a href="http://sexywp.com/tags/man" title="man" rel="tag">man</a>, <a href="http://sexywp.com/tags/manpages" title="manpages" rel="tag">manpages</a>, <a href="http://sexywp.com/tags/usage" title="usage" rel="tag">usage</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/show-colorful-manpages.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LaTeX体验</title>
		<link>http://sexywp.com/the-first-expierence-of-latex-2.htm</link>
		<comments>http://sexywp.com/the-first-expierence-of-latex-2.htm#comments</comments>
		<pubDate>Wed, 20 Jan 2010 00:41:26 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[usage]]></category>

		<guid isPermaLink="false">http://sexywp.com/the-first-expierence-of-latex-2.htm</guid>
		<description><![CDATA[从Word97开始就用上MS Word了，直到Word2007，一晃眼也用了10多年了，可惜嘛，依旧是那个烂水平。排版个学位论文啥的，就是我水平的极限了。Word是一款强悍的编辑排版软件，可惜，我实在钻研精神有限，实在惭愧。现在又到一年学位论文时啊，想着今后漫长的日子里，要憋好几十页的文章，一种孤独寂寥的感觉就涌上心头，实在是不甘心，这就又想起来，有一款排版效果堪比Word，搞不好还略有小胜的软件，我还完全没有涉足过，这就是LaTex了。学习新东西给人的那种新鲜喜悦，可以好好中和一下憋论文的悲苦，于是我踏上了LaTeX之旅。

<span class="readmore"><a href="http://sexywp.com/the-first-expierence-of-latex-2.htm" title="LaTeX体验">Keep Reading --- 1818 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-first-expierence-of-latex-2.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-first-expierence-of-latex-2.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwhat-is-push-mail.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-first-expierence-of-latex-2.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">关于Push Mail的种种</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fthe-difference-between-trackback-and-pingback.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-first-expierence-of-latex-2.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Trackback与Pingback的一点理解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwe-should-care-more-about-ieer.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-first-expierence-of-latex-2.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">我们应该更关心IE的用户</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>从Word97开始就用上MS Word了，直到Word2007，一晃眼也用了10多年了，可惜嘛，依旧是那个烂水平。排版个学位论文啥的，就是我水平的极限了。Word是一款强悍的编辑排版软件，可惜，我实在钻研精神有限，实在惭愧。现在又到一年学位论文时啊，想着今后漫长的日子里，要憋好几十页的文章，一种孤独寂寥的感觉就涌上心头，实在是不甘心，这就又想起来，有一款排版效果堪比Word，搞不好还略有小胜的软件，我还完全没有涉足过，这就是LaTex了。学习新东西给人的那种新鲜喜悦，可以好好中和一下憋论文的悲苦，于是我踏上了LaTeX之旅。</p>
<p>LaTex一般指的就是LaTeX 2e，是一个在TeX基础之上编写的宏包。关于TeX的起源，还有一段佳话，我就不赘述了。乍一接触LaTeX，无论是由于任何原因，也免不了要把这个软件和Word相比较，我同样不能免俗。要说二者的差异，最大的地方还是理念上的差异了，关于这种差异，我同样不想赘述。我只谈体验。LaTeX无论是学习，还是编写文档，初上手给人的感觉就两个字，痛苦。</p>
<p> <span id="more-359"></span>
</p>
<p>痛苦有三：</p>
<ul>
<li>环境配置复杂——抛开使用Word需要支付的软件费用不谈（因为此地是D的王国），安装LaTeX环境是一件比较麻烦的事情，为什么比较麻烦，不就是双击一下Setup.exe吗，说起来是这样，但是与Word的别无选择不同，LaTeX有很多可选的环境，CTeX，TeX Live，MiCTex，MiTeX，装哪个？哪个东西好用，基本上是众说纷纭，决定最终装哪个，就要下不少功夫。如果你恰巧装了不是特别“傻瓜”的那个，那配置起来就有点麻烦了，而且，一开始你可能认识不到自己装的那个够不够“傻瓜”。比如一开始，我装的是MiCTeX，后来当我应用论文模板后，发现死活编译不过去，肯定是少了什么重要的宏包没有安装了，但是装哪个呢？鬼知道。无奈之下，又安装了CTeX，这才太平了。 </li>
<li>纷繁复杂的命令——几乎做任何事情，都有对应的命令，开始一个章节，改变字号，引用图表，插入特殊符号，全部是以一个反斜杠开始的各类命令。要记住这些命令，谈何容易。熟练运用的人，肯定对我嗤之以鼻，就像五笔字型打得快的人，绝不认为字根表是一种负担，LaTeX用的熟的，同样认为记住区区几十条常用的命令，算不上什么负担。另外一点，在LaTeX下，做同一件事情，可能有多种命令可以实现，用哪个呢？这种选择和取舍，也是令人头疼。比如昨晚我要画个表格，一Google，无数的文章，基本上有table，tabular，tabbing三种，搜出来的示例代码，就没有跟我论文模板示例代码相同的，你说这麻烦不麻烦？ </li>
<li>诡异的错误提示——LaTeX标榜的理念是WYTWYG，所想即所得，完全不同于Word的WYSWYG，所见即所得。所以，要想看到用LaTeX编写的文档的最终效果，需要编译。而写代码这种事情，难免写错，一般程序写错了，可以调试，可是LaTeX写错了，看着那奇妙而诡异的调试信息，只有抓狂的份了。要说是束手无策，也不为过。只能亦步亦趋，写一小段，就编译一次。始终知道产生错误的是哪一段代码，否则的话，整篇写完才拿去编译，你根本不知道是哪条命令用错了。 </li>
</ul>
<p>既然这么痛苦，那就别用了，也是啊，我还真的直打退堂鼓，然而呢，其最终得到的完美效果，也让人爱不释手。</p>
<p>诱惑有三：</p>
<ul>
<li>等长等宽等间距——每行的长度，行距，字间距，字母间距，都堪称完美，绝对是Word没法匹敌的。如果你说看起来差不多，那我没什么好说的了。排版这种东西，就是细微之处见真章的，如果你都是粗粗一看，那还犹豫什么，Word绝对OK了，受这罪干啥。但是如果你对美有所追求，那么你很容易在LaTeX的排版结果中发现美的存在。如果在文字中参杂一些公式，效果更是明显。 </li>
<li>样式统一无误差——在Word里，写大型文档，免不了去管理那个样式列表，标题1~7分别什么样式，列表项什么样式，段落什么样式，等等等等。还有复杂的继承嵌套关系，相互影响。往往就像是跷跷板，这头压下去，那头翘起来。就算一份确定的样式，也总是时不时出问题。LaTeX的好处就是一旦你有一个固定的模板，那么你只要一心写文章就可以了，所有已经指定的样式，都会被严格执行，绝无误差，只要正确编译通过，所有的样式都能符合你的要求。麻烦起来是绝顶麻烦，省心起来就是一劳永逸。 </li>
<li>交叉引用参考文献——由于是最后编译，统一机器编号，所以，LaTeX编写文档，都不需要太操心交叉引用和参考文献的问题。人肉编号，或许还会粗心，机器编号，绝对精准。还是那句话，只要你有本事编译通过，得到的效果，就是完美的同义词。 </li>
</ul>
<p>学习新东西，总还是让人充满了喜悦的。尤其是LaTeX这种，虽然麻烦不断，但是总还能够给人惊喜，不知不觉就深入其中，这种感觉很棒。不过我估计，此次毕业论文写完，我可能就与LaTeX再无渊源了，毕竟平时写文档不可能花这么多时间和精力去尝试的。就当做一次美好的纪念继续好好体验吧。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-first-expierence-of-latex-2.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-first-expierence-of-latex-2.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwhat-is-push-mail.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-first-expierence-of-latex-2.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">关于Push Mail的种种</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fthe-difference-between-trackback-and-pingback.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-first-expierence-of-latex-2.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Trackback与Pingback的一点理解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwe-should-care-more-about-ieer.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-first-expierence-of-latex-2.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">我们应该更关心IE的用户</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/latex" title="latex" rel="tag">latex</a>, <a href="http://sexywp.com/tags/opinion" title="opinion" rel="tag">opinion</a>, <a href="http://sexywp.com/tags/usage" title="usage" rel="tag">usage</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/the-first-expierence-of-latex-2.htm/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Vim最低配置单</title>
		<link>http://sexywp.com/the-absolute-bare-minimum-vimrc.htm</link>
		<comments>http://sexywp.com/the-absolute-bare-minimum-vimrc.htm#comments</comments>
		<pubDate>Tue, 10 Nov 2009 14:54:56 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://sexywp.com/the-absolute-bare-minimum-vimrc.htm</guid>
		<description><![CDATA[初次安装vim编辑器时，我们必须要配置~/·vimrc文件才能让vim变得更加好用。最少最少，你要配置下面一些内容：

&#34; 不再与老旧的Vi兼容

set nocompatible

<span class="readmore"><a href="http://sexywp.com/the-absolute-bare-minimum-vimrc.htm" title="Vim最低配置单">Keep Reading --- 255 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="VIM常用小窍门收集" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-absolute-bare-minimum-vimrc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">VIM常用小窍门收集</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="给SVN客户端配置代理服务器" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-absolute-bare-minimum-vimrc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/13/12123060.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">给SVN客户端配置代理服务器</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[Tips]Word2007中看不到图片" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fword2007-doesnot-show-pics.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-absolute-bare-minimum-vimrc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/24/9379186.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[Tips]Word2007中看不到图片</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="工作中常用的Linux命令集锦" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-absolute-bare-minimum-vimrc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="20101103 今天犯了好几个严重低级错误" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-absolute-bare-minimum-vimrc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">20101103 今天犯了好几个严重低级错误</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>初次安装vim编辑器时，我们必须要配置~/·vimrc文件才能让vim变得更加好用。最少最少，你要配置下面一些内容：</p>
<blockquote><pre>&quot; 不再与老旧的Vi兼容
set nocompatible

&quot; 开启filetype支持
filetype on
filetype plugin on
filetype indent on

&quot; 语法高亮
syntax on

&quot; 这个选项为什么不是默认的？
set hidden

&quot; 执行宏的时候不要更新显示set lazyredraw

&quot; 至少让你知道当前是在什么状态下
set showmode

&quot; 启用增强的命令行自动补全。必须再编译时开启 +wildmenu 选项
set wildmenu

&quot; 更容易的编辑此文件，即vimrc文件。用ev命令表示edit vimrc。
nmap &lt;silent&gt; ,ev :e $MYVIMRC&lt;cr&gt;

&quot; 并且令配置立刻生效，用sv命令表示source .vimrc
nmap &lt;silent&gt; ,sv :so $MYVIMRC&lt;cr&gt;</pre>
</blockquote>
<p>==========</p>
<p>上面一些选项还有很多我不懂的，以后研究明白了再添加解释。此文就作为我学习使用vim编辑器的起点吧~~</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="VIM常用小窍门收集" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fvim-tricks-collections.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-absolute-bare-minimum-vimrc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">VIM常用小窍门收集</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="给SVN客户端配置代理服务器" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-absolute-bare-minimum-vimrc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/13/12123060.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">给SVN客户端配置代理服务器</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[Tips]Word2007中看不到图片" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fword2007-doesnot-show-pics.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-absolute-bare-minimum-vimrc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/24/9379186.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[Tips]Word2007中看不到图片</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="工作中常用的Linux命令集锦" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-absolute-bare-minimum-vimrc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="20101103 今天犯了好几个严重低级错误" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2F20101103-green-hand-sucks.htm&from=http%3A%2F%2Fsexywp.com%2Fthe-absolute-bare-minimum-vimrc.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">20101103 今天犯了好几个严重低级错误</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/vim" title="vim" rel="tag">vim</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/the-absolute-bare-minimum-vimrc.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>折磨一下浏览器们，哈哈</title>
		<link>http://sexywp.com/make-all-my-browsers-tested.htm</link>
		<comments>http://sexywp.com/make-all-my-browsers-tested.htm#comments</comments>
		<pubDate>Fri, 04 Sep 2009 08:30:20 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[Web Browsers]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://sexywp.com/make-all-my-browsers-tested.htm</guid>
		<description><![CDATA[The Web Standards Project Acid Tests

http://www.acidtests.org/

“An acid test is a test used to confirm that a material such as jewellery is gold.”&#160; ---&#160; Wikipedia

<span class="readmore"><a href="http://sexywp.com/make-all-my-browsers-tested.htm" title="折磨一下浏览器们，哈哈">Keep Reading --- 828 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fmake-all-my-browsers-tested.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Fmake-all-my-browsers-tested.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwe-should-care-more-about-ieer.htm&from=http%3A%2F%2Fsexywp.com%2Fmake-all-my-browsers-tested.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">我们应该更关心IE的用户</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Fmake-all-my-browsers-tested.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm&from=http%3A%2F%2Fsexywp.com%2Fmake-all-my-browsers-tested.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">解决Flash内容总是漂浮于页面顶层的问题</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://sexywp.com/tags/web" class="st_tag internal_tag" rel="tag" title="标签 web 下的日志">Web</a> Standards Project <strong>Acid Tests</strong></p>
<p><a title="http://www.acidtests.org/" href="http://www.acidtests.org/">http://www.acidtests.org/</a></p>
<p>“An acid <a href="http://sexywp.com/tags/test" class="st_tag internal_tag" rel="tag" title="标签 test 下的日志">test</a> is a <a href="http://sexywp.com/tags/test" class="st_tag internal_tag" rel="tag" title="标签 test 下的日志">test</a> used to confirm that a material such as jewellery is gold.”&#160; ---&#160; Wikipedia</p>
<p> <span id="more-355"></span>
</p>
<p>Acid Test 恰如其字面意思，酸性实验，拿来测试一种珠宝首饰是否是黄金制成。这个词，现在已经作为词组进入了牛津词典，其引申意义为“决定性的试验；严峻考验”。</p>
<p>The <a href="http://www.webstandards.org/">Web Standards Project</a> is a grassroots coalition fighting for standards which ensure simple, affordable access to web technologies for all.</p>
<p>这个Web Standards Project则是一个草根组织，致力于推广Web标准的。我现在这里说的这个Acid Test就是他们推出的，用于检测浏览器对Web标准支持情况进行检测的一组测试。</p>
<p>每一种测试，都有其偏重的方面，能否通过测试和得分高低，并不能说明什么绝对问题，只是可以作为一种参考标准。因为执行测试很简单，所以我把自己手头的所有浏览器都测试了一遍。</p>
<table border="1" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td valign="top" width="174">浏览器</td>
<td valign="top" width="170">Acid3结果</td>
<td valign="top" width="154">用时</td>
</tr>
<tr>
<td valign="top" width="174">IE8</td>
<td valign="top" width="170">Fail 得分20</td>
<td valign="top" width="154">&#160;</td>
</tr>
<tr>
<td valign="top" width="174">Firefox 3.5.2</td>
<td valign="top" width="170">Pass 得分93</td>
<td valign="top" width="154">2.35s</td>
</tr>
<tr>
<td valign="top" width="174">Opera 9.27</td>
<td valign="top" width="170">Fail 得分47</td>
<td valign="top" width="154">&#160;</td>
</tr>
<tr>
<td valign="top" width="174">Opera 9.64</td>
<td valign="top" width="170">Pass 得分85</td>
<td valign="top" width="154">2.88s</td>
</tr>
<tr>
<td valign="top" width="174"><a href="http://sexywp.com/tags/chrome" class="st_tag internal_tag" rel="tag" title="标签 chrome 下的日志">Chrome</a> 3.0</td>
<td valign="top" width="186">Pass 得分100</td>
<td valign="top" width="194">2.22s</td>
</tr>
<tr>
<td valign="top" width="174">Safari 4</td>
<td valign="top" width="186">Pass 得分100</td>
<td valign="top" width="194">2.68s</td>
</tr>
</tbody>
</table>
<p>Acid Test有3组，鉴于上述所有浏览器都完美地展现了1和2的结果，我也就没有列进去了。</p>
<p>上述结果，只是一个参考，我们可以看到一些事情，Webkit内核已经率先做好了对标准的支持，包括CSS3和HTML，其实Opera公司的Presto也同样做好了准备，我前些日子再Opera10 beta上跑过Acid3，发现也是100分，不过没有看执行时间。所以，基于Webkit内核的Chrome和Safari都得了满分，不过呢，貌似Chrome的脚本引擎确实要更先进一些，所以呢，Chrome更快。</p>
<p>上述列表中的大输家是IE8和Opera 9.27。Opera 9.2还情有可原，IE8实在是让人抱歉了，折腾了半天，对标准兼容还是这么差。不过，我还是想强调，这个测试不能说明大部分问题。因为这两个大输家，正是我日常使用最多的浏览器。（我平时使用的，就只有IE8，Firefox和Opera 9.27，其他都是调试用的。）事实上，我觉得IE8是微软历史上最好的浏览器了，甚至我觉得比Firefox 3.5.2要好用很多。其实，我很实在的，IE8真的要快上一个数量级了。至少在我的机子上是这样。对各类垃圾网页的兼容也很好。以前，我最常用的浏览器是Firefox，现在重心在向IE8转移。正所谓“一快遮三丑”，就是这个样子的。另外一个因素，就是Firefox绝对是内存杀手，只要开的程序稍多，我一定会先杀死这只狐狸。</p>
<p>我记忆如果没有偏差IE7是无法通过Acid2的，而IE8轻易过关，这表明了微软的一种姿态，还是支持Web标准的。其他可能是一些市场因素的考虑吧，所以才会变成现在这种结局。</p>
<p>写到这里，我也不知道要说些啥了，貌似胡乱扯了一堆东西。就这样吧。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fmake-all-my-browsers-tested.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fweb-apps-ide-aptana-studio3.htm&from=http%3A%2F%2Fsexywp.com%2Fmake-all-my-browsers-tested.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web开发专用IDE：Aptana Studio 3.0</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fwe-should-care-more-about-ieer.htm&from=http%3A%2F%2Fsexywp.com%2Fmake-all-my-browsers-tested.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">我们应该更关心IE的用户</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fbuild-web-server-on-wince-platform.htm&from=http%3A%2F%2Fsexywp.com%2Fmake-all-my-browsers-tested.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">在WinCE上搭建Web服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fflash-float-on-topest-layer.htm&from=http%3A%2F%2Fsexywp.com%2Fmake-all-my-browsers-tested.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">解决Flash内容总是漂浮于页面顶层的问题</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/test" title="test" rel="tag">test</a>, <a href="http://sexywp.com/tags/web-browsers" title="Web Browsers" rel="tag">Web Browsers</a>, <a href="http://sexywp.com/tags/web-design" title="web design" rel="tag">web design</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/make-all-my-browsers-tested.htm/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>在WinXP上搭建自己的SVN服务器</title>
		<link>http://sexywp.com/how-to-make-a-easy-svn-server.htm</link>
		<comments>http://sexywp.com/how-to-make-a-easy-svn-server.htm#comments</comments>
		<pubDate>Tue, 21 Jul 2009 12:47:49 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[usage]]></category>

		<guid isPermaLink="false">http://sexywp.com/how-to-make-a-easy-svn-server.htm</guid>
		<description><![CDATA[本文将介绍一个最为简略的搭建SVN服务器的方法。

 

经常要开发一些小项目，实验室里没有统一的文件服务器和版本库，那么只好自己动手来搭建一个。

<span class="readmore"><a href="http://sexywp.com/how-to-make-a-easy-svn-server.htm" title="在WinXP上搭建自己的SVN服务器">Keep Reading --- 905 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">给SVN客户端配置代理服务器</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fnetbeans-plugins-i-used.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">NetBeans 中我选用的插件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>本文将介绍一个最为简略的搭建SVN服务器的方法。</p>
<p> <span id="more-353"></span>
<p>经常要开发一些小项目，实验室里没有统一的文件服务器和版本库，那么只好自己动手来搭建一个。</p>
<p>推荐使用<a title="http://www.open.collab.net/" href="http://www.open.collab.net/">http://www.open.collab.net/</a>提供的SVN，服务器和客户端软件包一共只有11M。是全命令行的界面。</p>
<p>在页面：<a title="http://www.open.collab.net/downloads/subversion/" href="http://www.open.collab.net/downloads/subversion/">http://www.open.collab.net/downloads/subversion/</a></p>
<p>下载：CollabNet Subversion <a href="http://sexywp.com/tags/server" class="st_tag internal_tag" rel="tag" title="标签 server 下的日志">Server</a> and Client v1.6.3 (for Windows) 下载的时候请选用最新版本，一般来说更新得非常勤快的。</p>
<p>下载后双击安装，安装过程中会提示，是否把svn安装成service，选是。</p>
<p>安装完成后，可以检查一下svnserver是否已经启动。</p>
<p>检查方法为进入控制台（开始--&gt;运行--&gt;cmd），输入命令</p>
<p>netstat –an</p>
<p>看看Listen列表里是否在监听3690端口，如果已经在监听了，说明svn服务器已经启动，如果没有启动的话，进入“控制面板”--&gt;“管理工具”--&gt;“服务”，找到CollabNet Subversion，然后点启动。（按照我的理解，这项服务应该在重启计算机后自动启动的，但是不知道为什么，我的没有自动启动，只好手动启动一下。）</p>
<p>到此，服务器已经安装完成了。</p>
<p>按照安装过程中的设置，会在你的磁盘上生成一个svn_repository的目录，从命令行进入该目录，输入命令</p>
<p>svnadmin create my_repository</p>
<p>就会建立一个版本库。</p>
<p>然后进入该版本库，进行配置。进入conf目录，有三个文件需要配置</p>
<p>svnserve.conf</p>
<blockquote><p>[general]      <br />### These options control access to the repository for unauthenticated       <br />### and authenticated users.&#160; Valid values are &quot;write&quot;, &quot;read&quot;,       <br />### and &quot;none&quot;.&#160; The sample settings below are the defaults. </p>
<p>anon-access = read      <br />auth-access = write </p>
<p>### The password-db option controls the location of the password      <br />### database file.&#160; Unless you specify a path starting with a /,       <br />### the file's location is relative to the directory containing       <br />### this <a href="http://sexywp.com/tags/configuration" class="st_tag internal_tag" rel="tag" title="标签 configuration 下的日志">configuration</a> file.       <br />### If SASL is enabled (see below), this file will NOT be used.       <br />### Uncomment the line below to use the default password file. </p>
<p>password-db = passwd </p>
<p>### The authz-db option controls the location of the authorization      <br />### rules for path-based access control.&#160; Unless you specify a path       <br />### starting with a /, the file's location is relative to the the       <br />### directory containing this file.&#160; If you don't specify an       <br />### authz-db, no path-based access control is done.       <br />### Uncomment the line below to use the default authorization file. </p>
<p>authz-db = authz</p>
</blockquote>
<p>这个文件有若干的选项，上文中引用的部分为比较基本的几个选项，主要是控制访问权限的。</p>
<p>authz</p>
<p>[/]   <br />sexywp = rw    </p>
<p>password</p>
<p>[users]   <br />sexywp = 123456    </p>
<p>另外两个文件分别是authz和password，里面的内容如上述。主要的含义是创建了一个用户，名字为sexywp，其密码为123456，对整个版本库的根目录有读写权限。</p>
<p>至此，服务器端的版本库已经建立完毕了。下一个步骤就是把项目代码导入到版本库了。</p>
<p>导入版本库非常简单，可以从服务器端导入，使用import命令，也可以从客户端导入，我接下来介绍一下从客户端导入。</p>
<p>首先找到一个目标目录，你要在这里管理你的代码，比如E:/MyProject目录下，然后执行命令</p>
<p><a href="http://sexywp.com/tags/svn" class="st_tag internal_tag" rel="tag" title="标签 svn 下的日志">svn</a> checkout <a href="http://sexywp.com/tags/svn" class="st_tag internal_tag" rel="tag" title="标签 svn 下的日志">svn</a>://localhost/my_repository --username sexywp --password 123456&#160;&#160; </p>
<p>然后，你就会得到一个my_repository的空目录，进入后，里面有一个.svn的隐藏目录，除此之外，没有任何其他的东西了。</p>
<p>你可以在这个目录里建立好你版本库的结构，比如，我会建立三个目录trunk，branches，tags（使用svn mkdir命令），然后，将项目代码拷贝到trunk目录下，然后执行</p>
<p>svn commit –m “first <a href="http://sexywp.com/tags/version" class="st_tag internal_tag" rel="tag" title="标签 version 下的日志">version</a>”</p>
<p>命令，将所有代码导入到服务器的版本库。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fuse-proxy-in-ur-svn-client.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">给SVN客户端配置代理服务器</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flitespeed-web-server.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Web服务器LiteSpeed</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fyii-validator-allwoempty-property.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Yii框架中验证器的allowEmpty属性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fnetbeans-plugins-i-used.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">NetBeans 中我选用的插件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Flinux-commands-used-when-working.htm&from=http%3A%2F%2Fsexywp.com%2Fhow-to-make-a-easy-svn-server.htm">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">工作中常用的Linux命令集锦</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
	标签：<a href="http://sexywp.com/tags/server" title="server" rel="tag">server</a>, <a href="http://sexywp.com/tags/subversion" title="subversion" rel="tag">subversion</a>, <a href="http://sexywp.com/tags/usage" title="usage" rel="tag">usage</a><br />
]]></content:encoded>
			<wfw:commentRss>http://sexywp.com/how-to-make-a-easy-svn-server.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>在Hibernate里配置Proxool连接池</title>
		<link>http://sexywp.com/configure-connection-pool-with-hibernate.htm</link>
		<comments>http://sexywp.com/configure-connection-pool-with-hibernate.htm#comments</comments>
		<pubDate>Tue, 14 Jul 2009 07:22:37 +0000</pubDate>
		<dc:creator>Charles</dc:creator>
				<category><![CDATA[工作相关]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://sexywp.com/configure-connection-pool-with-hibernate.htm</guid>
		<description><![CDATA[在网上搜出了很多给Hibernate配置连接池的文章，不过基本上都是同一篇文章，介绍了3种连接池的配置方法，我先试验了c3p0，感觉不出有什么快的，只是觉得在并发测试中，减少了出错的概率。那篇帖子最底下，说道社区普遍认为c3p0不够优秀，大家更倾向使用proxool，于是乎，我决定也试试，当然，我自己完全是没任何经验的，纯粹是为了试试。

去proxool下载了最新版本，0.9.1（我用的Hibernate是3.2.5版本，实际上0.9.1配置好后，跑步起来，最后还是用了0.8.3，后面会说的），按照网上普遍能搜到的帖子里的那个方法配置。

<span class="readmore"><a href="http://sexywp.com/configure-connection-pool-with-hibernate.htm" title="在Hibernate里配置Proxool连接池">Keep Reading --- 913 words totally</a></span><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Java的开源XML工具包dom4j" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fdom4j-xml-toolkit-java.htm&from=http%3A%2F%2Fsexywp.com%2Fconfigure-connection-pool-with-hibernate.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/06/01/10587680.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Java的开源XML工具包dom4j</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="如何让Java程序定时运行" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-make-java-task-scheduled-excecute.htm&from=http%3A%2F%2Fsexywp.com%2Fconfigure-connection-pool-with-hibernate.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/05/23/9225479.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">如何让Java程序定时运行</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="关于在.net下使用OCX控件的问题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fhow-to-use-ocx.htm&from=http%3A%2F%2Fsexywp.com%2Fconfigure-connection-pool-with-hibernate.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">关于在.net下使用OCX控件的问题</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title=".NET Windows Forms窗体中的事件顺序" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fthe-events-sequence-of-the-windows-form.htm&from=http%3A%2F%2Fsexywp.com%2Fconfigure-connection-pool-with-hibernate.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">.NET Windows Forms窗体中的事件顺序</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="让自定义控件产生自定义事件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fsexywp.com%2Fcustom-event-in-custom-control.htm&from=http%3A%2F%2Fsexywp.com%2Fconfigure-connection-pool-with-hibernate.htm">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">让自定义控件产生自定义事件</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>在网上搜出了很多给Hibernate配置连接池的文章，不过基本上都是同一篇文章，介绍了3种连接池的配置方法，我先试验了c3p0，感觉不出有什么快的，只是觉得在并发测试中，减少了出错的概率。那篇帖子最底下，说道社区普遍认为c3p0不够优秀，大家更倾向使用proxool，于是乎，我决定也试试，当然，我自己完全是没任何经验的，纯粹是为了试试。</p>
<p>去proxool下载了最新版本，0.9.1（我用的Hibernate是3.2.5版本，实际上0.9.1配置好后，跑步起来，最后还是用了0.8.3，后面会说的），按照网上普遍能搜到的帖子里的那个方法配置。</p>
<p> <span id="more-352"></span>
<p>在hibernate.cfg.xml中加入:</p>
<pre><span style="color: #0000ff">&lt;</span><span style="color: #800000">property</span> <span style="color: #ff0000">name</span>=<span style="color: #0000ff">&quot;hibernate.proxool.pool_alias&quot;</span><span style="color: #0000ff">&gt;</span>pool1<span style="color: #0000ff">&lt;/</span><span style="color: #800000">property</span><span style="color: #0000ff
