<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>http://www.h3rald.com/</id>
  <title>H3RALD - Tag 'php' (Atom Feed)</title>
  <updated>2009-10-27T14:48:00Z</updated>
  <link href="http://www.h3rald.com" rel="alternate"/>
  <link href="http://www.h3rald.com/tags/php/atom/" rel="self"/>
  <author>
    <name>Fabio Cevasco</name>
    <uri>http://www.h3rald.com</uri>
  </author>
  <entry>
    <id>tag:www.h3rald.com,2009-10-27:/articles/getting-started-with-lithium/</id>
    <title>Getting Started with Lithium</title>
    <published>2009-10-27T14:48:00Z</published>
    <updated>2009-10-29T10:50:12Z</updated>
    <link href="http://www.h3rald.com/articles/getting-started-with-lithium/" rel="alternate"/>
    <category term="li3" scheme="http://www.h3rald.com/tags/li3/"/>
    <category term="php" scheme="http://www.h3rald.com/tags/php/"/>
    <category term="tutorial" scheme="http://www.h3rald.com/tags/tutorial/"/>
    <content type="html">
<![CDATA[
<p>So <a href="http://li3.rad-dev.org/">Lithium</a> is now officially out, and its 0.1 release can be freely <a href="http://rad-dev.org/lithium/versions">downloaded</a> from the official web site or by cloning the Lithium git repository. The good news is that although not many web hosts offer <span class="caps">PHP</span> 5.3, you can try it out youself, locally and with minimum effort.</p>
<h3>Requirements</h3>
<p>According to the <a href="http://rad-dev.org/wiki/guides/setup">Lithium Wiki</a>, to develop applications with Lithium you need:</p>
<ul>
	<li>A web server, like Apache or <span class="caps">IIS</span></li>
	<li><span class="caps">PHP</span> 5.3.0 or higher</li>
	<li>Git (not required, but all example projects are on git repos, so you may as well have it)</li>
</ul>
<p>For this tutorial, more specifically, you need to download (just download, don&#8217;t install anything!):</p>
<ul>
	<li><a href="http://code.google.com/p/mongoose/">mongoose</a>, a tiny, standalone (as <em>in one single file</em>), cross-platform web server.</li>
	<li><a href="http://www.php.net/downloads.php#v5"><span class="caps">PHP</span> 5.3.0</a>, not the installer, the zip package.</li>
	<li><a href="http://rad-dev.org/lithium/versions">Lithium</a> (version 0.1, at the time of writing)</li>
	<li>The <a href="http://rad-dev.org/li3_docs">li3_docs plugin</a>.</li>
</ul>
<p>To get the li3_docs plugin you need to <a href="http://rad-dev.org/users/add">register</a> on rad-dev.org, and clone the li3_docs git repository. If you don&#8217;t have git installed or you don&#8217;t want to read <a href="http://spheredev.org/wiki/Git_for_the_lazy">another awesome tutorial</a> to install it and learn how to use it, I&#8217;ll save you the hassle and let you download the plugin from <a href="/files/li3_docs.zip">here</a>, for this time ony.</p>
<p><b>Note:</b> This tutorial assumes that you are on Windows. If you are not, some things may be a bit different depending on your platform.</p>
<h3>Setting up the environment</h3>
<p>Choose a directory on your sistem (let&#8217;s call it <b>D:\lithium_test</b> from now on). We&#8217;ll do everything in here, and you can move it anywhere you like afterwards, even on a <span class="caps">USB</span> stick, without breaking anything.</p>
<ol>
	<li>Unzip Lithium in <b>D:\lithium_test</b>, so that it contains the following files and directories:
	<ul>
		<li>app/</li>
		<li>libraries/</li>
		<li>.htaccess (it won&#8217;t actually be used in this tutorial)</li>
	</ul></li>
	<li>Unzip <span class="caps">PHP</span> 5.3.0 somewhere and copy the following files to the <b>D:\lithium_test</b> folder:
	<ul>
		<li>php5.dll</li>
		<li>php-cgi.exe</li>
		<li>php.ini (just get php.ini-development from the <span class="caps">PHP</span> package and rename it)</li>
	</ul></li>
	<li>Copy the mongoose-2.8.exe executable in <b>D:\lithium_test</b> and rename it to <b>mongoose.exe</b> for convenience.</li>
	<li>Create a <b>mongoose.conf</b> file containing the following lines:</li>
</ol>
<div class="highlight"><pre>cgi_interp      php-cgi.exe
cgi_ext         php
</pre>
</div><p>If you did everything correctly, your <b>D:\lithium_test</b> directory should contain the following:</p>
<ul>
	<li>app\</li>
	<li>libraries\</li>
	<li>.htaccess</li>
	<li>mongoose.exe</li>
	<li>mongoose.conf</li>
	<li>php-cgi.exe</li>
	<li>php.ini</li>
	<li>php5.dll</li>
</ul>
<h3>Running Lithium</h3>
<p>Double click <b>mongoose.exe</b> and point your browser of choice to <a href="http://localhost:8080/app/webroot/index.php">http://localhost:8080/app/webroot/index.php</a>. You should see the Lithium temporary homepage (yes, I expected something fancier too):</p>
<p><img src="/img/pictures/lithium/temp_homepage.png" alt="" /></p>
<p>Now, let&#8217;s see if we can get the li3_docs plugin running as well:</p>
<ol>
	<li>Unzip <b>li3_docs.zip</b> and copy the <b>li3_docs</b> folder in <b>D:\lithium_test\app\libraries\plugins</b>.</li>
	<li>Open <b>D:\lithium_test\app\config\bootstrap.php</b> and add the line: <code>Libraries::add('plugin', 'li3_docs');</code> at the end. I actually found this commented out already (line 80).</li>
</ol>
<p>Go to <a href="http://localhost:8080/app/webroot/index.php?url=docs">http://localhost:8080/app/webroot/index.php?url=docs</a>, you should see something like this:</p>
<p><img src="/img/pictures/lithium/li3_docs.png" alt="" /></p>
<p>Congratulation, you&#8217;re now running your first Lithium application!</p>
<h3>Fixing URLs</h3>
<p>Once the initial excitement wears off you&#8217;ll notice that none of the links on the docs page works.</p>
<p>That&#8217;s because the mongoose web server does not support <span class="caps">URL</span> rewriting (and Lithium needs it badly right now), so we have to change the way URLs are created. <a href="http://twitter.com/nateabele">@nateabele</a> gave me <a href="http://pastium.org/view/3a966c1446fcbd1d4f5a94d882256987">some tips</a> on how to do this; it&#8217;s very simple:</p>
<ol>
	<li>Create a directory called <b>action</b> in <b>D:\lithium_test\app\extensions</b>.</li>
	<li>Create a file called <b>Request.php</b>, containing the following:</li>
</ol>
<div class="highlight"><pre><span class="cp">&lt;?php</span>
<span class="nx">namespace</span> <span class="nx">app</span><span class="err">\</span><span class="nx">extensions</span><span class="err">\</span><span class="nx">action</span><span class="p">;</span>

<span class="k">class</span> <span class="nc">Request</span> <span class="k">extends</span> <span class="err">\</span><span class="nx">lithium</span><span class="err">\</span><span class="nx">action</span><span class="err">\</span><span class="nx">Request</span> <span class="p">{</span>

	<span class="k">protected</span> <span class="k">function</span> <span class="nf">_base</span><span class="p">()</span> <span class="p">{</span>
		<span class="k">return</span>  <span class="s1">&#39;?url=&#39;</span><span class="p">;</span>
	<span class="p">}</span>
<span class="p">}</span>
<span class="cp">?&gt;</span><span class="x"></span>
</pre>
</div><p>We&#8217;re basically extending the <code>\lithium\action\Request</code> with a custom class, telling Lithium how to create the base <span class="caps">URL</span>.</p>
<p>After doing so, open <b>D:\lithium_test\app\webroot\index.php</b> and change:</p>
<p><code>echo lithium\action\Dispatcher::run();</code></p>
<p>into:</p>
<code>echo lithium\action\Dispatcher::run(new app\extensions\action\Request());</code>
<p>In this case, we&#8217;re instructing the dispatcher to use our custom Request class instead of the default one.</p>
<p>Now everything should work as expected. Reload the docs page (<a href="http://localhost:8080/app/webroot/index.php?url=docs">http://localhost:8080/app/webroot/index.php?url=docs</a>) and verify that the links work by navigating to <code>Lithium</code>, then <code>action</code> and finally <code>Controller</code>.</p>
<p>Now you can use Lithium to display its own <span class="caps">API</span> locally (if things didn&#8217;t work out, there&#8217;s always <a href="http://li3.rad-dev.org/docs">http://li3.rad-dev.org/docs</a>).</p>]]>
    </content>
  </entry>
  <entry>
    <id>tag:www.h3rald.com,2009-10-24:/articles/too-many-cooks-take-3/</id>
    <title>Too many cooks... take #3</title>
    <published>2009-10-24T18:26:59Z</published>
    <updated>2009-10-24T19:34:22Z</updated>
    <link href="http://www.h3rald.com/articles/too-many-cooks-take-3/" rel="alternate"/>
    <category term="cakephp" scheme="http://www.h3rald.com/tags/cakephp/"/>
    <category term="rant" scheme="http://www.h3rald.com/tags/rant/"/>
    <category term="php" scheme="http://www.h3rald.com/tags/php/"/>
    <category term="li3" scheme="http://www.h3rald.com/tags/li3/"/>
    <content type="html">
<![CDATA[
<p>Like <a href="http://www.h3rald.com/articles/too-many-cooks-take-2/">its predecessor</a>, this is another rant about the (end of the) <a href="http://www.cakephp.org">CakePHP framework</a>. Not that I particularly enjoy writing about the misfortune of others, but after reading <a href="http://bakery.cakephp.org/articles/view/the-cake-is-still-rising">this official announcement</a> I felt compelled to post.</p>
<p>It has been two years since my last post on this subject and yes, the cake is still rising, but at what price? Will it still taste sweet now that two of its main ingredients are not part of it anymore? As <a href="http://cakebaker.42dh.com/2009/10/23/the-end-of-cakephp/">Daniel</a> puts it, <em>probably the best thing to do now is to drink tea and to wait until the dust settles&#8230;</em></p>
<p>As far as I&#8217;m concerned, what really matters is that Garrett Woodworth (former CakePHP Project Manager) and Nate Abele (former CakePHP Lead Developer) are <em>gone</em>. They realized they had enough Nuts over the years and they decided to switch to a more <a href="http://irc.cakephp.org/logs/link/1110092#message1110102">Lithium-rich</a> diet. More helthy and depression-proof, too!</p>
<p>Stupid metaphors and painful jokes aside, this is probably the best piece of news the CakePHP community received in a long time: the birth of <em>a fork of the CakePHP framework</em>, more precisely of the so-called Cake3 branch.</p>
<p><em>Cake3</em>? I didn&#8217;t keep up-to-date with the buzz, so I didn&#8217;t know anything about this until today, when I decided to finally start catching up.</p>
<blockquote>
<p>&#8220;Cake 3.0, on the other hand, is pretty different from the existing core code in a few notable ways. Mainly, it&#8217;s been re-written from the ground up for <span class="caps">PHP</span> 5.3.&#8221;</p>
</blockquote>
<p style="padding-right:6em;">from <a href="http://debuggable.com/posts/Cake_3_interview_with_Nate_Abele:4a665a5e-5bfc-4e42-96ee-6d284834cda3">Cake 3 interview with Nate Abele</a>, debuggable.com</p>
<p>Of course, in these three years of my full immersion in the Ruby language, I almost completely forgot about <span class="caps">PHP</span> too. <span class="caps">PHP</span> 5.3 means namespace and closures, i.e. the Rubyist&#8217;s daily bread. A more modular CakePHP, properly object-oriented, with an ActiveRecord-like <span class="caps">API</span> for models (finally!) is definitely worth a look, especially if it&#8217;s Nut-free as well.</p>
<p>The new framework will be called <strong>Lithium</strong> (sounds more professional already), and it&#8217;s due to launch next monday, here: <a href="http://li3.rad-dev.org/">http://li3.rad-dev.org/</a> (at the time of writing, this link is password-protected).</p>
<p>Personally, I am <em>very</em> excited about this new project. It should have happened three years ago, really, but there&#8217;s no point in being greedy: the time has finally come. I would like to (pre-)thank Garrett and Nate for their (upcoming) amazing work, I&#8217;ll definitely keep a closer eye on it.</p>]]>
    </content>
  </entry>
  <entry>
    <id>tag:www.h3rald.com,2007-07-19:/articles/akelos-interview/</id>
    <title>An Interview with the creator of the Akelos Framework</title>
    <published>2007-07-19T03:02:00Z</published>
    <updated>2009-09-06T18:10:53Z</updated>
    <link href="http://www.h3rald.com/articles/akelos-interview/" rel="alternate"/>
    <category term="php" scheme="http://www.h3rald.com/tags/php/"/>
    <category term="rails" scheme="http://www.h3rald.com/tags/rails/"/>
    <category term="cakephp" scheme="http://www.h3rald.com/tags/cakephp/"/>
    <category term="frameworks" scheme="http://www.h3rald.com/tags/frameworks/"/>
    <content type="html">
<![CDATA[
<p>I <a href="http://www.h3rald.com/blog/34">already</a> <a href="http://www.h3rald.com/blog/38">covered</a> the Akelos <span class="caps">PHP</span> framework in the past, but for those who don&#8217;t know it, Akelos seems to be one of the few <a href="http://www.h3rald.com/articles/rails-inspired-php-frameworks">Rails-inspired <span class="caps">PHP</span> frameworks</a> still worth mentioning, besides CakePHP and Symphony of course.</p>
<p>I recently has a look at their recently-relaunched <a href="http://www.akelos.org/">community website</a> and I noticed this phrase:</p>
<blockquote>
<p>&#8220;Being port of Ruby on Rails to <span class="caps">PHP</span> Akelos is also optimized for programmer happiness and sustainable productivity&#8221;</p>
</blockquote>
<p>Bermi Ferrer, Akelos creator, openly admits the framework is a port of Ruby on Rails to <span class="caps">PHP</span>, an attempt to help <em>&#8220;Ruby on Rails developers who need to code in <span class="caps">PHP</span>&#8221;</em>, among others. Of course Akelos is not Rails, simply because Ruby is (thank God for that!) not <span class="caps">PHP</span>, however I decided to find out more, and I asked Bermi a few questions, which he promptly answered.<h4><em>There are a lot of frameworks for <span class="caps">PHP</span>, perhaps too many: why did you decide to create Akelos rather than using one of the existing ones?</em></h4></p>
<p>I started coding <a href="http://www.akelos.org/">Akelos</a> back in 2004 for our internal developments.  At that time I only found very few frameworks out there like <a href="http://www.mojavi.org/">Mojavi</a> and <a href="http://ez.no/">eZ Publish</a>. These frameworks were not my ideal of an <a href="http://en.wikipedia.org/wiki/Agile_software_development">Agile development</a> environment, so I decided to brew my own solution.</p>
<p>After reading <a href="http://www.martinfowler.com/books.html">Patterns of Enterprise Application Architecture</a> it was clear to me the kind of framework I wanted <a href="http://www.akelos.org/">Akelos</a> to become,  so I started to implement some of the design patterns from the book into Akelos.</p>
<p>During the summer of 2005 I had a look into other <span class="caps">PHP</span> frameworks like <a href="http://www.cakephp.org/">CakePHP</a>, <a href="http://phpontrax.com/"><span class="caps">PHP</span> on Trax</a>, and <a href="http://www.bennolan.com/biscuit/">Biscuit</a> but none of them was more complete or easier to use than what Akelos was already at that time.</p>
<p>Then I used <a href="http://www.rubyonrails.org/">Rails</a> for one small personal project and immediately found that <a href="http://www.akelos.org/">Akelos</a> interfaces, conventions and philosophy were close to the Rails approach. <a href="http://api.rubyonrails.org/files/vendor/rails/activerecord/README.html">Rails ActiveRecord</a> implementation was impressive, better than mine and much much better than other existing <span class="caps">PHP</span> implementations, so I first ported the ActiveRecord code using <a href="http://adodb.sourceforge.net/"><span class="caps">PHP</span> AdoDB</a> as the database abstraction layer.</p>
<p>After that point, whenever I had a problem to solve while coding my customers applications I turned to Rails and they usually had the most elegant solution available. So I did like the idea of digging into Rails code to learn more Ruby and bringing Rails magic to the <span class="caps">PHP</span> world. It also helped the fact that Rails inline documentation is excellent so it could be easily adapted for Akelos.</p>
<h4><em>What&#8217;s new since last time I posted about Akelos?</em></h4>
<p>The biggest change is the direction that the project has taken. Until now we have not dedicated time to promote Akelos, we just used it for our internal projects and we have been adding features as needed without a fixed roadmap or advocacy.</p>
<p>Now this has changed. More and more developers are using Akelos and contributing functionalities they miss from Rails. After some serious contribution proposals and many developers telling us how much they like Akelos, we decided to take the time to build a nice community site which includes <a href="http://forum.akelos.org/">forums</a>, a <a href="http://wiki.akelos.org/">wiki</a>, a new <a href="http://www.akelos.org/docs/tutorials/booklink">tutorial</a> and <a href="http://www.akelos.org/screencasts">a screen-cast</a>.</p>
<p>There are also some improvements like:</p>
<ul>
<li>Sintags, now accepts ruby-like calls to helper methods from the views.</li>
<li>Action Webservice, a component for creating and consuming Web Services easily.</li>
<li>Action Mailer, which allows you to receive and send (directly or in delayed mode) emails from within your application. (this is almost ready to ship)</li>
<li>Acts as tree behavior for Models.</li>
<li>Many performance improvements.</li>
<li>Many small contributions and bug fixes.</li>
<li>Code base reduced from 16MB to 9MB.</li>
</ul>
<h4><em>From the new site, it seems that Akelos is &#8211; or aims to be &#8211; a port of Rails for <span class="caps">PHP</span>. Is that true? Do you aim to target Rails developers as possible users of the framework in situations in which &#8220;they have no choice&#8221; but to use <span class="caps">PHP</span> instead of Ruby?</em></h4>
<p>Akelos has ported many Ruby on Rails components keeping their interfaces and functionality whenever it was feasible to port the Ruby code to <span class="caps">PHP</span>. It might be considered a port in the sense of functionality, but there are some Rails strengths that rely on the Ruby language and that are impossible to port to <span class="caps">PHP</span>. However, Ruby developers will find that Akelos is the <span class="caps">PHP</span> framework with is the closest to Rails.</p>
<p>On the other hand, many <span class="caps">PHP</span> developers have moved to Ruby because <span class="caps">PHP</span> lacked a hyper-productive and fun-to-use framework like Rails for building complex applications. That is no longer the case, and those who excel at <span class="caps">PHP</span> can start being productive from day one by using Akelos. In this way, Akelos target users are those who already know <span class="caps">PHP</span> and need to build complex applications that can run on almost any cheap shared hosting using a solid foundation based on good coding practices and widely accepted conventions.</p>
<h4><em>What Rails features are missing in Akelos?</em></h4>
<p>A standalone webserver like WebBrick, <span class="caps">RJS</span>, has and belongs to many through associations, string/number/date extensions and Active Resource.</p>
<p>Ruby-powered features like modules, runtime class overriding and blocks will never be available in Akelos.</p>
<p>Scaffolds in Akelos work by generating code, I found quite useless to enable $scaffold = true; and have magic functionality that you can&#8217;t modify, so I decided not to invest my time on that one.</p>
<h4><em>I noticed quite a few generators available for Akelos, do they work as a Rails developer may expect them to work?</em></h4>
<p>The ones that are available do pretty much the same as in RoR.</p>
<h4><em>How does Akelos compare to other similar <span class="caps">PHP</span> frameworks like, say, CakePHP? What features does Akelos offer which Cake doesn&#8217;t offer and vice-versa?</em></h4>
<p>I&#8217;m not aware of Cake&#8217;s functionalities. At the time I started porting Rails my feelings about CakePHP were that they missed the simplicity point in favor of architectural discussions that lead to confusing code, but that was long ago.</p>
<p>Akelos (and Rails) do not implement <span class="caps">ACL</span> like Cake does, as that is a business logic component that varies too much from one case to other, it has no place inside the framework.</p>
<p>Akelos is built with internationalization in its core. You can even internationalize your Models by prefixing the column name with the locale.</p>
<p>I think that Cake only has an act_as_tree behavior on models while Akelos has Tree, Nested Set, and List. Akelos also implements handy features from Rails like <a href="http://en.wikipedia.org/wiki/Optimistic_concurrency_control">optimistic locking</a>, <a href="http://www.martinfowler.com/eaaCatalog/lazyLoad.html">lazy loading</a>, <a href="http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html">table inheritance</a>, counters, automatic transactions, really powerful validations, calculations&#8230;, and I think most of these advanced features are still missing on Cake, but maybe I&#8217;m wrong.</p>
<h4><em>Did you include unit tests for all the framework classes?</em></h4>
<p>The main components are fully unit tested, and no new code or patch gets into the trunk without unit tests.</p>
<h4><em>Did you or someone do any performance test or benchmarks on Akelos already?</em></h4>
<p>During the last month a lot of code was refactored to improve performance with the help of <a href="http://xdebug.org/">Xdebug</a>, <a href="http://kcachegrind.sourceforge.net/">Kcachegrind</a> and <a href="http://httpd.apache.org/docs/2.0/programs/ab.html">ab</a>. We significantly improved the performance in one of our most complex intranet applications, a <a href="http://www.basecamphq.com/">basecamp</a>-like system.</p>
<p>Akelos also implements caching at many levels, so it&#8217;s very easy to increase performance as we did with a new <span class="caps">CMS</span> that can handle +200 requests per second using <a href="http://www.apache.org/">Apache</a> in a cheap shared server environment.</p>
<h4><em>Why should a <span class="caps">PHP</span> developer choose Akelos over another <span class="caps">PHP</span> framework?</em></h4>
<p><a href="http://www.akelos.org/docs/tutorials/booklink#mvc">Akelos <span class="caps">MVC</span> implementation</a> and <a href="http://www.akelos.org/docs/tutorials/booklink#workflow">workflow</a> are really easy to understand.</p>
<p>In Akelos all the methods and interfaces are thoroughly selected, so whenever you need to do something you just need to type what you think. Default options are selected with care so you don&#8217;t need to set any  configuration unless you want to modify the default behavior.</p>
<p>Coding multilingual applications, building complex relationships within models, distributing databases changes within your development team, building Ajax interfaces, unit testing your code and many other common tasks for <span class="caps">PHP</span> developers are really simple to accomplish when using Akelos.</p>
<p>Akelos is designed to work on PHP4 and PHP5 and it comes with an easy web installer you can adapt for your application. It has functions for working with files and directories in common situations when the web server runs as a different user.</p>
<p>And one of the main reasons for choosing Akelos is that it makes coding fun and lets you focus on solving user problems rather than wasting your time in repetitive technical annoyances. When coding with other developers the <em>convention over configuration philosophy</em> helps everybody to understand  exactly how everything works and where to find things.</p>
<h4><em>Is there any website using Akelos already?</em></h4>
<p>The <a href="http://www.thechemicalbrothers.com/">Chemical Brothers</a> new website which has been developed by <a href="http://www.3ev.com/">3rd Eye Vision (3ev)</a> is using Akelos. </p>
<p>The <a href="http://www.akelos.org/">Akelos.org</a> site is running a <span class="caps">CMS</span> named Editam which we will release as Open Source in a near future.</p>
<p>Some small websites like <a href="http://www.fundaciocaixacarlet.com/">Fundacio Caixa Carlet</a> and many intranet/extranet sites that we&#8217;ve been coding during the last 2 years.</p>
<h4><em>What are your future plans for Akelos? Anything new on the way?</em></h4>
<p>A new manual, and a better <span class="caps">API</span> interface are the main priorities right now.</p>
<p>Continuing bringing Rails functionality as needed.</p>
<p>Releasing our sister project Editam <span class="caps">CMS</span> which will help developers who need to add functionality on the top of a <span class="caps">CMS</span> using a solid <span class="caps">MVC</span> framework like Akelos.</p>]]>
    </content>
  </entry>
  <entry>
    <id>tag:www.h3rald.com,2006-08-01:/articles/38/</id>
    <title>Akelos is real, after all...</title>
    <published>2006-08-01T23:33:00Z</published>
    <updated>2009-09-06T18:10:52Z</updated>
    <link href="http://www.h3rald.com/articles/38/" rel="alternate"/>
    <category term="frameworks" scheme="http://www.h3rald.com/tags/frameworks/"/>
    <category term="php" scheme="http://www.h3rald.com/tags/php/"/>
    <category term="webdevelopment" scheme="http://www.h3rald.com/tags/webdevelopment/"/>
    <category term="review" scheme="http://www.h3rald.com/tags/review/"/>
    <content type="html">
<![CDATA[
<p>Bermi Ferrer kept his promise, and even if a few were skeptic on the <a href="http://base--/blog/view/34/">pre-announced</a> features of his upcoming Akelos framework, last week he sent me a &#8220;development preview&#8221; and a few days ago he opened the development <span class="caps">SVN</span> repository to the public:</p>
<p><a href="svn://akelos.org/trunk" target="_blank">svn://akelos.org/trunk</a></p>
<p>Go, get it: it&#8217;s worthwhile (see below).</p>
<p>&#8220;[&#8230;] The Akelos Framework is an open-source port of Ruby on Rails to the <span class="caps">PHP</span> programming language.<br />
The main goal of the Akelos Framework is to help programmers to build multilingual database-backed web applications according to the Model-View-Control pattern. It lets you write less code by favoring conventions over configuration.&#8221;</p>
<p>At the Akelos Framework Features page you can find detailed information about what has been already implemented into the framework.</p>
</blockquote>
<p>I think it says it all, well almost. Some people will undoubtedly be disgusted by yet-another-hopeless-Rails-clone: <em>not again!</em> I hear them crying&#8230;</p>
<p>Well, yeah, I think this &#8211; to be honest &#8211; should be the last attempt someone makes to port Rails to <span class="caps">PHP</span> or at least port <em>some features and the overall philosophy</em>, like <a href="http://base--/bookmarks/view/cakephp">CakePHP</a> did: there are honestly too many for one single language. Look at Python, <a href="http://www.djangoproject.com/">Django</a> seems to be the only &#8220;Rails-inspired&#8221; framework available and everyone is happy with it, while as a general rule <span class="caps">PHP</span> folks are never happy with what they already got.</p>
<p>Bermi is undoubtedly one of them, and that&#8217;s the reason he decided to code his very own Rails-inspired framework for <span class="caps">PHP</span>, which is, to date, the most remarkable of the ones I left out (it wasn&#8217;t available at the time) in my <a href="http://base--/articles/rails-inspired-php-frameworks/">article</a>.</p>
<h3>Confirmed Features &amp; Contents</h3>
<p>So well, although I didn&#8217;t really have a proper chance to play with Akelos I can certainly herald some of its &#8211; verified, this time &#8211; features.</p>
<p>For one, it&#8217;s huge. Take Cake, add <em>every excellent, useful third party library or class you can possibly thing of</em> and you&#8217;ll get Akelos. No kidding. The unzipped source of the whole framework is a massive 16MB, 8.5 of which constitute the <code>vendors</code> folder. What&#8217;s in it? Well, all this:</p>
<ul>
	<li>ADOdb</li>
	<li>Domit</li>
	<li><span class="caps">FPDF</span></li>
	<li>Excel (reader library)</li>
	<li>Hyper Estraier full-text search system</li>
	<li>Inutio <span class="caps">XML</span>-<span class="caps">RPC</span> Library</li>
	<li><em>Many</em> <span class="caps">PEAR</span> packages</li>
	<li>PHPCodeAnalyzer</li>
	<li>PHPmailer</li>
	<li>SimpleTest</li>
	<li>A Simple <span class="caps">PHP</span> <span class="caps">YAML</span> Class</li>
	<li>Textile</li>
</ul>
<p>Then, similarly, all the state-of-the-art Javascript/<span class="caps">AJAX</span> hyper-hyped libraries are included:</p>
<ul>
	<li><span class="caps">AFLAX</span></li>
	<li>Behaviour</li>
	<li>Builder</li>
	<li>various Scriptaculous packages</li>
	<li>Prototype</li>
	<li>FileUploader (by the author, using prototype)</li>
	<li>Window</li>
	<li>EventSelectors</li>
</ul>
<p style="float:left;"><img src="http://base--/img/pictures/frameworks/akelos_framework_logo.gif" alt="" /></p>
<p>Good, well, kind of: that&#8217;s just what <em>others</em> did, but it&#8217;s worth noting that it&#8217;s all there and &#8211; apparently &#8211; integrated with the framework, hopefully not too tightly. But people are fussy, and do not get excited easily anymore, long gone are the early days of Rails, when the whole Internet shake at hearing about <em>code generators</em>&#8230; Aye, there are in Akelos as well, of course!</p>
<p>Coming to the more juicy stuff, <em>lo&#8217; and behold, ye contents of /lib folder (with comments):</em></p>
<ul>
	<li>AkActionController (controller)</li>
	<li>AkActionView (view)</li>
	<li>AkActionWebservice (Web services)</li>
	<li>AkActiveRecord (model)</li>
	<li>AkAdodbCache (content caching)</li>
	<li>AkCharset (utf8 support, includes <em>all</em> mappings)</li>
	<li>AkConfig (load config settings)</li>
	<li>AkConverters (conversions!)
	<ul>
		<li>DBDesigner &gt; AkelosDatabaseDesign</li>
		<li>Excel &gt; Array (bi-dimensional)</li>
		<li>Excel &gt; <span class="caps">CSV</span></li>
		<li><span class="caps">HTML</span> &gt; <span class="caps">RTF</span></li>
		<li><span class="caps">HTML</span> &gt; Text</li>
		<li>Word &gt; Unicode</li>
		<li><span class="caps">PDF</span> &gt; Text</li>
		<li>Xdoc &gt; Text</li>
	</ul></li>
	<li>AkHeaders (<span class="caps">HTTP</span> headers, redirections)</li>
	<li>AkImages (Image operations, resizing)</li>
	<li>AkLocalize (Localization, countries and timezones)</li>
	<li>AkInflector</li>
	<li>AkLogger</li>
	<li>AkFtp</li>
	<li>AkInstaller</li>
	<li>AkRouter</li>
	<li>AkZip</li>
	<li>&#8230;</li>
</ul>
<p>Well, it&#8217;s all there, at any rate. The best way to know if it all works, and <em>how</em> it works, is simply to try it out: <a href="http://www.akelos.org/">www.akelos.org</a>.</p>
<h3>Remarks</h3>
<p>As I said earlier, Akelos looks like <em>CakePHP on steroids</em>: agreed, the Cake philosophy of &#8220;no we-may-use-it code in the trunk&#8221; has been <em>completely</em> (and intentionally) ignored, but this is our chance to peek at what CakePHP could have become if such philosophy didn&#8217;t become a lifestyle for the Cake Dev Team. <br />
Akelos code is Rails-inspired, so yes, it&#8217;s <em>very</em> similar to Cake, although with some rough edges and some re-used parts, but it&#8217;s the work of <span class="caps">ONE</span> person with no community support (yet), don&#8217;t forget. Remarkable.</p>
<p>And he needs co-developers, by the looks of it, so there you are then: there&#8217;s <em>your</em> chance!</p>
<p>My personal opinion about it? Well, I think Akelos can learn from CakePHP and vice-versa: a merge? Well, at least it would reduce the number of Rails-inspired framework for <span class="caps">PHP</span> and <em>possibly</em> meet the needs of more people: those who want just the essentials, as a framework, and those who like to be <em>virtually almighty</em> and be able to do anything, <em>if they wanted to</em>.</p>
<p>Two flavours of the same framework? <em>CakePHP</em> and <em>cAkePHP</em> (note the case)? Bah, let&#8217;s stop raving now, shall we?</p>]]>
    </content>
  </entry>
  <entry>
    <id>tag:www.h3rald.com,2006-06-10:/articles/34/</id>
    <title>Akelos Framework: too good to be true?</title>
    <published>2006-06-10T09:26:00Z</published>
    <updated>2009-09-06T18:10:51Z</updated>
    <link href="http://www.h3rald.com/articles/34/" rel="alternate"/>
    <category term="frameworks" scheme="http://www.h3rald.com/tags/frameworks/"/>
    <category term="php" scheme="http://www.h3rald.com/tags/php/"/>
    <category term="web-development" scheme="http://www.h3rald.com/tags/web-development/"/>
    <category term="review" scheme="http://www.h3rald.com/tags/review/"/>
    <content type="html">
<![CDATA[
<p>Someone recently added a comment to my article about <a href="http://base--/articles/rails-inspired-php-frameworks/">Rails-inspired <span class="caps">PHP</span> frameworks</a> pointing out that I forgot another Rails-like framework, in my round-up. He obviously posted a link to this rather mysterious Rails port in <span class="caps">PHP</span> and spam or not, I&#8217;d like to thank this guy for letting me know of the existance of <a href="http://base--/bookmarks/view/akelos-framework">Akelos</a>, a new <span class="caps">PHP</span> framework which seems simply too good to be true.</p>
<p style="float:left;"><img src="http://base--/img/pictures/frameworks/akelos_framework.png" alt="" /></p>
<p>Let me just spend a few words more before writing more about it though. First off, it&#8217;s not available yet. OR at least it doesn&#8217;t seem to be: the author is planning to release his work to the Open Source community but&#8230; well, he&#8217;s a bit concerned about the current &#8220;<span class="caps">PHP</span> Framework War&#8221;: he wouldn&#8217;t like to end up like <a href="http://subway.python-hosting.com/">Subway</a> or just be slagged off by those merciless reviewers who enjoy write round-ups and comparisons about frameworks. <a href="http://www.bermi.org/page/about_me">Bermi Ferrer</a> is &#8220;just&#8221; a talented <span class="caps">PHP</span> developer who decided to create his own framework and he really enjoyed doing so, nothing more, nothing less.</p>
<p><em>&#8220;I considered other <span class="caps">PHP</span> ports of Ruby on Rails, but we could not find all we needed on them. One feature that I needed on the core was internationalization and Unicode support, so I decided to roll my own framework trying to keep most of the original rails interface so most of its documentation could work for it.&#8221;</em></p>
<p>Where did I hear that? Nothing new: it&#8217;s always the same story of frameworks not being as we want them to be etc., it&#8217;s human. And yes, it&#8217;s <em><strong>another</strong></em> attempt to port Ruby on Rails to <span class="caps">PHP</span>, and a damn good one &#8212; or so it seems.</p>
<p><small>Before proceeding any further, I&#8217;d like to write a short warning for a few people who may or may not want to pop in and start commenting about the Rails-is-better-than-any-<span class="caps">PHP</span>-clone issue: <strong>If I see a single comment slagging off this framework (or any other) only because it&#8217;s a port of Rails to <span class="caps">PHP</span>, it will be deleted, may it be David Heinemeier Hansson himself</strong>. Stop it, no seriously, I think it will be counter productive for Rails in the end: I really like RoR and I love the way it works, and yes, I think Ruby is definitely the best language to do that sort of things, <span class="caps">EVERYBODY</span> <span class="caps">KNOWS</span> <span class="caps">THAT</span>. Please, please, save us poor <span class="caps">PHP</span> developers the usual preaching.</small></p>
<p style="float:right;"><img src="http://base--/img/pictures/frameworks/bermi_ferrer.png" alt="" /></p>
<p>Right, back to Akelos now. Curious as I am I immediately checked out the official page and all i found was a pretty long list of features which made me dribble, literally&#8230; ooops!</p>
<p>Let&#8217;s just quote the most juicy ones, shall we?</p>
<p>Active Record [&#8220;Model&#8221;]</p>
<ul>
	<li>Associations</li>
	<li>Callbacks</li>
	<li><strong>Transactions</strong></li>
	<li><strong>Finders</strong> [ <code>$Project-&gt;findFirstBy('language AND start_year:greater', 'PHP', '2004');</code> ]</li>
	<li>Versioning</li>
	<li>&#8230;</li>
</ul>
<p>Action Controller [&#8220;Controller&#8221;]</p>
<ul>
	<li>Filters</li>
	<li>Pagination</li>
	<li>Mime Type</li>
	<li>Mime Response</li>
	<li><strong>Code Generation</strong></li>
	<li>Response handler</li>
	<li>&#8230;</li>
</ul>
<p>Action View [&#8220;View&#8221;]</p>
<ul>
	<li><strong>Templates (using Sintags)</strong></li>
	<li>Web 2.0 javascript using prototype and script.aculo.us</li>
	<li>Helpers</li>
	<li>Partials</li>
	<li><strong>Template Compilers</strong></li>
	<li>&#8230;</li>
</ul>
<p>And then more Akelos-only goodies:</p>
<ul>
	<li><strong>Multilingual Models and Views</strong></li>
	<li><strong>Locale alias integrated on <span class="caps">URLS</span> (example.com/spanish will load the es_ES locale)</strong></li>
	<li>Database migrations using DB Designer files</li>
	<li><strong>Pure <span class="caps">PHP</span> support for Unicode (no extensions required)</strong></li>
	<li><strong>Unit Tested source code</strong></li>
	<li>Code Generators</li>
	<li>Built in <span class="caps">XHTML</span> validator</li>
	<li>Automated locale management</li>
	<li><strong>Clean separation from <span class="caps">HTML</span> and Javascript using <span class="caps">CSS</span> event selectors.</strong></li>
	<li>Ajax file uploads</li>
	<li><strong><span class="caps">AFLAX</span> integration</strong></li>
	<li>Dojo Rich Text Editor</li>
	<li>Format converters</li>
	<li>File handling using <span class="caps">SFTP</span> for shared host running Apache as user nobody (as most CPanel server do)</li>
	<li><strong>Distributed sessions using databases</strong></li>
</ul>
<p>Impressed? I was, honest. And I&#8217;m talking as a CakePHP fanatic here, and I must say that if this framework can really offer all this <em>and</em> &#8212; and this is what really matters &#8212; is also as simple as Cake to learn and well performing&#8230; well, this is definitely going to be quite a promising player in the &#8220;<span class="caps">PHP</span> Framework War&#8221; (but is not a real war, is it?), although the author is quite worried about that:</p>
<p><em>&#8220;I&#8217;m also concerned about the <span class="caps">PHP</span> Framework war, I don&#8217;t want to play that game. Building this Framework was a great experience, it works great for me and it has helped me to become a better programmer so I don&#8217;t want to spend my time discussing about if this is better or not than other solutions. That&#8217;s the reason I&#8217;ll first look for great developers interested in the Framework to help me releasing it.&#8221;</em></p>
<p>Really, this will be an interesting project to check out, once it goes open source, and yes, I really wish Bermi all the best. Good luck, <a href="http://www.bermi.org/projects/akelos_framework">Akelos Framework</a>.</p>]]>
    </content>
  </entry>
  <entry>
    <id>tag:www.h3rald.com,2006-04-14:/articles/14/</id>
    <title>CakePHP hybrids</title>
    <published>2006-04-14T07:55:00Z</published>
    <updated>2009-09-06T18:10:50Z</updated>
    <link href="http://www.h3rald.com/articles/14/" rel="alternate"/>
    <category term="cakephp" scheme="http://www.h3rald.com/tags/cakephp/"/>
    <category term="webdevelopment" scheme="http://www.h3rald.com/tags/webdevelopment/"/>
    <category term="php" scheme="http://www.h3rald.com/tags/php/"/>
    <content type="html">
<![CDATA[
<p>When I first talked to gwoo, CakePHP&#8217;s project manager, I asked him if Cake had any potential <em>limitations</em>. I asked him &#8211; I was kidding actually &#8211; wether it would be possible to build an application like Gmail using the framework and he &#8211; very seriously &#8211; simply said <em>&#8220;yes, why not?&#8221;</em>. <br />
I repeat myself when I say that CakePHP leaves plenty of freedom to developers within the bounds of its <span class="caps">MVC</span> structure: once you grasp the basic logic behind it, your possibilities are endless. I don&#8217;t want to act as a Ruby on Rails fanatic and boast that <em>you can do anything  with CakePHP</em> and things like that, but I can certainly say that CakePHP can be <em>extended</em> and <em>integrated</em> with other collections of scripts, frameworks and projects. With limitations, of course: you probably don&#8217;t want to force an integration between CakePHP and another <span class="caps">MVC</span>/Event Driven/Whatever framework, simply because it would be rather pointless and potential conflicts may occur.</p>
<p>What I keep finding online is other open source projects adopting CakePHP as <em>backend</em> and <em>structure</em>. I&#8217;m sure there are many examples which could be mentioned here, but I chose two in particular: one has been around for a few months and the other is just born.</p>
<p style="float:left;"><img src="http://base--/img/pictures/amfphp.jpg" alt="" /></p>
<p><a href="http://amfphp.org/"><span class="caps">AMFPHP</span></a> is quite an interesting project:</p>
<blockquote>
<p>&#8220;[it] is an open-source Flash Remoting gateway. It&#8217;s fast, reliable, 100% free and open-source. Flash Remoting is a technology built into the Flash player core that enables sending data between the server and the client seemlessly.&#8221;</p>
</blockquote>
<p>In other words, it makes lifes much easier for developers who&#8217;d like to integrate their flash animations and script more tightly into their <span class="caps">PHP</span> application. If you are curious to see some results, head off to <span class="caps">AMFPHP</span> <a href="http://amfphp.org/showcase.html">showcase</a>.<br />
Cool, but what has this project to do with CakePHP? Well, gwoo recently created <a href="http://cakeforge.org/projects/cakeamfphp/">CakeAMFPHP</a>, a CakeForge project which just yesterday reached its <a href="http://rd11.com/posts/view/21">0.4.0 release</a>, and it&#8217;s fully compatible with <span class="caps">AMFPHP</span> 1.2.3 and CakePHP 0.10 final.<br />
Here&#8217;s an excerpt taken from CakeAMFPHP <span class="caps">README</span>.txt file:</p>
<blockquote>
<p>&#8220;[&#8230;] <br />
1) get CakePHP 0.10 final (http://cakephp.org)<br />
2) get amfphp 1.2.3 (http://amfphp.org)<br />
3) get the <span class="caps">UFO</span> js http://www.bobbyvandersluis.com/ufo/<br />
4) put amfphp into /app/vendors<br />
5) put cakeamfphp into vendors<br />
6) put the cake_gateway.php in /app/webroot<br />
7) put the cakeamfphp.php in /app/views/helpers<br />
8) put CakeMySqlAdpater.php in /app/vendors/amfphp-core/adapters<br />
9) Voila: NetServices.setDefaultGatewayUrl( &#8216;http://localhost/cake_install/cake_gateway.php&#8217;);<br />
Access the service browser through<br />
http://localhost/cake_install/vendors/cakeamfphp/cakebrowser/&#8221;</p>
</blockquote>
<p>The installation doesn&#8217;t seem too painful at all. And &#8211; guess what &#8211; gwoo recently updated a very informative tutorial showing how to create a simple &#8211; but still impressive &#8211; bullettin board with CakeAMFPHP.</p>
<p><em>&#8220;Cool, but I never liked flash, what about <span class="caps">AJAX</span>?&#8221;</em></p>
<p style="float:left;"><img src="http://base--/img/pictures/qooxdoo.gif" alt="" /></p>
<p>CakePHP has a nice <span class="caps">AJAX</span> helper to be used in conjunction with <a href="http://prototype.conio.net/">prototype</a>, but there are truly a lot of libraries, mini-frameworks, pre-built applications to create interactive desktop-like user interfaces. Some people may already know <a href="http://qooxdoo.oss.schlund.de/">qooxdoo</a>,</p>
<blockquote>
<p>&#8220;[&#8230;] an advanced open-source JavaScript-based <span class="caps">GUI</span> toolkit. qooxdoo continues where simple <span class="caps">HTML</span> is not enough. This way qooxdoo can help you implement your <span class="caps">AJAX</span>-enhanced web 2.0 application &#8211; easier than ever before.&#8221;</p>
</blockquote>
<p>In a recent <a href="http://groups.google.com/group/cake-php/browse_thread/thread/ba219c64cd794764/1d77973293514618?lnk=raot">discussion</a> on CakePHP user group someone suggested the possibility to integrate qooxdoo with CakePHP. Apparently qooxdoo people were <a href="http://www.nabble.com/Re%3A-qooxdoo-PHP-framework-project-p3799302.html">evaluating</a> various <span class="caps">MVC</span> frameworks, and Cake was obviously listed together with two other Rails clones for <span class="caps">PHP</span>. The good news is that <a href="http://cakeforge.org/users/a100rk/">100rk</a> just started a new project called <a href="http://cakeforge.org/projects/cqx"><span class="caps">CQX</span></a>, which &#8211; although still in pre-alpha a development demo is already available, and it <em>shows off</em> most of qooxdoo&#8217;s features&#8230; <a href="http://cqx.100rk.org/trunk/">Take a look</a></p>
<p>Best of luck to 100rk and his brand new project, I really hope to see more of it soon!</p>]]>
    </content>
  </entry>
  <entry>
    <id>tag:www.h3rald.com,2006-01-12:/articles/a-look-at-drupal/</id>
    <title>A look at Drupal</title>
    <published>2006-01-12T06:42:44Z</published>
    <updated>2009-09-06T18:10:49Z</updated>
    <link href="http://www.h3rald.com/articles/a-look-at-drupal/" rel="alternate"/>
    <category term="php" scheme="http://www.h3rald.com/tags/php/"/>
    <category term="webdevelopment" scheme="http://www.h3rald.com/tags/webdevelopment/"/>
    <category term="review" scheme="http://www.h3rald.com/tags/review/"/>
    <content type="html">
<![CDATA[
<em><strong>Important Notice:</strong> This article is about changes occurring to zZine Magazine's site[1]. At the time of writing, <a href="www.zzine.org">www.zzine.org</a> uses the old site, and not the Drupal-based one presented in this article, which is currently under construction[18].</em><br />
<br />
"Why can't we log who edits the articles?"<br />
"Can we send newsletters?"<br />
"We should really have a members' area..."<br />
<br />
zZine.org[1] is a scratch-built site, coded from the ground up to offer zZine journalists, editors and readers all the functionalities and features they wanted.  I'm not totally against sites being coded from scratch, but what happens if something needs to be fixed, or new functionalities have to be implemented and you realize that the code cannot be extended or patched easily?<strong>Case Study: zZine Magazine</strong><br />
<br />
zZine Magazine is an online magazine which publishes not only IT-related and other articles on a weekly basis, but also monthly publications containing CyberArmy[2] digests, special columns, and featured articles. A team of journalists, researchers, editors, publishers and outside contributors has access to the zZine site to write, submit, and edit articles, manage publications and perform various other tasks through a password-protected administration area. This is common to approximately 75% of the websites on the Internet: they have a front-end to present content to the general public and a semi-hidden administration backend which is normally more difficult and tedious to code. That's why someone started developing <em>Content Management Systems</em>[3]: ready-made, fully-featured administrative back-ends for creating and managing almost any kind of website, from blogs to eCommerce portals.<br />
<br />
Could a CMS be used for zZine Magazine? Probably - zZine doesn't need any innovative or advanced features, just a bunch of commonly-used functionalities like:<br />
<ul><br />
 	<li>Add, delete, edit and publish articles<br />
 	</li><li>Customizable user permissions, ideally role-based </li>(writer, editor, publisher, etc.)<br />
 	<li>Creating and managing monthly publications<br />
 	</li><li>Editor's tests<br />
 	</li><li>User signups, notifications, etc.<br />
 	</li><li>RSS feed generation<br />
 	</li><li>Sending newsletters to subscribers<br />
 	</li><li>Logging user actions<br />
</li></ul><br />
Some members of my team raised some concerns regarding the usage of a CMS, which were mostly based on our past experience with just a particular product and not CMSes in general. Everybody agreed that if we were to go back to a CMS, we <em>had</em> to choose the <em>best</em> this time: something flexible, easy to use, fast, search-engine friendly, and extensible.  I  spent some time researching CMSes, because while I knew that there's no such thing as the best CMS, there was certainly a CMS that was best for our needs.<br />
<br />
<br />
<strong>Making the right choice</strong><br />
<br />
In the past, I had played around with Xoops[4] when I first thought about creating websites, and I used Mambo[5] for some other sites. I admit that I never actually spent time creating complex Mambo components and modules, but I must say that in the end I felt somehow tied to third-party modules and unable to understand how they really worked: Mambo seemed to give developers too much freedom, and had neither a solid API nor conventions to follow, at least when I used it.<br />
<br />
So I decided to have a look around again, starting from the two most important sites people should look at when choosing the most suitable CMS for their work. <br />
The first site is CMS Matrix[6] which - as the name implies - provides a really handy <em>matrix</em>, or chart, to compare the various features offered by nearly all CMS available, both proprietary and open-source.<br />
<br />
I remember choosing Mambo last time I used the matrix simply because it appeared to be one of the most feature-rich. This is actually something <em>not</em> to do when choosing a CMS: always concentrate on what your site needs rather than what the CMS is able to offer.  Otherwise, you run the risk of having too much to work with.<br />
<br />
The other important website to visit when choosing a Content Management System is OpenSourceCMS[7], which basically allows you to try a demo of every open source CMS online. This is perhaps more useful, but also much more time-consuming: it's better to narrow down the list of possible CMSes after checking CMS Matrix and then try each one rather than just picking one at  random.<br />
<br />
At this point, an experienced CyberArmy staff member[8] suggested Drupal[9]. I asked her why, and she simply said that it seemed to be the best choice according to zZine's needs, as it basically offered all the features we were looking for, either natively or through modules. She also admitted to be biased, as she's actually <em>part of Drupal's documentation team</em> and involved with Drupal development[10].<br />
<br />
Before making any kind of commitment, I checked out Drupal's website to see how they organized things, and I was quite impressed. I immediately noticed the Handbooks section[11], which contains all the official Drupal documentation and it seemed pretty much complete. No "under construction", "please write content here" or "we're a new project, help us write the documentation" notes, just a load of good-quality documentation, including a fully documented and <em>stable</em> API![12]  <br />
<br />
This surprised me, because some projects I came across, even really good ones, lacked a proper documentation section. I think this is a common problem with new open source projects, and Drupal for this reason gave me the impression to be quite mature and useable already.  After visiting the very clear and organized Downloads Section[13], I downloaded the CMS and a few modules and installed it on my laptop.<br />
<br />
<br />
<strong>Installation</strong><br />
<br />
Drupal needs three things to run:<br />
<ul><br />
 	<li>A web server  -  Apache is fine, and ISS is reported to be working<br />
 	</li><li>PHP - Either version 4 or 5, Drupal started supporting PHP5 since 4.6.0 release<br />
 	</li><li>A PHP-compatible database - MySQL or PostgreSQL is recommended<br />
</li></ul><br />
I used a WAMP[14] installation to test Drupal.  First of all, I created a MySQL database, granting ALL privileges to the database user accessing the Drupal database. When I uploaded the site to the remote server, later on, I had some problems because the LOCK TABLES privilege wasn't granted by the host. Drupal requires this, so I had to contact my host to solve the problem.  I then imported the database scheme located in the <em>database</em> directory under the installation directory and modified the configuration settings (sites/default/settings.php) to allow Drupal to access the database.  Installation complete.<br />
<br />
Drupal was now up and running with the default configuration settings, with a minimum of fuss. For all the details concerning the installation process, consult the exhaustive documentation.[15] I didn't read it when I installed it, but it can really be useful in some situations.<br />
<br />
 There are actually two non-critical things to consider if you're planning to use Drupal for a medium-sized project: the first involves changing a few settings on php.ini, in particular increasing the amount of memory allocated to PHP from 8MB to 16MB, especially if you're planning to use either a lot of  simple modules or a few complex ones, and the second is setting up your crontab to execute <em>http://www.yoursite.com/cron.php</em> every hour or so.  This is required by some semi-essential modules like the site-wide search, but a common alternative (if you don't want to setup the <em>cron</em> task manually) is the poorman's <em>cron</em> module[15], which I used myself and found to be workable. <br />
<br />
<br />
<strong>Keeping your site under control</strong><br />
<br />
Perhaps one of the best things Drupal has to offer is a rock-solid general-purpose administrative backend. The first thing I found in the backend which really impressed me (and that also I never found in another CMS) is the ability to create <em>custom</em> role-based user accounts and access permissions for <em>everything</em>: every module can be configured so that, for example, not all people can see its output and just a few can administer and modify it.<br />
<br />
For zZine, I created four types of accounts:<br />
<ul><br />
 	[*]<em>Administrator</em> - Able to access everything and change every setting of the site<br />
 	[*]<em>Publisher</em> - Able to write, edit and publish every kind of content on the site, but not able to administer user accounts, permissions and similar administrator-only tasks.<br />
 	[*]<em>Editor</em> - Able to write and edit anything on the site, but not to publish it.<br />
 	[*]<em>Writer</em> - Able to write articles, blogs and similar content, but in some cases not allowed to edit it.<br />
</ul><br />
These were precisely the account types I was looking for in a CMS. Granted, other products offer them by default, but having pre-defined account types is one thing, and being able to customize them completely is another.<br />
<br />
User accounts are great, but sometimes it's good to know what the users of your sites are doing as well. On our old site we had user accounts for editors and administrators, and even if only a few people had access we had no way to determine who edited an article or who published something unless that person told us.  Drupal comes with a radical solution to this: Almost every action is automatically logged by the <em>watchdog</em> core module. Every website error, every page not found, and every PHP or MySQL error is logged, as well as every content submission or modification.  Page accesses, meanwhile, can be logged through the statistics module. <br />
<br />
Themes &amp; Templates<br />
<br />
"We shouldn't use a CMS: I don't want zZine to have the overly used *nuke-style look."  I've heard this too many times. Sometimes people associate the word "CMS" with "lack of original design", and that's not true by any means, especially for Drupal.  Of course, there are plenty of ready made themes[16] which can be freely used or modified for any Drupal-based site. <br />
<br />
I must confess that when I first saw the themes section I feared that Drupal "themes" used their own template engine, like some CMSes do nowadays, but I was wrong: currently Drupal supports some template engines[17] but also pure PHP-based ones. Theme engines do their job wonderfully and can offer some interesting features, but templates written natively in PHP tend to perform better, simply because there's no extra parsing or additional overhead involved.<br />
<br />
I decided to have a look at a standard PHP theme. Basically, it's nothing more than a PHP-enriched xHTML file and its corresponding stylesheet. There are a few functions which must be used to perform particular tasks, like showing the main navigation links, but nothing too hard to understand.  It's also <em>very</em> customizable.  In fact, we're already working on a custom zZine theme, which doesn't seem any harder than coding a standard xHTML template. As design should always be the last thing to worry about, I decided to use a temporary template I created by slightly modifying an existing one.[18]<br />
<br />
<br />
<strong>To switch or not to switch?</strong><br />
<br />
When creating a new site for an organization which already has one, there's something very important to consider: <em>what happens to the old data</em>?<br />
Assuming the old site was dynamic and using a database of some sort, there are three possibilities:<br />
<ul><br />
 	<li>Don't bother doing anything: any data on the old site will not be transferred to the new one.<br />
 	</li><li>Make the old website available somewhere else as an </li><em>archive</em> of old documents.<br />
 	<li>Import all the data from the old site to the new one. <br />
</li></ul><br />
Obviously we went straight for the third one, which is the most difficult to implement, but it was necessary: there were over 1000 articles on the old site-<br />
<br />
Of course, in reality, I didn't even mention the possibility of using Drupal until I figured out a way to import the old data into the new database structure. Never praise features or convince people to switch unless you're 100% sure you can handle the situation.  Luckily for me, it turned out that everything could be imported easily enough.<br />
<br />
The first difference I found between Drupal and zZine was that we didn't really have proper user accounts. Every article had an author, but it was stored as a field in the article's record, and that was all. Drupal, on the other hand,  supports (and perhaps requires) user accounts - everything present on the site must be written or edited by an existing user.<br />
<br />
The solution I cam eup with was rather drastic: I created about 120 user accounts, retrieving usernames from the articles and inserting them through a custom PHP script into Drupal's user table. Of course, those users never registered on the new site[18], so I didn't personalize the accounts at all: I simply put a notice on the first page asking everyone who contributed to zZine before to contact me in some way to enable their account with a valid email address.<br />
<br />
After this initial difficulty, importing articles was relatively easy. Pretty much every type of content in Drupal is, in its simplest form, a <em>node</em>. Nodes have a title, which is a teaser generated automatically from the body text, and an author (the node table in the database has more fields, but these are the key ones for us). Essentially, Drupal's two default models for writing <em>stories</em> and <em>pages</em> write data to this table only.  The most important thing to understand about Drupal is that almost every module used to create <em>something</em> on the site - an article, a blog entry, even songs - will use the node table, and add everything else on other tables.  This makes the whole system much easier to administer: every node can potentially be extended <em>in any way</em> by third party modules!  <br />
<br />
What about categories? Well, Drupal has become famous for its taxonomy module: whereas most CMSes only support, or in fact <em>impose</em>, a one- or two-level hierarchy for categories, Drupal's taxonomy module supports the creation of as many different terms to describe data as you can think of. Each piece of content (categorization can be applied to <em>any</em> node, and since almost everything is a node-) can belong to none or <em>n</em> different categories, which can be nested in a <em>n</em>-level hierarchy.  Since the zZine articles were already divided into categories, I imported all of them directly into Drupal.  On the old zZine site, every article could have at most one category, which is fine, but it's good to know that we can now configure the system to support a more advanced categorizing system.<br />
<br />
After importing the articles, the last important thing to transfer to the new site were the zZine Publications. Publications are what we call the article collections that we release as an issue every month.  I could have created a new module for this, and it wouldn't have been that hard, but there was already an excellent module for that. This was pure luck, but the <em>epublish</em>[19] module seemed like it was tailored specifically for our needs.<br />
<br />
<br />
<strong>Drupal API and Modules</strong><br />
<br />
We were lucky enough to be able to use existing modules for the main functionalities of our site, but in some cases you might not be able to find <em>exactly</em> what you're looking for.<br />
 <br />
In our case, even if we could have used the <em>story</em> module, which is part of the default installation, for zZine articles (stories have a body, a teaser,  a title and an author, exactly like our articles) we decided not to. I wanted our editors and writers to know what to use when submitting articles, and the name "stories" sounds a bit too ambiguous for my liking.  So, I decided to have a look at the standard story module to see how modules work, and create something similar.<br />
<br />
<em>Note: I'm curious by nature and I didn't read anything in the Drupal API[12], or about developing custom modules; I looked at the story module without any prior knowledge of Drupal's conventions.</em><br />
<br />
All I found in the story module was a bunch of functions like:<br />
<code><br />
/**<br />
 * Implementation of hook_node_name().<br />
 */<br />
function story_node_name($node) {<br />
  return t('story');<br />
}<br />
</code><br />
<br />
  which seemed to be enough to tell the Drupal core what to do. I was used to Mambo components, where developers have more liberty to do what they want, including outputting HTML code anywhere. Drupal is nothing like that; on the contrary, it has its own structure and coding conventions that developers have to follow when creating custom modules. Even if a simple function like the one above is fully commented, it has to have a standard indentation (two spaces) and an obviously standardized name. I noticed that all the functions similar to this one started with "<em>story_</em>", so I created a new file named <em>zzarticle.module</em>, copied and pasted the story module code into it, and changed every function accordingly, like this:<br />
<code><br />
/**<br />
 * Implementation of hook_node_name().<br />
 */<br />
function zzarticle_node_name($node) {<br />
  return t('zZine Article');<br />
} <br />
</code><br />
Trivial enough, and it worked fine! I put my shamefully copied module in the /modules directory and I was able to create "zZine Articles" (which were nothing but stories with a different name).<br />
<br />
At this point I decided to have a proper look at the API, and read about hooks:<br />
<br />
<fieldset><blockquote><em>"Drupal's module system is based on the concept of "hooks". A hook is a PHP function that is named foo_bar(), where "foo" is the name of the module (whose filename is thus foo.module) and "bar" is the name of the hook. Each hook has a defined set of parameters and a specified result type.<br />
 To extend Drupal, a module need simply implement a hook. When Drupal wishes to allow intervention from modules, it determines which modules implement a hook and call that hook in all enabled modules that implement it. [-]"</em></blockquote></fieldset><br />
A <em>hook</em> was used for the previously mentioned function, and this was diligently commented:<br />
<br />
<code><br />
/**<br />
 * Implementation of hook_node_name().<br />
 */<br />
</code><br />
<br />
This made me understand how Drupal is actually geared towards developers and at the same time suitable for non-technical users.  Wait a minute, what if someone is not familiar with PHP and still needs custom modules and features? Is there any way to extend Drupal without having to physically code new things? Yes, there is, and two modules come to mind:<br />
<ul><br />
<br />
 	[*]<em>Webform</em> - allows the creation of any kind of web form. Users can customize field types, values, labels and messages.  The module also provides ways to process forms by either saving data to the database or emailing it, which we can use for things like the Editor's Test and surveys.<br />
 	[*]<em>Flexynode</em> - This module is simple and powerful - it allows users to create their own content types without coding a single line. In my example, I cloned the story module to create the zZine Article content type. This is easy to do, and functional, but what happens if someone wants to include an additional field to the article submission form? I can probably do this using hooks, but if I was lazy I could do the same thing with the <em>flexynode</em> module. I actually used this module for our podcast section[20], and it did an excellent job.<br />
</ul><br />
<br />
<strong>Conclusions</strong><br />
<br />
For now I must say I'm very happy with what Drupal has to offer, and if there's something we need for the site, we can code it ourselves and then integrate it into Drupal. <br />
One of the major strengths of this CMS is definitely its developer-friendliness: while other CMSes mainly focus on users at the price of limiting extensibility and trapping developers into predefined modules, Drupal even encourages developers to integrate their code into the existing structure, opening virtually unlimited possibilities. Granted, it may seem difficult to understand at first, some people I talked to told me that 'Drupal is too complex' or has a rather steep learning curve, but I just think everything becomes clearer after reading parts of the vast documentation section: this is the only price to pay, and believe me, it is definitely worthwhile.<br />
<br />
  <br />
<strong>Notes</strong><br />
[small]<br />
[1] zZine Magazine: <a href="http://www.zzine.org">http://www.zzine.org</a><br />
[2] CyberArmy Community: <a href="http://www.cyberarmy.net">http://www.cyberarmy.net</a><br />
[3] Content Management System, Wikipedia page: <a href="http://en.wikipedia.org/wiki/Content_management_system">http://en.wikipedia.org/wiki/Content_management_system</a><br />
[4] Xoops - Official Page <a href="http://www.xoops.org/">http://www.xoops.org/</a><br />
[5] Mambo - Official Page: <a href="http://www.mamboserver.com">http://www.mamboserver.com</a><br />
[6]CMS Matrix: <a href="http://cmsmatrix.org/">http://cmsmatrix.org/</a><br />
[7] Open Source CMS:  <a href="http://opensourcecms.com/">http://opensourcecms.com/</a><br />
[8] Snarkles's CyberArmy Profile: <a href="http://www.cyberarmy.net/~snarkles">http://www.cyberarmy.net/~snarkles</a><br />
[9] Drupal - Official Page: <a href="http://www.drupal.org">http://www.drupal.org</a><br />
[10]Webchick's Drupal Profile: <a href="http://drupal.org/user/24967">http://drupal.org/user/24967</a><br />
[11] Drupal - Handbooks: <a href="http://www.drupal.org/handbooks/">http://www.drupal.org/handbooks/</a><br />
[12] Drupal API: <a href="http://drupaldocs.org/api/head">http://drupaldocs.org/api/head</a><br />
[13] Drupal Downloads: <a href="http://www.drupal.org/project/">http://www.drupal.org/project/</a><br />
[14] WAMP Server Package: <a href="http://www.wampserver.com">http://www.wampserver.com</a><br />
[15] Drupal - Installing and Upgrading documentation: <a href=" <a href="http://drupal.org/node/258"> <a href="http://drupal.org/node/258</a>">http://drupal.org/node/258[/url]</a><br />
[16] Drupal - Themes: <a href="http://drupal.org/project/Themes">http://drupal.org/project/Themes</a><br />
[17] Drupal - Theme Engines: <a href="http://drupal.org/node/509">http://drupal.org/node/509</a><br />
[18] zZine Beta site: <a href="http://beta.zzine.org">http://beta.zzine.org</a><br />
[19] Drupal - ePublish module: <a href="http://drupal.org/project/epublish">http://drupal.org/project/epublish</a><br />
[20] zZine Podcasts: <a href="http://beta.zzine.org/podcasts">http://beta.zzine.org/podcasts</a><br />
[/small]]]>
    </content>
  </entry>
  <entry>
    <id>tag:www.h3rald.com,2005-06-28:/articles/server-packages/</id>
    <title>Easy-to-install server packages</title>
    <published>2005-06-28T20:12:19Z</published>
    <updated>2009-09-06T18:10:48Z</updated>
    <link href="http://www.h3rald.com/articles/server-packages/" rel="alternate"/>
    <category term="review" scheme="http://www.h3rald.com/tags/review/"/>
    <category term="webdevelopment" scheme="http://www.h3rald.com/tags/webdevelopment/"/>
    <category term="php" scheme="http://www.h3rald.com/tags/php/"/>
    <category term="databases" scheme="http://www.h3rald.com/tags/databases/"/>
    <content type="html">
<![CDATA[
The first and most obvious difference between, say, a C++ programmer and a PHP developer is that the PHP developer needs a server with PHP support up and running somewhere in order to "show" others that the application is working. This normally means that a PHP developer must either have remote access to a server, or have one set up on his machine. Installing and configuring a server can be tricky sometimes, especially if you want to configure it "properly", but in some cases - for Linux/BSD users mainly - there are some pre-configured servers you can download and install. <br />
<br />
I won't examine all these methods in this article, but I'll describe three alternatives for installing and run a webserver on windows in 10 minutes or less.<br />
<br />
<strong>Preliminary considerations</strong><br />
Let's assume that you just want to have a server set up on your computer for <em>internal use</em> only, for testing purposes. That means that you wouldn't need to be concerned about "security" or similar issues - you just want to be able to run your PHP scripts and access your database(s) quickly and easily. <br />
<br />
As I said earlier, Linux users would probably opt for some package available for their favourite distros - they would only have to download and install an .rpm or .deb package for (presumably) Apache httpd, PHP and MySQL, and just use a basic configuration. There are other tools around which can help if you want to compile or configure Apache, but that is beyond the scope of this article.<br />
<br />
Let's just focus on Windows users, then. Normally they like things that are easy to install and can be configured in a few minutes <em>maximum</em> or not at all. Finally, let's assume that as a Windows user, you don't want to spend more money for a new operating system with a bundled server, like Windows 2003, because you can use <a href="http://www.apache.org">Apache</a> on Windows as well, for free.   Having said this, I actually found 3 possible solutions that are handy for PHP (or Perl) developers who don't want to spend time learning how to configure a server. There are people like that, including myself to some extent.<br />
<br />
<br />
<strong>WAMPserver</strong><br />
<a href="http://www.wampserver.com">WAMP</a> stands for "Windows Apache MySQL PHP", and I must say that this product happens to be my choice. The current version, available at the time of writing, offers:<br />
<br />
- PHP 5.0.4<br />
- Apache 1.3.33<br />
- MySQL 4.1.10a<br />
- phpMyadmin 2.6.1-pl3<br />
- SQLitemanager 1.0.4<br />
<br />
This is basically a fully working PHP5 environment, with other tools like phpMyadmin to administer your MySQL database even more easily (more laziness!), and, if you're into the new functionalities of PHP5, it also comes with sqlitemanager, a php application similar to phpMyAdmin but for sqlite databases, which are supported by default in PHP5.<br />
You download it, you start the installation program, and it's DONE. That's it. In 5 minutes you have your own little apache/php/mysql(ite) environment up and running and you can start showing off your sites to your friends and co-workers right away.<br />
<br />
The program also installs two services which can be run at startup, a little icon in the system tray to access all the tools and, of course, <a href="http://localhost">http://localhost</a> in your favourite browser.<br />
<br />
If all this is still not enough for you, and you want more things more easily, you can install addons to set up PHP4 (and seamlessly switch between the two with a single click!), Perl, Zend Accelerator, and so forth.<br />
<br />
<br />
<strong>EasyPHP</strong><br />
The second suite I will briefly describe is <a href="http://www.easyphp.org">EasyPHP</a>. This is a French project (like the previous one, actually), which offers PHP4, MySQL and Apache, plus phpMyAdmin to administer the MySQL databases. However, it doesn't offer PHP5 support yet (so it's not my favourite) and thus there's no sqlite support either.<br />
<br />
Apart from that, it works exactly like WAMP: you download it, you install it, and it's done. Services are installed and you have - again - your little icon on the system tray to access all its functions and tools. It works well, but it doesn't seem to have any add-ons available like WAMP does.<br />
<br />
<strong>XAMPP</strong><br />
This is by far the most complete distribution of the three I am focusing on. This project is developed by <a href="http://www.apachefriends.org">Apache Friends</a> and has a lot of features and flavours. XAMPP currently includes:<br />
<br />
- Apache HTTPD 2.0.54<br />
- MySQL 4.1.12<br />
- PHP 5.0.4 + 4.3.11 + PEAR + Switch<br />
- MiniPerl 5.8.6<br />
- Openssl 0.9.7g<br />
- PHPMyAdmin 2.6.2-pl1<br />
- XAMPP Control Panel 1.0<br />
- eAccelerator 0.9.3<br />
- Webalizer 2.01-10<br />
- Mercury Mail Transport System for Win32 and NetWare Systems v4.01a<br />
- FileZilla FTP Server 0.9.8a<br />
- SQLite 2.8.15<br />
- ADODB 4.63<br />
- Zend Optimizer 2.5.7<br />
- XAMPP Security for Windows 98, 2000, XP<br />
<br />
Honestly, you can't ask for more! If by chance you want to run this suite on other platforms, there's a version for Mac OS X, Solaris, and even Linux.<br />
<br />
The installation method for XAMPP is slightly more difficult than the other suites - you actually have to download and unzip it in a folder of your choice. Then you're off and running.<br />
<br />
Unfortunately (or fortunately), there's no icon on the system tray, so you need to actually access <a href="http://localhost">http://localhost</a> to get a list of services and tools. It also doesn't come with sqlitemanager, but you can download it and install it in the documents folder (like I did).<br />
<br />
I actually use XAMPP - the "lite" edition, which is smaller and has less features - for my USB drive. Since it doesn't require any services to be installed in order to run, you can simply copy it onto a USB stick and run it from there!<br />
<br />
<strong>Conclusion</strong><br />
I'm quite impressed by all of the server packages I reviewed; WAMP and XAMPP in particular. I can now carry around my websites and applications and instantly run them or show them to anyone who has a computer with a USB port.<br />
<br />
As I said in the beginning, these programs are NOT meant to be used in a production environment or to be accessed publicly, therefore, security is not a consideration here. In my opinion, they are simply excellent for testing purposes, and for now, that's what I need them for.]]>
    </content>
  </entry>
</feed>
