<?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>Xoops Engine Development</title>
	<atom:link href="http://dev.xoopsengine.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://dev.xoopsengine.org</link>
	<description>Talking about Xoops Engine design and development</description>
	<lastBuildDate>Tue, 16 Aug 2011 03:50:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Updates On Xoops Engine Development As Of August 16th</title>
		<link>http://dev.xoopsengine.org/?p=88</link>
		<comments>http://dev.xoopsengine.org/?p=88#comments</comments>
		<pubDate>Tue, 16 Aug 2011 03:50:07 +0000</pubDate>
		<dc:creator>taiwen</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[BSD]]></category>
		<category><![CDATA[GPL]]></category>
		<category><![CDATA[Ono Kazu]]></category>
		<category><![CDATA[Xoops]]></category>
		<category><![CDATA[Xoops Engine]]></category>

		<guid isPermaLink="false">http://dev.xoopsengine.org/?p=88</guid>
		<description><![CDATA[


.
XOOPS is an open source CMS solution founded by Ono Kazumi, Goghs Cheng, etc. in 2001, released under GPL2 license.  The most recent major releases were XOOPS 2.0 in 2003 led by Ono Kazumi and XOOPS 2.3 in 2008 led by Taiwen Jiang.
.
Xoops Engine is the next generation of XOOPS, designed as an application development [...]]]></description>
			<content:encoded><![CDATA[<div>
<div>
<div>
<div>.</div>
<div>XOOPS is an open source CMS solution founded by Ono Kazumi, Goghs Cheng, etc. in 2001, released under GPL2 license.  The most recent major releases were XOOPS 2.0 in 2003 led by Ono Kazumi and XOOPS 2.3 in 2008 led by Taiwen Jiang.</div>
<div>.</div>
<div>Xoops Engine is the next generation of XOOPS, designed as an application development engine for web and mobile.  It is released under new BSD license and aims at building a sustainable ecosystem to benefit all contributors and user in technology and business.</div>
<div>.</div>
<div>The Xoops Engine is developed by most active and talented XOOPS core developers led by Taiwen Jiang (a.k.a. phppp), who was Project Lead and Core Dev Lead for XOOPS from 2007 to 2011, core developer from 2005 to 2007.</div>
<div>.</div>
<div>Xoops Engine development is fully encouraged by support from XOOPS founder Ono Kazumi:</div>
<blockquote>
<div>&#8220;I hope that you keep on going with the development of XE, since there is no bright future ahead with X2.&#8221;</div>
</blockquote>
<div>.</div>
<div>Xoops Engine development is hosted on http://www.xoopsengine.org since August 2011 while legacy XOOPS (e.g XOOPS 2) series is hosted on http:://www.xoops.org and maintained by XOOPS community contributors.</div>
<div>.</div>
<div>Check Xoops Engine updates on <a title="XoopsProject@Twitter" href="https://twitter.com/XoopsProject" target="_blank">XoopsProject@Twitter</a> (https://twitter.com/XoopsProject) and <a title="Xoops Engine Development" href="http://www.xoopsengine.org" target="_blank">http://www.xoopsengine.org</a></div>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://dev.xoopsengine.org/?feed=rss2&amp;p=88</wfw:commentRss>
		<slash:comments>218</slash:comments>
		</item>
		<item>
		<title>Xoops Engine Alpha 3 Release Schedule</title>
		<link>http://dev.xoopsengine.org/?p=73</link>
		<comments>http://dev.xoopsengine.org/?p=73#comments</comments>
		<pubDate>Sat, 16 Jul 2011 05:28:25 +0000</pubDate>
		<dc:creator>taiwen</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Product]]></category>
		<category><![CDATA[GIT]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[ZendFramework]]></category>

		<guid isPermaLink="false">http://dev.xoopsengine.org/?p=73</guid>
		<description><![CDATA[We have a lot processes in X3 development since Alpha 2 release.
I would suggest following schedule for the coming month:

 Xoops Engine Alpha 3 release: on August 13th
 github repo structure change, github usage guide: D.J., julionc, by July 24th
 ZF upgrade to 1.11.9, change naming conventions to respect ZF strictly: D.J., by July 24th
 [...]]]></description>
			<content:encoded><![CDATA[<p>We have a lot processes in X3 development since Alpha 2 release.</p>
<p>I would suggest following schedule for the coming month:</p>
<ul>
<li><strong> Xoops Engine Alpha 3 release: on August 13th</strong></li>
<li><strong> </strong>github repo structure change, github usage guide: D.J., julionc, by July 24th</li>
<li> ZF upgrade to 1.11.9, change naming conventions to respect ZF strictly: D.J., by July 24th</li>
<li> Backend product and UE design: ezsky, by July 31st</li>
<li> Backend design implementation: D.J., by August 7th</li>
<li> Debug and complete &#8220;user&#8221; module and ACL: D.J., dongbeta, by July 31st</li>
<li> Content management app: dongbeta, by August 7th</li>
<li> Theme and HTML5: voltan, kris_fr, mariane, by August 7th</li>
<li> Documentation: julionc, dongbeta, by August 13th</li>
<li> Test: marco, by August 13th</li>
</ul>
<p>Yes, as you see, we have some people back onboard, like marco!<br />
Anyone else have time on this Alpha 3 release loop?<br />
We need more people on documentation, apps, themes and test.</p>
<p>On twitter: <a title="XoopsProject" href="https://twitter.com/XoopsProject" target="_blank">@XoopsProject</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xoopsengine.org/?feed=rss2&amp;p=73</wfw:commentRss>
		<slash:comments>681</slash:comments>
		</item>
		<item>
		<title>Enable Redis in Xoops Engine Persist Service</title>
		<link>http://dev.xoopsengine.org/?p=68</link>
		<comments>http://dev.xoopsengine.org/?p=68#comments</comments>
		<pubDate>Fri, 06 May 2011 04:01:28 +0000</pubDate>
		<dc:creator>taiwen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[igbinary]]></category>
		<category><![CDATA[Redis]]></category>
		<category><![CDATA[XoopsEngine]]></category>

		<guid isPermaLink="false">http://dev.xoopsengine.org/?p=68</guid>
		<description><![CDATA[Xoops Engine has a specific built-in persistent layer for system data by utilizing various cache engines at low level, including APC, memcached/memcache, etc. Now Redis becomes a very promising choice for key-value style storage.
APC has been a very favorite recommendation due to its high performance while memcached is also widely adopted for its stable and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.xoopsengine.org">Xoops Engine</a> has a specific built-in persistent layer for system data by utilizing various cache engines at low level, including APC, memcached/memcache, etc. Now <a href="http://redis.io" target="_blank">Redis</a> becomes a very promising choice for key-value style storage.</p>
<p>APC has been a very favorite recommendation due to its high performance while memcached is also widely adopted for its stable and performance. However when Redis comes up with its simple but very demanded features, it is on top of our list due to its excellent performance which is comparable with memcached (<a href="http://antirez.com/post/redis-memcached-benchmark.html" target="_blank">antirez</a>, <a href="http://systoilet.wordpress.com/2010/08/09/redis-vs-memcached/" target="_blank">sys/toilet</a>, <a href="http://timyang.net/data/mcdb-tt-redis/" target="_blank">Tim</a>), and the most desires feature of supporting advanced <a href="http://redis.io/topics/data-types" target="_blank">data structure</a> in addition to strings:</p>
<ul>
<li>Lists of strings</li>
<li>Sets of strings</li>
<li>Sorted sets of strings</li>
<li>Hashes</li>
</ul>
<p>There have been some clients available for PHP, like <a href="https://github.com/nrk/predis" target="_blank">Predis</a> in PHP by nrk and <a href="https://github.com/nicolasff/phpredis" target="_blank">PhpRedis</a> in C by nicolasff. The PhpRedis extension has been installed and implemented in Xoops Engine on a ubuntu/nginx/php-fpm stack at <a href="http://demo.xoopsengine.org">Xoops Engine Demo</a>. Thank Nicolas (<a href="http://twitter.com/yowgi" target="_blank">@yowgi</a>) for his help on serialize option via <a href="http://twitter.com/XoopsProject" target="_blank">tweets</a>.</p>
<p>What&#8217;s next? We might do a thorough benchmark with Redis and Xoops Engine, probably considering <a href="https://github.com/igbinary/igbinary" target="_blank">igbinary</a> extension, then adopt PhpRedis into extended ZF2 libary .</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xoopsengine.org/?feed=rss2&amp;p=68</wfw:commentRss>
		<slash:comments>518</slash:comments>
		</item>
		<item>
		<title>XE TODO for May/June 2011</title>
		<link>http://dev.xoopsengine.org/?p=65</link>
		<comments>http://dev.xoopsengine.org/?p=65#comments</comments>
		<pubDate>Tue, 03 May 2011 05:38:53 +0000</pubDate>
		<dc:creator>taiwen</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[XoopsEngine]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://dev.xoopsengine.org/?p=65</guid>
		<description><![CDATA[Along with the XE Alpha 2 release, I am going to step back from XE new development and concentrate on maintenance and the theme is:
Build development environment for developers and designers.
Some of my personal plans related to XE:

Tutorials for development tools
Introduction to Zend Framework development
Unit test investigation considering ZF2
App/module builder

]]></description>
			<content:encoded><![CDATA[<p>Along with the XE Alpha 2 release, I am going to step back from XE new development and concentrate on maintenance and the theme is:</p>
<p>Build development environment for developers and designers.</p>
<p>Some of my personal plans related to XE:</p>
<ul>
<li>Tutorials for development tools</li>
<li>Introduction to Zend Framework development</li>
<li>Unit test investigation considering ZF2</li>
<li>App/module builder</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dev.xoopsengine.org/?feed=rss2&amp;p=65</wfw:commentRss>
		<slash:comments>1563</slash:comments>
		</item>
		<item>
		<title>Xoops Engine Experiences and Tutorials</title>
		<link>http://dev.xoopsengine.org/?p=58</link>
		<comments>http://dev.xoopsengine.org/?p=58#comments</comments>
		<pubDate>Tue, 03 May 2011 01:34:34 +0000</pubDate>
		<dc:creator>taiwen</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[XoopsEngine]]></category>

		<guid isPermaLink="false">http://dev.xoopsengine.org/?p=58</guid>
		<description><![CDATA[It is very exciting to see two videos for Xoops Engine presented by @txmodxoops right after Xoops Engine Alpha 2 release:
* Xoops Engine Alpha 2 installation on wamp server
* Xoops Engine Alpha 2 after installation
Although txmodxoops had not so successful experiences, participating and sharing is the first step to improve our new system.
Soon after the [...]]]></description>
			<content:encoded><![CDATA[<p>It is very exciting to see two videos for Xoops Engine presented by <a rel="external" href="http://twitter.com/txmodxoops" target="_blank">@txmodxoops</a> right after Xoops Engine Alpha 2 release:</p>
<p>* <a rel="external" href="http://www.screenr.com/sOw" target="_blank">Xoops Engine Alpha 2 installation on wamp server</a><br />
* <a rel="external" href="http://www.screenr.com/SXw" target="_blank">Xoops Engine Alpha 2 after installation</a></p>
<p>Although txmodxoops had not so successful experiences, participating and sharing is the first step to improve our new system.</p>
<p>Soon after the two videos, mamba shared his two videos:<br />
* <a rel="external" href="http://www.screenr.com/4Zw" target="_blank">Installing Xoops Engine Alpha 2 on WAMP server</a><br />
* <a rel="external" href="http://www.screenr.com/zZw" target="_blank">Installing XOOPS legacy modules in Xoops Engine</a></p>
<p>For deployment and installation on nix systems please check :<br />
* <a rel="external" href="http://www.screenr.com/6Zw" target="_blank">Xoops Engine Alpha 2 deployment and permission settings</a><br />
* <a rel="external" href="http://www.screenr.com/8kw" target="_blank">Xoops Engine Alpha 2 installation on ubuntu/nginx stack</a></p>
<p>Please share your Xoops Engine experiences on twitter with <a rel="external" href="http://twitter.com/XoopsProject" target="_blank">@XoopsProject</a> casually but quickly.<br />
And report your issues to <a rel="external" href="https://github.com/xoops/engine/issues" target="_blank">Github issue tracker</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xoopsengine.org/?feed=rss2&amp;p=58</wfw:commentRss>
		<slash:comments>522</slash:comments>
		</item>
		<item>
		<title>Xoops Engine Alpha 2 Release</title>
		<link>http://dev.xoopsengine.org/?p=56</link>
		<comments>http://dev.xoopsengine.org/?p=56#comments</comments>
		<pubDate>Mon, 02 May 2011 09:07:18 +0000</pubDate>
		<dc:creator>taiwen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Smarty]]></category>
		<category><![CDATA[XoopsEngine]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://dev.xoopsengine.org/?p=56</guid>
		<description><![CDATA[Today we are proudly to present XOOPS community with Xoops Engine Alpha 2 release.
Since  the Alpha 1 Release in January 2011, there have been many progresses in  Xoops Engine development. XOOPS, or eXtensible Object Oriented Portal  System, well known as a leading open source CMS and portal system, now  becomes a [...]]]></description>
			<content:encoded><![CDATA[<p>Today we are proudly to present XOOPS community with Xoops Engine Alpha 2 release.</p>
<p>Since  the Alpha 1 Release in January 2011, there have been many progresses in  Xoops Engine development. XOOPS, or eXtensible Object Oriented Portal  System, well known as a leading open source CMS and portal system, now  becomes a development engine for web and mobile applications.</p>
<p>XoopsEngine,  as the new brand of the XOOPS Project, supports open and extensible  engines backboned with its multi-engine architecture. By taking  advantages of PHP frameworks like Zend Framework, template engine Smarty  and AJAX libraries like jQuery, the Xoops Engine brings the Project to a  new generation.</p>
<p>Some selected features that are most wanted by community available in Xoops Engine:<br />
* Built-in cache mechanism for high performance<br />
* Clear M-V-C with AOP and event hook<br />
* Extensible URL rewrite for better SEO<br />
* App/module clone and theme inheritance for application extension<br />
* New model mechanism for easy development with less code<br />
* New layout/block/widget for flexible and better user experience</p>
<p>After  Alpha1 release many developers have started to contribute to Xoops  Engine development, including well know developers from other open  source projects.<br />
Some of the new progresses in Alpha 2:<br />
* Namespace for apps and modules<br />
* WYSIWYG editor factory with CKEditor and jQuery based ClEditor<br />
* Security handler and resource, added XSS filter, IP protection, super global contamination, etc.<br />
* Block and theme mechanism improvement<br />
* Protection for config files<br />
* First Xoops Engine themes by insraq and voltan<br />
Special thank goes to <a rel="external" href="http://xoops.org.cn/" target="_blank">Xoops China Team</a>.</p>
<p>For more details please check:<br />
* Xoops Engine Development: <a title="http://www.xoopsengine.org" rel="external" href="http://www.xoopsengine.org/" target="_blank">http://www.xoopsengine.org</a><br />
* Follow us on twitter: <a title="http://twitter.com/XoopsProject" rel="external" href="http://twitter.com/XoopsProject" target="_blank">http://twitter.com/XoopsProject</a><br />
* Discussion: <a title="http://xoops.org/modules/newbb/index.php?cat=11" rel="external" href="http://xoops.org/modules/newbb/index.php?cat=11" target="_blank">http://xoops.org/modules/newbb/index.php?cat=11</a></p>
<p>Don&#8217;t forget to download Xoops Engine Alpha 2:<br />
* <a rel="external" href="https://github.com/xoops/releases/zipball/Alpha2" target="_blank">The full package</a><br />
* <a rel="external" href="https://github.com/xoops/engine/zipball/Alpha2" target="_blank">Only the new engine</a><br />
And report your issues to: <a title="https://github.com/xoops/engine/issues" rel="external" href="https://github.com/xoops/engine/issues" target="_blank">https://github.com/xoops/engine/issues</a></p>
<p>Taiwen Jiang (aka phppp)<br />
Xoops Engine Development Team<br />
April 30th, 2011</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xoopsengine.org/?feed=rss2&amp;p=56</wfw:commentRss>
		<slash:comments>6821</slash:comments>
		</item>
		<item>
		<title>Updates on Xoops Engine and XOOPS 2 development as of April 8th</title>
		<link>http://dev.xoopsengine.org/?p=41</link>
		<comments>http://dev.xoopsengine.org/?p=41#comments</comments>
		<pubDate>Sat, 09 Apr 2011 04:00:53 +0000</pubDate>
		<dc:creator>taiwen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Xoops Engine]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://dev.xoopsengine.org/?p=41</guid>
		<description><![CDATA[XOOPS development is getting more active recently.
Xoops Engine, the next generation of XOOPS system, is redesigned with brand-new architecture and development standards by adopting cutting-edge libraries like Zend Framework 2 and Smarty 3.
Following the first public press in Nov 2010 in Beijing and Alpha 1 release on January 27th, the Xoops Engine Alpha 2 is [...]]]></description>
			<content:encoded><![CDATA[<p>XOOPS development is getting more active recently.</p>
<p><a title="Xoops Engine Development" href="http://www.xoopsengine.org" target="_blank">Xoops Engine</a>, the next generation of XOOPS system, is redesigned with brand-new architecture and development standards by adopting cutting-edge libraries like <a title="ZF 2" href="https://github.com/zendframework/zf2" target="_blank">Zend Framework 2</a> and <a title="SMARTY" href="http://www.smarty.net" target="_blank">Smarty</a> 3.</p>
<p>Following <a title="X3 and Open Source Conference" href="http://xoops.org/modules/news/article.php?storyid=5686" target="_blank">the first public press in Nov 2010 in Beijing</a> and <a title="Xoops Engine Alpha 1 Release" href="http://xoops.org/modules/news/article.php?storyid=5782" target="_blank">Alpha 1 release on January 27th</a>, the Xoops Engine Alpha 2 is coming to us. We are very happy to see more and more contributors joining us. Some of the names might be known or not known to you: designers like insraq and voltan have made new themes for Xoops Engine, Dong Lijun leads a dev team with ezsky on kernel test and app development as well as tech docs, kilica starts working on Xoops Engine and will provide us a most-wanted app, Marcus starts on kernel review and relevant docs &#8230; The list is too long to mention here, you will see them very soon. There are some very talented developers from other well-known open source projects starting to work on Xoops Engine kernel and apps, they desire to not disclose their names at this moment but time won&#8217;t be long before they introduce themselves with their exciting apps.</p>
<p>The XOOPS 2.* series is being improved continuously. On April 8th 2011, <a title="XOOPS 2.5.1 Final" href="http://xoops.org/modules/news/article.php?storyid=5881" target="_blank">XOOPS 2.5.1 Final</a> was released following its RC on March 17. The 2.5 series has been an community based improvement over 2.3/2.4, some proof-of-concept features are also introduced for a smoothy migration to Xoops Engine.</p>
<p>In the coming months, we will continue the exciting activities to get Xoops Engine ready as early as possible. Meanwhile XOOPS 2.5* series is maintained for bugfixes and security improvements.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xoopsengine.org/?feed=rss2&amp;p=41</wfw:commentRss>
		<slash:comments>522</slash:comments>
		</item>
		<item>
		<title>Xoops Engine Coding Standards &#8211; drafting</title>
		<link>http://dev.xoopsengine.org/?p=38</link>
		<comments>http://dev.xoopsengine.org/?p=38#comments</comments>
		<pubDate>Sat, 12 Mar 2011 02:04:02 +0000</pubDate>
		<dc:creator>taiwen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[coding standard]]></category>
		<category><![CDATA[namespace]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://dev.xoopsengine.org/?p=38</guid>
		<description><![CDATA[As Zend Framework is the primary library for us, Xoops Engine Coding Standards are built primarily based on ZF standards.
Recently Matthew Weier O&#8217;Phinney, lead developer for ZF, is working on &#8220;Zend Framework 2 Coding Standards&#8221; drafts.
At this moment, what I propose for Xoops Engine, in terms of naming conventions:

for user extensions and third-party contributions, including [...]]]></description>
			<content:encoded><![CDATA[<p>As <a href="http://framework.zend.com" target="_blank">Zend Framework</a> is the primary library for us, Xoops Engine Coding Standards are built primarily based on ZF standards.</p>
<p>Recently <a href="http://weierophinney.net/matthew/" target="_blank">Matthew Weier O&#8217;Phinney</a>, lead developer for ZF, is working on &#8220;<em>Zend Framework 2 Coding Standards</em>&#8221; drafts.</p>
<p>At this moment, what I propose for Xoops Engine, in terms of naming conventions:</p>
<ul>
<li>for user extensions and third-party contributions, including apps, modules, plugins, themes, etc.,  use lower case for file names and case-insensitive for class names (related to autoloader, this might be changed in the future);</li>
<li>otherwise, following ZF2 coding standards as proposed by Matthew below.</li>
</ul>
<p><span id="more-38"></span></p>
<h1 id="toc_1">Zend Framework 2 Coding Standards</h1>
<h2 id="toc_1.1">Overview</h2>
<h3 id="toc_1.1.1">Scope</h3>
<p>This document provides guidelines for code formatting and documentation to<br />
individuals and teams contributing to Zend Framework. Many developers using Zend<br />
Framework have also found these coding standards useful because their code&#8217;s<br />
style remains consistent with all Zend Framework code. It is also worth noting<br />
that it requires significant effort to fully specify coding standards.</p>
<blockquote><p>Note: Sometimes developers consider the establishment of a standard more<br />
important than what that standard actually suggests at the most detailed<br />
level of design. The guidelines in Zend Framework&#8217;s coding standards capture<br />
practices that have worked well on the Zend Framework project. You may<br />
modify these standards or use them as is in accordance with the terms of our<br />
<a href="http://framework.zend.com/license">license</a>.</p></blockquote>
<p>Topics covered in Zend Framework&#8217;s coding standards include:</p>
<ul>
<li> PHP File Formatting</li>
<li> Naming Conventions</li>
<li> Coding Style</li>
<li> Inline Documentation</li>
</ul>
<h3 id="toc_1.1.2">Goals</h3>
<p>Coding standards are important in any development project, but they are<br />
particularly important when many developers are working on the same project.<br />
Coding standards help ensure that the code is high quality, has fewer bugs, and<br />
can be easily maintained.</p>
<h3 id="toc_1.1.3">Conventions</h3>
<p>This document attempts to follow <a href="http://www.ietf.org/rfc/rfc2119.txt">RFC 2119</a>&#8217;s verbiage for indicating requirements.</p>
<ul>
<li> MUST and MUST NOT indicate non-optional requirements</li>
<li> SHOULD and SHOULD NOT indicate recommendations for which exceptions may exist</li>
<li> MAY indicates truly optional requirements</li>
</ul>
<h2 id="toc_1.2">PHP File Formatting</h2>
<h3 id="toc_1.2.1">General</h3>
<p>For files that contain only PHP code, the closing tag (<code>?&gt;</code>) MUST NOT be used.<br />
It is not required by PHP, and omitting it prevents the accidental injection of<br />
trailing white space into the response.</p>
<blockquote><p>Note: Important: Inclusion of arbitrary binary data as permitted by<br />
<code>__HALT_COMPILER()</code> MUST NOT be used in PHP files in the Zend Framework<br />
project or files derived from them. Use of this feature is only permitted<br />
for some installation scripts.</p></blockquote>
<h3 id="toc_1.2.2">Indentation</h3>
<p>Indentation MUST consist of 4 spaces. Tabs MUST NOT be used for indentation.</p>
<h3 id="toc_1.2.3">Maximum Line Length</h3>
<p>The target line length is 80 characters. That is to say, Zend Framework<br />
developers SHOULD strive keep each line of their code under 80 characters where<br />
possible and practical. However, longer lines are acceptable in some<br />
circumstances. The maximum length of any line of PHP code is 120 characters.</p>
<h3 id="toc_1.2.4">Line Termination</h3>
<p>Line termination follows the Unix text file convention. Lines MUST end with a<br />
single linefeed (<code>LF</code>) character. Linefeed characters are represented as ordinal<br />
10, or hexadecimal <code>0x0A</code>.</p>
<blockquote><p>Note: Do not use carriage returns (<code>CR</code>) as is the convention in Apple OS&#8217;s<br />
(<code>0x0D</code>) or the carriage return &#8211; linefeed combination (<code>CRLF</code>) as is<br />
standard for the Windows OS (<code>0x0D</code>, <code>0x0A</code>).</p></blockquote>
<h2 id="toc_1.3">Naming Conventions</h2>
<p>Zend Framework standardizes on a class naming convention whereby:</p>
<ul>
<li> Namespaces have a 1:1 relationship to the filesystem.</li>
<li> Classes are stored within the directory determined by the namespace.</li>
</ul>
<p>The root directory of a library contains a directory named after the top-level<br />
namespace; in the case of Zend Framework, the root directory would be<br />
&#8220;library/&#8221;, as it contains the &#8220;Zend/&#8221; directory, which corresponds to the<br />
top-level namespace within the Zend Framework distribution.</p>
<h3 id="toc_1.3.1">Namespaces</h3>
<p>Namespaces MUST contain only alphanumeric characters, the underscore, and, of<br />
course, the namespace separator (<code>\</code>).</p>
<p>Namespaces SHOULD be MixedCase, and acronyms used in namespaces should as well.<br />
As examples:</p>
<ul>
<li> the namespace &#8220;Zend\PDF&#8221; would not be allowed, while &#8220;Zend\Pdf&#8221; is<br />
acceptable.</li>
<li> the namespace &#8220;Zend\XMLRPC&#8221; would not be allowed, while &#8220;Zend\XmlRpc&#8221; is<br />
acceptable.</li>
</ul>
<p>Underscores in namespaces have no special meaning, and will not be translated to<br />
the directory separator.</p>
<p>Code deployed alongside Zend Framework libraries but which is not part of the<br />
Zend Framework standard distribution SHOULD utilize separate namespaces.</p>
<h3 id="toc_1.3.2">Classes</h3>
<p>Class names MUST contain only alphanumeric characters and the underscore.<br />
Numbers are permitted in class names but are discouraged in most cases.<br />
Underscores are only permitted in place of the path separator; a class named<br />
&#8220;Do_Something&#8221; would map to the filename &#8220;Do/Something.php&#8221; (and potentially<br />
under a hierarchy named after any</p>
<p>If a class name is comprised of more than one word, the first letter of each new<br />
word MUST be capitalized. Successive capitalized letters are not allowed, e.g. a<br />
class &#8220;Zend_PDF&#8221; is not allowed while &#8220;Zend_Pdf&#8221; is acceptable.</p>
<p>See the class names in the standard and extras libraries for examples of this<br />
classname convention.</p>
<h3 id="toc_1.3.3">Abstract Classes</h3>
<p>Abstract classes follow the same conventions as classes, with one additional<br />
rule: abstract class names MUST begin with the term, &#8220;Abstract&#8221;. As examples,<br />
&#8220;AbstractAdapter&#8221; and &#8220;AbstractWriter&#8221; are both considered valid abstract<br />
class names.</p>
<p>Abstract classes SHOULD be in the same namespace as concrete implementations.<br />
The following would be considered invalid usage:</p>
<pre>namespace Zend\Log;

abstract class AbstractWriter implements Writer
{
}

namespace Zend\Log\Writer;

use Zend\Log\AbstractWriter;

class StreamWriter extends AbstractWriter
{
}
</pre>
<p>While the next example displays proper usage:</p>
<pre>namespace Zend\Log\Writer;

use Zend\Log\Writer;

abstract class AbstractWriter implements Writer
{
}

class StreamWriter extends AbstractWriter
{
}
</pre>
<h3 id="toc_1.3.4">Interfaces</h3>
<p>Interfaces follow the same conventions as classes, with one additional rule:<br />
interface MUST be nouns or adjectives. As examples, &#8220;ServiceLocation&#8221;,<br />
&#8220;EventCollection&#8221;, and &#8220;PluginLocator&#8221; are all considered appropriate<br />
interface names.</p>
<blockquote><p>Note: In many cases, it can be difficult to identify a good name for an<br />
interface. As an example, for the EventManager component, the name<br />
&#8220;EventManager&#8221; seemed like a likely candidate for both the gateway class as<br />
well as the interface. In cases like these, try and identify the behavior<br />
described by the interface; in this particular case, we named the interface<br />
&#8220;EventCollection&#8221;, as it described a collection of events and handlers, and<br />
the class retained the name of &#8220;EventManager&#8221; as it was a concrete<br />
implementation with actual behaviors that could be called.</p></blockquote>
<h3 id="toc_1.3.5">Filenames</h3>
<p>All other PHP files MUST only use alphanumeric characters, underscores, and the<br />
dash character (&#8220;-&#8221;). Spaces are strictly prohibited.</p>
<p>Any file that contains PHP code SHOULD end with the extension &#8220;.php&#8221;, with the<br />
notable exception of view scripts. The following examples show acceptable<br />
filenames for Zend Framework classes:</p>
<pre>Zend/Db.php

Zend/Controller/Front.php

Zend/View/Helper/FormRadio.php
</pre>
<p>File names MUST map to class names as described above.</p>
<h3 id="toc_1.3.6">Functions and Methods</h3>
<p>Function names MUST contain only alphanumeric characters. Underscores are not<br />
permitted. Numbers are permitted in function names but are discouraged.</p>
<p>Function names MUST always start with a lowercase letter. When a function name<br />
consists of more than one word, the first letter of each new word MUST be<br />
capitalized. This is commonly called &#8220;camelCase&#8221; formatting.</p>
<p>Verbosity is encouraged. Function names should be as verbose as is practical to<br />
fully describe their purpose and behavior.</p>
<p>These are examples of acceptable names for functions:</p>
<pre>filterInput()

getElementById()

widgetFactory()
</pre>
<p>For object-oriented programming, accessors for instance or static variables<br />
SHOULD be prefixed with &#8220;get&#8221; or &#8220;set&#8221;. In implementing design patterns, such as<br />
the singleton or factory patterns, the name of the method SHOULD contain the<br />
pattern name where practical to more thoroughly describe behavior.</p>
<p>For methods on objects that are declared with the &#8220;private&#8221; or &#8220;protected&#8221;<br />
modifier, the first character of the method name MAY be an underscore. This is<br />
the only acceptable application of an underscore in a method name, and is<br />
discouraged (as it makes refactoring to public visibility more difficult).<br />
Methods declared &#8220;public&#8221; SHOULD NOT contain an underscore.</p>
<p>Functions in the global scope (a.k.a &#8220;floating functions&#8221;) MAY be used, but are<br />
discouraged. Consider wrapping these functions in a static class, or within a<br />
specific namespace.</p>
<h3 id="toc_1.3.7">Variables</h3>
<p>Variable names MUST contain only alphanumeric characters. Underscores are not<br />
permitted. Numbers are permitted in variable names but are discouraged in most<br />
cases.</p>
<p>For variables that are declared with <code>private</code> or <code>protected</code> visibility, the<br />
first character of the variable name MAY be a single underscore.  This is the<br />
only acceptable application of an underscore in a variable name, and is<br />
discouraged (as it makes refactoring to public visibility more difficult).<br />
Member variables declared with <code>public</code> visibility SHOULD NOT start with an<br />
underscore.</p>
<p>As with function names, variable names MUST always start with a lowercase letter<br />
and follow the &#8220;camelCaps&#8221; capitalization convention.</p>
<p>Verbosity is encouraged. Variables should always be as verbose as practical to<br />
describe the data that the developer intends to store in them.  Terse variable<br />
names such as &#8220;$i&#8221; and &#8220;$n&#8221; are discouraged for all but the smallest loop<br />
contexts. If a loop contains more than 20 lines of code, the index variables<br />
should have more descriptive names.</p>
<h3 id="toc_1.3.8">Constants</h3>
<p>Constant names MAY contain both alphanumeric characters and underscores.</p>
<p>All letters used in a constant name MUST be capitalized, while all words in a<br />
constant name MUST be separated by underscore characters.</p>
<p>For example, <code>EMBED_SUPPRESS_EMBED_EXCEPTION</code> is permitted but<br />
<code>EMBED_SUPPRESSEMBEDEXCEPTION</code> is not.</p>
<p>Constants MUST be defined as class members with the &#8220;const&#8221; modifier. Constants<br />
MAY be defined in the global scope or within namespaces.</p>
<h2 id="toc_1.4">Coding Style</h2>
<h3 id="toc_1.4.1">PHP Code Demarcation</h3>
<p>PHP code MUST always be delimited by the full-form, standard PHP tags:</p>
<pre>&lt;?php

?&gt;
</pre>
<p>The closing PHP tag (<code>?&gt;</code>) MUST be omitted if no markup or code follows it.</p>
<p>Short tags MUST NOT be used within Zend Framework library code, but MAY be used<br />
within view scripts.</p>
<h3 id="toc_1.4.2">Strings</h3>
<h4 id="toc_1.4.2.1">String Literals</h4>
<p>When a string is literal (contains no variable substitutions), the apostrophe or<br />
&#8220;single quote&#8221; SHOULD be used to demarcate the string:</p>
<pre>$a = 'Example String';
</pre>
<h4 id="toc_1.4.2.2">String Literals Containing Apostrophes</h4>
<p>When a literal string itself contains apostrophes, you MAY demarcate the string<br />
with quotation marks or &#8220;double quotes&#8221;. This is especially useful for SQL<br />
statements:</p>
<pre>$sql = "SELECT `id`, `name` from `people` "
     . "WHERE `name`='Fred' OR `name`='Susan'";
</pre>
<p>This syntax is preferred over escaping apostrophes as it is much easier to read.</p>
<h4 id="toc_1.4.2.3">Variable Substitution</h4>
<p>Variable substitution SHOULD use either of the folowing forms:</p>
<pre>$greeting = "Hello $name, welcome back!";

$greeting = "Hello {$name}, welcome back!";
</pre>
<p>For consistency, this form SHOULD NOT be used:</p>
<pre>$greeting = "Hello ${name}, welcome back!";
</pre>
<h4 id="toc_1.4.2.4">String Concatenation</h4>
<p>Strings MUST be concatenated using the &#8220;.&#8221; operator. A space MUST always be<br />
added before and after the &#8220;.&#8221; operator to improve readability:</p>
<pre>$company = 'Zend' . ' ' . 'Technologies';
</pre>
<p>When concatenating strings with the &#8220;.&#8221; operator, one SHOULD break the statement<br />
into multiple lines to improve readability. In these cases, each successive line<br />
SHOULD be padded with white space such that the &#8220;.&#8221;; operator is aligned under<br />
the &#8220;=&#8221; operator:</p>
<pre>$sql = "SELECT `id`, `name` FROM `people` "
     . "WHERE `name` = 'Susan' "
     . "ORDER BY `name` ASC ";
</pre>
<h4 id="toc_1.4.2.5">Class Names In Strings</h4>
<p>When referencing a class name in a string, the fully qualified class name MUST<br />
be provided, and MUST NOT include a preceding namespace separator. As an<br />
example, if in the namespace &#8220;Zend\Log&#8221;, and referencing the class<br />
&#8220;StreamWriter&#8221; in the &#8220;Writer&#8221; subnamespace, you would use the string<br />
&#8220;Zend\Log\Writer\StreamWriter&#8221;.</p>
<h3 id="toc_1.4.3">Arrays</h3>
<h4 id="toc_1.4.3.1">Numerically Indexed Arrays</h4>
<p>When declaring indexed arrays with the <code>array</code> function, a trailing space MUST<br />
be added after each comma delimiter to improve readability:</p>
<pre>$sampleArray = array(1, 2, 3, 'Zend', 'Studio');
</pre>
<p>It is permitted to declare multi-line indexed arrays using the <code>array</code><br />
construct. In this case, each successive line MUST be padded with spaces such<br />
that beginning of each line is aligned:</p>
<pre>$sampleArray = array(1, 2, 3, 'Zend', 'Studio',
                     $a, $b, $c,
                     56.44, $d, 500);
</pre>
<p>Alternately, the initial array item MAY begin on the following line. If so, it<br />
MUST be padded at one indentation level greater than the line containing the<br />
array declaration, and all successive lines MUST have the same indentation;<br />
the closing paren MUST be on a line by itself at the same indentation level as<br />
the line containing the array declaration:</p>
<pre>$sampleArray = array(
    1, 2, 3, 'Zend', 'Studio',
    $a, $b, $c,
    56.44, $d, 500,
);
</pre>
<p>When using this latter declaration, you SHOULD use a trailing comma for the<br />
last item in the array; this minimizes the impact of adding new items on<br />
successive lines, and helps to ensure no parse errors occur due to a missing<br />
comma.</p>
<h4 id="toc_1.4.3.2">Associative Arrays</h4>
<p>When declaring associative arrays with the <code>array</code> construct, one SHOULD break<br />
the statement into multiple lines. In this case, each successive line MUST be<br />
padded with white space such that both the keys and the values are aligned:</p>
<pre>$sampleArray = array('firstKey'  =&gt; 'firstValue',
                     'secondKey' =&gt; 'secondValue');
</pre>
<p>Alternately, the initial array item MAY begin on the following line. If so, it<br />
MUST be padded at one indentation level greater than the line containing the<br />
array declaration, and all successive lines MUST have the same indentation;<br />
the closing paren MUST be on a line by itself at the same indentation level as<br />
the line containing the array declaration. For readability, the various &#8220;=&gt;&#8221;<br />
assignment operators SHOULD be padded such that they align.</p>
<pre>$sampleArray = array(
    'firstKey'  =&gt; 'firstValue',
    'secondKey' =&gt; 'secondValue',
);
</pre>
<p>When using this latter declaration, one SHOULD use a trailing comma for the<br />
last item in the array; this minimizes the impact of adding new items on<br />
successive lines, and helps to ensure no parse errors occur due to a missing<br />
comma.</p>
<h3 id="toc_1.4.4">Namespaces</h3>
<h4 id="toc_1.4.4.1">Namespace Declaration</h4>
<p>Files SHOULD contain a single namespace; composing multiple namespaces in a<br />
single file is strongly discouraged.</p>
<p>Namespace declarations MUST be the first statement in a file, unless multiple<br />
namespaces are declared; the only code that should precede the declaration<br />
should be a file-level documentation block, with a single empty line between the<br />
docblock and the namespace declaration.</p>
<p>Namespace declarations done according to the above MUST NOT have any<br />
indentation.</p>
<p>In the case that multiple namespace declarations <em>must</em> be placed in the same<br />
file, such declarations MUST utilize blocks and not single-line declarations.<br />
The opening brace MUST be placed on the following line at the same level of<br />
indentation, and all code within the block MUST receive an extra level of<br />
indentation.  For example, the following is invalid:</p>
<pre>namespace Foo;

// some code...

namespace Bar;

// more code...
</pre>
<p>But the following is correct:</p>
<pre>namespace Foo
{
    // some code ...
}

namespace Bar
{
    // more code ...
}
</pre>
<h4 id="toc_1.4.4.2">Import Statements</h4>
<p>All explicit dependencies used by a class MUST be imported. These include<br />
classes and interfaces used in method typehints and explicit <code>instanceof</code> type<br />
checks, classes directly instantiated, etc. Exceptions include:</p>
<ul>
<li>Code within the current namespace or subnamespaces of the current namespace</li>
<li> Class names that are dynamically resolved (e.g., from a plugin broker)</li>
</ul>
<p>Import statements MUST be declared once, at the top of the file, following the<br />
namespace declaration. The <code>use</code> statement SHOULD be issued once, with one<br />
class (and optional alias) per line, separated by commas and terminated on the<br />
last import by a semicolon; class names SHOULD be aligned:</p>
<pre>use Zend\Log\Logger,
    Zend\Event\Eventmanager as Events,
    Zend\View\PhpRenderer as View;
</pre>
<h3 id="toc_1.4.5">Classes</h3>
<h4 id="toc_1.4.5.1">Class Declaration</h4>
<p>Classes MUST be named according to Zend Framework&#8217;s naming conventions.</p>
<p>The brace MUST be written on the line underneath the class name, at the same<br />
level of indentation as the class declaration.</p>
<p>Every class MUST have a documentation block that conforms to the PHPDocumentor<br />
standard.</p>
<p>All code in a class MUST be indented with four spaces additional to the level of<br />
indentation of the class declaration.</p>
<p>PHP files declaring classes MUST contain a single PHP class only.</p>
<p>Placing additional code in class files MAY be done, but is discouraged. In such<br />
files, two blank lines MUST separate the class from any additional PHP code in<br />
the class file.</p>
<p>The following is an example of an acceptable class declaration:</p>
<pre>/**
 * Documentation Block Here
 */
class SampleClass
{
    // all contents of class
    // must be indented four spaces
}
</pre>
<p>Classes that extend other classes or which implement interfaces SHOULD declare<br />
their dependencies on the same line when possible.</p>
<pre>class SampleClass extends FooAbstract implements BarInterface
{
}
</pre>
<p>If as a result of such declarations, the line length exceeds the maximum line<br />
length, break the line before the <code>extends</code> and/or <code>implements</code> keywords, and<br />
pad those lines by one indentation level.</p>
<pre>class SampleClass
    extends FooAbstract
    implements BarInterface
{
}
</pre>
<p>If the class implements multiple interfaces and the declaration exceeds the<br />
maximum line length, break after each comma separating the interfaces, and<br />
indent the interface names such that they align.</p>
<pre>class SampleClass
    implements BarInterface,
               BazInterface
{
}
</pre>
<h4 id="toc_1.4.5.2">Class Member Variables</h4>
<p>Member variables MUST be named according to Zend Framework&#8217;s variable naming<br />
conventions.</p>
<p>Any variables declared in a class MUST be listed at the top of the class, above<br />
the declaration of any methods.</p>
<p>The <code>var</code> construct MUST NOT be used. Member variables MUST declare their<br />
visibility by using one of the <code>private</code>, <code>protected</code>, or <code>public</code> visibility<br />
modifiers.  Giving access to member variables directly by declaring them as<br />
public MAY be done, bug is discouraged in favor of accessor methods (<code>set</code> &amp;</p>
<p><code>get</code>).</p>
<h3 id="toc_1.4.6">Functions and Methods</h3>
<h4 id="toc_1.4.6.1">Function and Method Declaration</h4>
<p>Functions MUST be named according to Zend Framework&#8217;s function naming<br />
conventions.</p>
<p>Methods inside classes MUST always declare their visibility by using one of the<br />
<code>private</code>, <code>protected</code>, or <code>public</code> visibility modifiers.</p>
<p>As with classes, the brace MUST always be written on the line underneath the<br />
function name. Space MUST NOT be inserted between the function name and the<br />
opening parenthesis for the arguments.</p>
<p>Functions SHOULD NOT be declared in the global scope.</p>
<p>The following is an example of an acceptable function declaration in a class:</p>
<pre>/**
 * Documentation Block Here
 */
class Foo
{
    /**
     * Documentation Block Here
     */
    public function bar()
    {
        // all contents of function
        // must be indented four spaces
    }
}
</pre>
<p>In cases where the argument list exceeds the maximum line length, you MAY<br />
introduce line breaks. Additional arguments to the function or method MUST be<br />
indented one additional level beyond the function or method declaration. A line<br />
break MUST occur before the closing argument paren, which MUST be placed on the<br />
same line as the opening brace of the function or method with one space<br />
separating the two, and at the same indentation level as the function or method<br />
declaration. The following is an example of one such situation:</p>
<pre>/**
 * Documentation Block Here
 */
class Foo
{
    /**
     * Documentation Block Here
     */
    public function bar($arg1, $arg2, $arg3,
        $arg4, $arg5, $arg6
    ) {
        // all contents of function
        // must be indented four spaces
    }
}
</pre>
<blockquote><p>Note: Pass-by-reference is the only parameter passing mechanism permitted in<br />
a method declaration.</p></blockquote>
<pre>/**
 * Documentation Block Here
 */
class Foo
{
    /**
     * Documentation Block Here
     */
    public function bar(&amp;$baz)
    {}
}
</pre>
<blockquote><p>Call-time pass-by-reference MUST NOT be used.</p></blockquote>
<p>The return value MUST NOT be enclosed in parentheses. This can hinder<br />
readability, in addition to breaking code if a method is later changed to return<br />
by reference.</p>
<pre>/**
 * Documentation Block Here
 */
class Foo
{
    /**
     * WRONG
     */
    public function bar()
    {
        return($this-&gt;bar);
    }

    /**
     * RIGHT
     */
    public function bar()
    {
        return $this-&gt;bar;
    }
}
</pre>
<h4 id="toc_1.4.6.2">Function and Method Usage</h4>
<p>Function arguments MUST be separated by a single trailing space after the<br />
comma delimiter. The following is an example of an acceptable invocation of a<br />
function that takes three arguments:</p>
<pre>threeArguments(1, 2, 3);
</pre>
<p>Call-time pass-by-reference MUST NOT be used. See the function declarations<br />
section for the proper way to pass function arguments by-reference.</p>
<p>In passing arrays as arguments to a function, the function call MAY include the<br />
<code>array</code> declaration and MAY be split into multiple lines to improve readability.<br />
In such cases, the normal guidelines for writing arrays still apply:</p>
<pre>threeArguments(array(1, 2, 3), 2, 3);

threeArguments(array(1, 2, 3, 'Zend', 'Studio',
                     $a, $b, $c,
                     56.44, $d, 500), 2, 3);

threeArguments(array(
    1, 2, 3, 'Zend', 'Studio',
    $a, $b, $c,
    56.44, $d, 500
), 2, 3);
</pre>
<h3 id="toc_1.4.7">Control Statements</h3>
<h4 id="toc_1.4.7.1">If/Else/Elseif</h4>
<p>Control statements based on the <code>if</code> and <code>elseif</code> constructs MUST have a single<br />
space before the opening parenthesis of the conditional and a single space after<br />
the closing parenthesis.</p>
<p>Within the conditional statements between the parentheses, operators MUST be<br />
separated by spaces for readability. Inner parentheses SHOULD be used to improve<br />
logical grouping for larger conditional expressions.</p>
<p>The opening brace MUST be written on the same line as the conditional statement.<br />
The closing brace MUST be written on its own line. Any content within the braces<br />
MUST be indented using four spaces.</p>
<pre>if ($a != 2) {
    $a = 2;
}
</pre>
<p>If the conditional statement causes the line length to exceed the maximum line<br />
length and has several clauses, you MAY break the conditional into multiple<br />
lines. In such a case, break the line prior to a logic operator, and pad the<br />
line such that it aligns under the first character of the conditional clause.<br />
The closing paren in the conditional will then be placed on a line with the<br />
opening brace, with one space separating the two, at an indentation level<br />
equivalent to the opening control statement.</p>
<pre>if (($a == $b)
    &amp;&amp; ($b == $c)
    || (Foo::CONST == $d)
) {
    $a = $d;
}
</pre>
<p>The intention of this latter declaration format is to prevent issues when adding<br />
or removing clauses from the conditional during later revisions.</p>
<p>For <code>if</code> statements that include <code>elseif</code> or <code>else</code>, the formatting conventions<br />
are similar to the <code>if</code> construct. The following examples demonstrate proper<br />
formatting for <code>if</code> statements with <code>else</code> and/or <code>elseif</code> constructs:</p>
<pre>if ($a != 2) {
    $a = 2;
} else {
    $a = 7;
}

if ($a != 2) {
    $a = 2;
} elseif ($a == 3) {
    $a = 4;
} else {
    $a = 7;
}

if (($a == $b)
    &amp;&amp; ($b == $c)
    || (Foo::CONST == $d)
) {
    $a = $d;
} elseif (($a != $b)
          || ($b != $c)
) {
    $a = $c;
} else {
    $a = $b;
}
</pre>
<p>PHP allows statements to be written without braces in some circumstances. This<br />
coding standard makes no differentiation; all <code>if</code>, <code>elseif</code> or <code>else</code></p>
<p>statements MUST use braces.</p>
<h4 id="toc_1.4.7.2">Switch</h4>
<p>Control statements written with the <code>switch</code> statement MUST have a single space<br />
before the opening parenthesis of the conditional statement and after the<br />
closing parenthesis.</p>
<p>All content within the <code>switch</code> statement MUST be indented using four spaces.<br />
Content under each <code>case</code> statement MUST be indented using an additional four<br />
spaces.</p>
<pre>switch ($numPeople) {
    case 1:
        break;

    case 2:
        break;

    default:
        break;
}
</pre>
<p>The construct <code>default</code> SHOULD NOT be omitted from a <code>switch</code> statement.</p>
<blockquote><p>Note: It is sometimes useful to write a <code>case</code> statement which falls through<br />
to the next case by not including a <code>break</code> or <code>return</code> within that case. To<br />
distinguish these cases from bugs, any <code>case</code> statement where <code>break</code> or</p>
<p><code>return</code> are omitted MUST contain a comment indicating that the <code>break</code> was<br />
intentionally omitted.</p></blockquote>
<h3 id="toc_1.4.8">Inline Documentation</h3>
<h4 id="toc_1.4.8.1">Documentation Format</h4>
<p>All documentation blocks (&#8220;docblocks&#8221;) MUST be compatible with the phpDocumentor<br />
format. Describing the phpDocumentor format is beyond the scope of this<br />
document. For more information, visit: <a href="http://phpdoc.org/">http://phpdoc.org/</a></p>
<p>All class files MUST contain a &#8220;file-level&#8221; docblock at the top of each file and<br />
a &#8220;class-level&#8221; docblock immediately above each class. Examples of such<br />
docblocks can be found below.</p>
<h4 id="toc_1.4.8.2">General Notes</h4>
<p>Classes and interfaces referenced by annotations MUST follow the same resolution<br />
order as PHP. In other words:</p>
<ul>
<li> If the class is in the same namespace, simply refer to the class name without<br />
the namespace:</p>
<pre>namespace Foo\Component;

class Bar
{
    /**
     * Assumes Foo\Component\Baz:
     * @param Baz $baz
     */
    public function doSomething(Baz $baz)
    {
    }
}
</pre>
</li>
<li> If the class is in a subnamespace of the current namespace, refer to it<br />
relative to the current namespace:</p>
<pre>namespace Foo\Component;

class Bar
{
    /**
     * Assumes Foo\Component\Adapter\Baz:
     * @param Adapter\Baz $baz
     */
    public function doSomething(Adapter\Baz $baz)
    {
    }
}
</pre>
</li>
<li> If the class is imported, either via a namespace or explicit class name, use<br />
the name as specified by the import:</p>
<pre>namespace Foo\Component;

use Zend\EventManager\EventManager as Events,
    Zend\Log;

class Bar
{
    /**
     * Assumes Zend\EventManager\Eventmanager and Zend\Log\Logger:
     * @param Events $events
     * @param Log\Logger $log
     */
    public function doSomething(Events $events, Log\Logger $log)
    {
    }
}
</pre>
</li>
<li> If the class is from another namespace, but not explicitly imported, provide<br />
a globally resolvable name:</p>
<pre>namespace Foo\Component;

class Bar
{
    /**
     * Assumes \Zend\EventManager\Eventmanager:
     * @param \Zend\EventManager\EventManager $events
     */
    public function doSomething(\Zend\EventManager\EventManager $events)
    {
    }
}
</pre>
</li>
</ul>
<blockquote><p>Note: This last case should rarely happen, primarily since you should be<br />
importing any dependencies. One case where it may happen, however, is in<br />
<code>@return</code> annotations, as return types might be determined outside the class<br />
scope.</p></blockquote>
<h4 id="toc_1.4.8.3">Files</h4>
<p>Every file that contains PHP code MUST have a docblock at the top of the file<br />
that contains these phpDocumentor tags at a minimum:</p>
<pre>/**
 * Short description for file
 *
 * Long description for file (if any)...
 *
 * LICENSE: Some license information
 *
 * @category   Zend
 * @package    Zend_Magic
 * @subpackage Wand
 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license   BSD License
 */
</pre>
<p>The <code>@category</code> annotation MUST have a value of &#8220;Zend&#8221;.</p>
<p>The <code>@package</code> annotation MUST be assigned, and should be equivalent to the<br />
component name of the class contained in the file; typically, this will only<br />
have two segments, the &#8220;Zend&#8221; prefix, and the component name.</p>
<p>The <code>@subpackage</code> annotation is optional. If provided, it SHOULD be the<br />
subcomponent name, minus the class prefix. In the example above, the assumption<br />
is that the class in the file is either &#8220;Zend_Magic_Wand&#8221;, or uses that<br />
classname as part of its prefix.</p>
<h4 id="toc_1.4.8.4">Classes</h4>
<p>Every class MUST have a docblock that contains these phpDocumentor tags at a<br />
minimum:</p>
<pre>/**
 * Short description for class
 *
 * Long description for class (if any)...
 *
 * @category   Zend
 * @package    Zend_Magic
 * @subpackage Wand
 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license   BSD License
 */
</pre>
<p>The <code>@category</code> annotation MUST have a value of &#8220;Zend&#8221;.</p>
<p>The <code>@package</code> annotation MUST be assigned, and should be equivalent to the<br />
component to which the class belongs; typically, this will only have two<br />
segments, the &#8220;Zend&#8221; prefix, and the component name.</p>
<p>The <code>@subpackage</code> annotation is optional. If provided, it SHOULD be the<br />
subcomponent name, minus the class prefix. In the example above, the assumption<br />
is that the class described is either &#8220;Zend_Magic_Wand&#8221;, or uses that classname<br />
as part of its prefix.</p>
<h4 id="toc_1.4.8.5">Functions</h4>
<p>Every function, including object methods, MUST have a docblock that contains at<br />
a minimum:</p>
<ul>
<li> A description of the function</li>
<li> All of the arguments</li>
<li> All of the possible return values</li>
</ul>
<p>It is not necessary to use the <code>@access</code> annotation because the access level is<br />
already known from the <code>public</code>, <code>private</code>, or <code>protected</code> visibility modifier<br />
used to declare the function.</p>
<p>If a function or method may throw an exception, use <code>@throws</code> for all known<br />
exception classes:</p>
<pre>@throws exceptionclass [description]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.xoopsengine.org/?feed=rss2&amp;p=38</wfw:commentRss>
		<slash:comments>594</slash:comments>
		</item>
		<item>
		<title>App/Module Development Plan for Xoops Engine</title>
		<link>http://dev.xoopsengine.org/?p=34</link>
		<comments>http://dev.xoopsengine.org/?p=34#comments</comments>
		<pubDate>Sun, 06 Mar 2011 07:28:46 +0000</pubDate>
		<dc:creator>taiwen</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[CKeditor]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[OpenID]]></category>
		<category><![CDATA[SSO]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[Xoops Engine]]></category>

		<guid isPermaLink="false">http://dev.xoopsengine.org/?p=34</guid>
		<description><![CDATA[In Immediate TODO as Feb 15th, some TODOs were listed:


Navigation for legacy modules [Done]
Admin for legacy modules [Done]

App admin as parent + module admin in ifrme with auto resize
App admin in frame + module admin in frame
Legacy admin navigation + module admin [In this "native" way]


Installer fix: open_basedir issue reported by fdeconiac [Done]
Clean and refactor [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://dev.xoopsengine.org/?p=19" target="_blank">Immediate TODO as Feb 15th</a>, some TODOs were listed:</p>
<div>
<ul>
<li>Navigation for legacy modules [Done]</li>
<li>Admin for legacy modules [Done]
<ul>
<li>App admin as parent + module admin in ifrme with auto resize</li>
<li>App admin in frame + module admin in frame</li>
<li>Legacy admin navigation + module admin [In this "native" way]</li>
</ul>
</li>
<li>Installer fix: open_basedir issue reported by fdeconiac [Done]</li>
<li>Clean and refactor of “block” engine [Partially]</li>
</ul>
</div>
<div>As you can see, the progress is not bad <img src='http://dev.xoopsengine.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<div>More excited, more and more developers start to work on Xoops Engine.</div>
<div><strong>Theme and design for Xoops Engine</strong>:</p>
<ul>
<li>insraq created a brand new design and theme for installer</li>
<li>insraq, again, created the first community generated theme, will be announced with Xoops Engine Alpha 2</li>
<li>voltan, is about to work on XE templates</li>
</ul>
</div>
<div><strong>Apps and modules for Xoops Engine</strong>, some basic apps have been picked up by some developers:</div>
<div>
<ul>
<li>Content (About us)</li>
<li>Links (Partners)</li>
<li>Slideshow</li>
<li>News</li>
<li>Ask</li>
<li>Contact</li>
<li>Product</li>
<li>Downloads</li>
</ul>
</div>
<div>While I am working on some areas that I think important, or I am good at:</div>
<div>
<ul>
<li>User/Profile module</li>
<li>SSO/OAuth (or OpenID?)</li>
<li>WYSIWYG editor gateway</li>
<li>Integration of editors: jQuery ClEditor; CKeditor with CKFinder</li>
<li>Investigation and learning HTML5 for mobile applications powered by Xoops Engine</li>
<li>Media resource manager</li>
<li>Xoops Cloud: download, online service</li>
</ul>
<p>We are looking forward to more people joining Xoops Engine development &#8230;</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://dev.xoopsengine.org/?feed=rss2&amp;p=34</wfw:commentRss>
		<slash:comments>1485</slash:comments>
		</item>
		<item>
		<title>Naming Conventions for Abstract and Interface</title>
		<link>http://dev.xoopsengine.org/?p=31</link>
		<comments>http://dev.xoopsengine.org/?p=31#comments</comments>
		<pubDate>Sun, 06 Mar 2011 07:00:01 +0000</pubDate>
		<dc:creator>taiwen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[abstract]]></category>
		<category><![CDATA[convention]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[zf2]]></category>

		<guid isPermaLink="false">http://dev.xoopsengine.org/?p=31</guid>
		<description><![CDATA[In Zend Framework 1.*, naming conventions for abstracts and interfaces were not defined quite clearly. Suffix was generally used for abstracts like Zend_[Component]_Abstract, while both suffix and prefix were ever used for interfaces like Zend_[Component]_Interface, Zend_[Component]_[Component]Interface, Zend_[Component]_I[Component]. In ZF2, prefix is used for Abstract as Zend\[Component]\Abstract[Component].
Since Xoops Engine has been developed upon Zend Framework 1.* [...]]]></description>
			<content:encoded><![CDATA[<p>In Zend Framework 1.*, naming conventions for abstracts and interfaces were not defined quite clearly. Suffix was generally used for abstracts like Zend_[Component]_Abstract, while both suffix and prefix were ever used for interfaces like Zend_[Component]_Interface, Zend_[Component]_[Component]Interface, Zend_[Component]_I[Component]. In ZF2, prefix is used for Abstract as Zend\[Component]\Abstract[Component].</p>
<p>Since Xoops Engine has been developed upon Zend Framework 1.* libraries but ZF2 style including namespaces and autoloaders have been implemented in Xoops Engine, it is time to for us to formulate Abstract/Interface conventions.</p>
<p>After some brief research and talking with <a href="https://twitter.com/weierophinney" target="_blank">@weierophinney</a> on twitter, Abstract naming convention will follow ZF2 style, i.e. Xoops\Zend\[Component]\Abstract[Component]. As for interfaces, <a href="https://twitter.com/weierophinney" target="_blank">@weierophinney</a> suggests nouns w/o suffix/prefix; I just feel it not consistent with Abstract, but we will follow the rule any way.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xoopsengine.org/?feed=rss2&amp;p=31</wfw:commentRss>
		<slash:comments>506</slash:comments>
		</item>
	</channel>
</rss>
