<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.5" -->
<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/"
	>

<channel>
	<title>Open Tech Notes</title>
	<link>http://zft.backupdiy.com</link>
	<description>All about open sources, like linux, apache, php, Zend Framework, MySQL, CentOS, Apachefriends...</description>
	<pubDate>Wed, 07 May 2008 05:32:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>
	<language>en</language>
			<item>
		<title>Backup system for small network</title>
		<link>http://zft.backupdiy.com/2007/05/22/backup-system-for-small-network/</link>
		<comments>http://zft.backupdiy.com/2007/05/22/backup-system-for-small-network/#comments</comments>
		<pubDate>Wed, 23 May 2007 06:42:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>Zend Framework</dc:subject>
	<dc:subject>Linux Admin</dc:subject>
	<dc:subject>Backup</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/2007/05/22/backup-system-for-small-network/</guid>
		<description><![CDATA[From my last post, I got an idea about center backup system for a small network. There are a lot small companies in town. The typical network is about around 10 computers runing Windows OS&#160; and all of them share one internet connection via a small switch and a router.&#160; They usually use CD/DVD-R/RW to [...]]]></description>
			<content:encoded><![CDATA[<p>From my last post, I got an idea about center backup system for a small network. There are a lot small companies in town. The typical network is about around 10 computers runing Windows OS&nbsp; and all of them share one internet connection via a small switch and a router.&nbsp; They usually use CD/DVD-R/RW to backup their data. The problem is, at very beginning , everybody likes to do it, after a couple of weeks, most of them feel it boring and useless. After a couple of monthes, I can say, nobody likes it.</p>
<p>When I used the WinSCP since my last post. I am thinking of seting up a linux server with SSH server. In each Windows client, setup WinSCP. The linux server can be setup anywhere, even in the boss&#8217;s home as long as the Internet connection is stable. Not like Samba, scp is pretty easy to use and the WinSCP is powerful.</p>
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2007/05/22/backup-system-for-small-network/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zend_Validate is released</title>
		<link>http://zft.backupdiy.com/2007/02/08/zend_validate-is-released/</link>
		<comments>http://zft.backupdiy.com/2007/02/08/zend_validate-is-released/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 09:03:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>Zend Framework</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/2007/02/08/zend_validate-is-released/</guid>
		<description><![CDATA[Go to here to download
To avoiding unexpected input one my demo,&#160; I will add the Zend_Validate to it soon.

]]></description>
			<content:encoded><![CDATA[<p>Go to here to <a href="http://framework.zend.com/svn/framework/trunk/">download</a></p>
<p>To avoiding unexpected input one my demo,&nbsp; I will add the Zend_Validate to it soon.
</p>
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2007/02/08/zend_validate-is-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zend Framework(0.7.0) could not recognize index.php</title>
		<link>http://zft.backupdiy.com/2007/01/31/zend-framework070-could-not-recognize-indexphp/</link>
		<comments>http://zft.backupdiy.com/2007/01/31/zend-framework070-could-not-recognize-indexphp/#comments</comments>
		<pubDate>Wed, 31 Jan 2007 21:12:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>Zend Framework</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/2007/01/31/zend-framework070-could-not-recognize-indexphp/</guid>
		<description><![CDATA[Thanks for Tony for your comment!
My patch for version 0.7.0
In library\Zend\Controller\Request\Http.php
After line 531, add

Code (php)


// Remove the .php from REQUEST_URI


if &#40;$pos = strpos&#40;$requestUri, &#8216;.&#8217;&#41;&#41; &#123;


$requestUri = substr&#40;$requestUri, 0, $pos&#41;;


&#125;


&#160;



or you can go to   framework.zend.com/issues/browse/ZF-835 to see how Zend Framework team solves this problem

]]></description>
			<content:encoded><![CDATA[<p>Thanks for Tony for your comment!</p>
<p>My patch for version 0.7.0</p>
<p>In library\Zend\Controller\Request\Http.php<br />
After line 531, add</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;">
<div style="">Code (php)</div>
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Remove the .php from REQUEST_URI</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$pos</span> = <a href="http://www.php.net/strpos"><span style="color: #000066;">strpos</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$requestUri</span>, <span style="color: #ff0000;">&#8216;.&#8217;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$requestUri</span> = <a href="http://www.php.net/substr"><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$requestUri</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #0000ff;">$pos</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
<p>or you can go to   <a href="http://framework.zend.com/issues/browse/ZF-835">framework.zend.com/issues/browse/ZF-835</a> to see how Zend Framework team solves this problem
</p>
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2007/01/31/zend-framework070-could-not-recognize-indexphp/feed/</wfw:commentRss>
		</item>
		<item>
		<title></title>
		<link>http://zft.backupdiy.com/2007/01/31/30/</link>
		<comments>http://zft.backupdiy.com/2007/01/31/30/#comments</comments>
		<pubDate>Wed, 31 Jan 2007 21:11:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>Zend Framework</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/2007/01/31/30/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2007/01/31/30/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zend Framework 0.7.0 has been released.</title>
		<link>http://zft.backupdiy.com/2007/01/19/zend-framework-070-has-been-released/</link>
		<comments>http://zft.backupdiy.com/2007/01/19/zend-framework-070-has-been-released/#comments</comments>
		<pubDate>Fri, 19 Jan 2007 08:09:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>Zend Framework</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/2007/01/19/zend-framework-070-has-been-released/</guid>
		<description><![CDATA[I have done the test, my demo works with the new version without any problem.
By the way, I&#8217;d like introduce my thought about controller. A couple of weeks ago, I separated&#160; form&#160; operations from&#160; the action controller. a couple of reasons as below:

A lot of actions do the similar thing, like add, register, something behind [...]]]></description>
			<content:encoded><![CDATA[<p>I have done the test, my demo works with the new version without any problem.</p>
<p>By the way, I&#8217;d like introduce my thought about controller. A couple of weeks ago, I separated&nbsp; form&nbsp; operations from&nbsp; the action controller. a couple of reasons as below:</p>
<ul>
<li>A lot of actions do the similar thing, like add, register, something behind the scene is inserting one record into the table of database. Using one form action to do the similar job, formInsert() for example, will make this part of code re-usable.</li>
<li>Making action controller programming as easy as possibe. As we can predict, Zend_form, Zend_Validate etc will come soon, I will put all of them into form action controller. In action controller there will only two statements like these:</li>
</ul>
<div class="ch_code_container" style="font-family: monospace;height:100%;">
<div style="">Code (php)</div>
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> addAction<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">$params</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a> <span style="color: #66cc66;">&#40;</span>&#8230;<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">$this</span>-&gt;_forward<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;form&#8217;</span>,<span style="color: #ff0000;">&#8216;formactionname&#8217;</span>,<span style="color: #0000ff;">$params</span><span style="color: #66cc66;">&#41;</span>;&nbsp; </div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
<p>then in the future, in action controllers,&nbsp; I only need to construct one big arrary which will carry parameters for&nbsp; creating the form, then call the related form action. That&#8217;s it!
</p>
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2007/01/19/zend-framework-070-has-been-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title></title>
		<link>http://zft.backupdiy.com/2007/01/19/28/</link>
		<comments>http://zft.backupdiy.com/2007/01/19/28/#comments</comments>
		<pubDate>Fri, 19 Jan 2007 08:09:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>Zend Framework</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/2007/01/19/28/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2007/01/19/28/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Form Input Validation</title>
		<link>http://zft.backupdiy.com/2007/01/07/form-input-validation/</link>
		<comments>http://zft.backupdiy.com/2007/01/07/form-input-validation/#comments</comments>
		<pubDate>Mon, 08 Jan 2007 05:48:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>Zend Framework</dc:subject><dc:subject>Zend Framework</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/?p=26</guid>
		<description><![CDATA[It is a big job to write the effective validation rule for form input, isn&#8217;t?
]]></description>
			<content:encoded><![CDATA[<p>It is a big job to write the effective validation rule for form input, isn&#8217;t?</p>
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2007/01/07/form-input-validation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Unsupported operand types when call _getAllParams()</title>
		<link>http://zft.backupdiy.com/2006/12/31/unsupported-operand-types-when-call-_getallparams/</link>
		<comments>http://zft.backupdiy.com/2006/12/31/unsupported-operand-types-when-call-_getallparams/#comments</comments>
		<pubDate>Sun, 31 Dec 2006 22:40:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>Zend Framework</dc:subject><dc:subject>Framework</dc:subject><dc:subject>Tutorial</dc:subject><dc:subject>Zend</dc:subject><dc:subject>Zend Framework</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/?p=25</guid>
		<description><![CDATA[I think it is a bug, however, it seems that I can&#8217;t login into Zend Framework Wiki today. Anyway, here is what I have found.
When I call _getAllParams() in FormController, like

Code (php)


$this-&#62;_getAllParams&#40;&#41;;


&#160;


&#160;




I got the error message as &#34;unsupported operand types&#34;.
Finally, I found the problem in Zend\Controller\Request\Http.php&#160;&#160; line 601 

Code (php)


&#160; 590&#160; &#160;/**


&#160; 591&#160; &#160; * [...]]]></description>
			<content:encoded><![CDATA[<p>I think it is a bug, however, it seems that I can&#8217;t login into Zend Framework Wiki today. Anyway, here is what I have found.</p>
<p>When I call _getAllParams() in FormController, like</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;">
<div style="">Code (php)</div>
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$this</span>-&gt;_getAllParams<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
<p>
I got the error message as &quot;<strong>unsupported operand types</strong>&quot;.</p>
<p>Finally, I found the problem in Zend\Controller\Request\Http.php&nbsp;&nbsp; line 601 </p>
<div class="ch_code_container" style="font-family: monospace;height:300px;">
<div style="">Code (php)</div>
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #cc66cc;">590</span>&nbsp; &nbsp;<span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; 591&nbsp; &nbsp; * Retrieve an array of parameters</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; 592&nbsp; &nbsp;*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; 593&nbsp; &nbsp; * Retrieves a merged array of parameters, with precedence of userland </span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; 594&nbsp; &nbsp; * params (see {@link setParam()}), $_GET, $POST (i.e., values in the </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; 595&nbsp; &nbsp; * userland params will take precedence over all others).</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; 596&nbsp; &nbsp; * </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; 597&nbsp; &nbsp; * @return array</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; 598&nbsp; &nbsp; */</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #cc66cc;">599</span>&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getParams<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #cc66cc;">600</span>&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #cc66cc;">601</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$this</span>-&gt;_params + <span style="color: #0000ff;">$_GET</span> + <span style="color: #0000ff;">$_POST</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #cc66cc;">602</span>&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
<p>The reason is because $_GET and/or $_POST was NULL when getParams() was called.</p>
<p>Temporarily , I changed it as below:</p>
<div class="ch_code_container" style="font-family: monospace;height:300px;">
<div style="">Code (php)</div>
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getParams<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">null</span> !== <span style="color: #0000ff;">$_GET</span> &amp;&amp; <span style="color: #000000; font-weight: bold;">null</span> !== <span style="color: #0000ff;">$_POST</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$this</span>-&gt;_params + <span style="color: #0000ff;">$_GET</span> + <span style="color: #0000ff;">$_POST</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">null</span> !== <span style="color: #0000ff;">$_GET</span> &amp;&amp; <span style="color: #000000; font-weight: bold;">null</span> == <span style="color: #0000ff;">$_POST</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$this</span>-&gt;_params + <span style="color: #0000ff;">$_GET</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">null</span> == <span style="color: #0000ff;">$_GET</span> &amp;&amp; <span style="color: #000000; font-weight: bold;">null</span> !== <span style="color: #0000ff;">$_POST</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$this</span>-&gt;_params + <span style="color: #0000ff;">$_POST</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$this</span>-&gt;_params;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2006/12/31/unsupported-operand-types-when-call-_getallparams/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Refactor-Step One</title>
		<link>http://zft.backupdiy.com/2006/12/31/refactor-step-one/</link>
		<comments>http://zft.backupdiy.com/2006/12/31/refactor-step-one/#comments</comments>
		<pubDate>Sun, 31 Dec 2006 10:14:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>Zend Framework</dc:subject><dc:subject>Zend Framework</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/?p=24</guid>
		<description><![CDATA[By now, my&#160; first&#160; step of refactor for addAction(), editAction() etc. has been finished. They are all related FORM operation. First of all, I created a form controller which named FormController. Of course, the file name is FormController.php and the class name is FormController(). 
It looks like

Code (php)


&#160;


class FormController extends Zend_Controller_Action 


&#160;


&#123;


&#160; &#160;function init&#40;&#41;


&#160; &#160;&#123;


&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>By now, my&nbsp; first&nbsp; step of refactor for addAction(), editAction() etc. has been finished. They are all related FORM operation. First of all, I created a form controller which named FormController. Of course, the file name is FormController.php and the class name is FormController(). </p>
<p>It looks like</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;">
<div style="">Code (php)</div>
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">class</span> FormController <span style="color: #000000; font-weight: bold;">extends</span> Zend_Controller_Action </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Zend::<span style="color: #006600;">loadClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;Bookmark&#8217;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Zend::<span style="color: #006600;">loadClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;User&#8217;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> insertAction<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$arg1</span>&nbsp; = <span style="color: #0000ff;">$this</span>-&gt;_request-&gt;<span style="color: #006600;">getParam</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;arg1_name&#8217;</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$args</span>&nbsp; = <span style="color: #0000ff;">$this</span>-&gt;_request-&gt;<span style="color: #006600;">getParams</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8230;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
<p>in IndexController.php, the code would be</p>
<div class="ch_code_container" style="font-family: monospace;height:300px;">
<div style="">Code (php)</div>
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">function</span> addAction<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;">$data</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #66cc66;">&#40;</span>&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&#8216;arg1_name&#8217;</span>&nbsp; &nbsp;=&gt; <span style="color: #ff0000;">&#8216;arg1&#8242;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&#8216;arg2_name&#8217;</span>&nbsp; &nbsp;=&gt; <span style="color: #ff0000;">&#8216;arg2&#8242;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&#8216;arg3_name&#8217;</span>&nbsp; &nbsp;=&gt; <span style="color: #ff0000;">&#8216;arg3&#8242;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;">$this</span>-&gt;_forward<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;form&#8217;</span>,<span style="color: #ff0000;">&#8216;insert&#8217;</span>,<span style="color: #0000ff;">$data</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2006/12/31/refactor-step-one/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zend Framework could not recognize index.php</title>
		<link>http://zft.backupdiy.com/2006/12/22/zend-framework-could-not-recognize-indexphp/</link>
		<comments>http://zft.backupdiy.com/2006/12/22/zend-framework-could-not-recognize-indexphp/#comments</comments>
		<pubDate>Fri, 22 Dec 2006 17:40:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>Zend Framework</dc:subject><dc:subject>Zend Framework</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/?p=11</guid>
		<description><![CDATA[In RewriteRouter.php, after line 136 add
/** Added by Jason Qi Nov 28, 2006 */
&#160;&#160;&#160;&#160;&#160;&#160;&#160; $tpath = $path;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; $tpath = strtolower($tpath);
&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (strstr($tpath, &#8216;.php&#8217;)) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $path = substr($path, 0, strpos($path, &#8216;.&#8217;));
&#160;&#160;&#160;&#160;&#160;&#160;&#160; }
to eliminate .php from index.php

]]></description>
			<content:encoded><![CDATA[<p>In RewriteRouter.php, after line 136 add</p>
<p>/** Added by Jason Qi Nov 28, 2006 */<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $tpath = $path;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $tpath = strtolower($tpath);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (strstr($tpath, &#8216;.php&#8217;)) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $path = substr($path, 0, strpos($path, &#8216;.&#8217;));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>to eliminate .php from index.php
</p>
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2006/12/22/zend-framework-could-not-recognize-indexphp/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
