                           14516a:2:{s:6:"output";s:0:"";s:6:"result";O:8:"stdClass":3:{s:5:"title";s:28:"eZ publish: PHP's Killer App";s:6:"author";s:12:"Harry Fuecks";s:4:"body";s:14355:"<p>This series is all about eZ publish and why it deserves the title of &quot;PHP's killer app&quot;. We'll start from the ground up: first, we'll install eZ publish in your development environment. Then, we'll learn how to make use of its features, and customise it to your specific needs. Finally, we'll take a look under the hood, to discover what makes eZ publish tick: how eZ publish is in fact a powerful tool to help you build your own Web-based applications.</p>

<p>By the end, you'll be able not only to set up and customise your own eZ publish Website, but to build your own applications to run within eZ publish.</p>

<p>Here's the lowdown...</p>

<p><a class="sublink" href="http://webmasterbase.com/article/917/2">Part 1</a> - an introduction to eZ publish, where we explore, download, and install the required files.</p>

<p><a class="sublink" href="http://webmasterbase.com/article/917/6">Part 2</a> - we get right into eZ publish, learning how to customize it to your requirements -- in terms of both looks, and functionality. We'll build our own small site and implement eZ article.</p>

<p><a class="sublink" href="http://www.sitepoint.com/article/917/13">Part 3</a> - we discuss how you can create your own eZ publish module, taking a look under the hood to explore just how and why building your own modules is so simple with eZ publish.</p>

<p>Let's get started!</p>



<h5>Part 1</h5>



<p>On the menu in this, the first article in the series, is:</p>

<p><ol>
	<li /><strong>Introducing eZ publish:</strong> the warm-up before we start on the real work</li><br />
	<li /><strong>Installing eZ publish:</strong> get eZ publish up and running ready for article 2 in the series</li><br />
	<li /><strong>Homework:</strong> tough discipline</li>
</ol>
</p>

<h5>Introducing eZ publish</h5>



<p>eZ publish is (on the surface) a Website content management system, written in <a rel='external' class="sublink" href="http://www.php.net">PHP</a> by <a rel='external' class="sublink" href="http://ez.no ">eZ systems</a>, a Norwegian company. Launched in 2000, eZ publish has come on in leaps and bounds, having been successfully put into action on sites like <a rel='external' class="sublink" href="http://webservices.org/">Webservices.org</a>, the <a rel='external' class="sublink" href="http://www.austria-tourism.at/">Austrian National Tourist Office</a> and <a rel='external' class="sublink" href="http://www.symplicitynetworks.com/">Simplicity Networks</a> (more sites using eZ publish <a rel='external' class="sublink" href="http://www.ez.no/developer/links/">here</a>), and gaining support from IBM and Siemens, among other <a rel='external' class="sublink" href="http://shop.ez.no/partner/list/">business partners</a>. eZ publish is now even included in the <a rel='external' class="sublink" href="http://developer.ez.no/article/view/358">Debian Linux distribution</a>.</p>

<p>Content management systems, as you probably know from Kevin Yank's <a rel='external' class="sublink" href="http://www.webmasterbase.com/article/228">famous tutorial</a>, allow you to publish dynamic content on your Website in manner that's easy to maintain and update. eZ publish takes that model close to perfection. Firstly, it allows you to store content in a database (eZ publish 2.x currently supports <a rel='external' class="sublink" href="http://www.mysql.com">MySQL</a> and  <a rel='external' class="sublink" href="http://www.postgresql.org">PostgreSQL</a>, with support for other databases like Oracle coming in version 3.x). On top of this database, a set of PHP applications provides a powerful administration interface for site maintenance, while a wealth of front end modules allow eZ publish to be rapidly implemented as anything from a news and community site like SitePoint or an online shop, to a B2B portal or even a corporate Intranet. In other words, it's the solution to all your Website needs!</p>

<p>What's more, eZ publish already has a foot in the door of the <a rel='external' class="sublink" href="http://www.webmasterbase.com/article/827">Web services</a> arena, with a commercially licensed <a rel='external' class="sublink" href="http://shop.ez.no/trade/productview/25/2/">Desktop Edition</a> that allows you to update an eZ publish site using a C++ Windows client communicating with an XML-RPC server interface.</p>

<p>Good news for paupers like me and you is eZ publish has a <a rel='external' class="sublink" href="http://www.ez.no/article/articlestatic/222/1/30/">dual licensing scheme</a>. It provides both a <a rel='external' class="sublink" href="http://www.gnu.org/copyleft/gpl.html1">GNU open source license</a>, and (for those wishing to do things like resell or rebrand eZ publish), a Professional license. For what is at heart an Open Source project, eZ systems are an excellent example of how to turn publicly-licensed software into a commercial success.</p>

<p><em><strong>What's on Offer?</strong></em></p>

<p>So, blurb aside, what does eZ publish actually have to offer? The easiest way to get answers is to visit the demo site at <a rel='external' class="sublink" href="http://publishdemo.ez.no/">http://publishdemo.ez.no/</a>, and then login to the back end administration system by heading to <a rel='external' class="sublink" href="http://admin.publishdemo.ez.no/">http://admin.publishdemo.ez.no/</a> using:</p>

<p><strong>username: </strong>admin <br />
<strong>password: </strong>publish </p>

<p>Once you've logged in, you'll see the demo site control panel with a row of icons along the top (time to have a play!). Each of these corresponds to an eZ publish <em>module,</em> which provides a range of functionalities for the front end of your Website.</p>

<p>Among the modules you'll find:</p>

<p><ul>
	<li /><strong>eZ article:</strong> this the &quot;main&quot; module, allowing you to publish articles or &quot;static&quot; pages on your site</li>

	<li /><strong>eZ trade:</strong> a powerful shopping cart application you'll find in action over at <a rel='external' class="sublink" href="http://www.mygold.com/">MyGold</a>.com</li>

	<li /><strong>eZ filemanager:</strong> a great tool for intranets and file distribution, providing an online filesystem for your visitors to browse</li>

	<li /><strong>eZ forum:</strong> forums for your site, similar to (although not as powerful as) <a rel='external' class="sublink" href="http://www.vbulletin.com/">VBulletin</a>, the software behind the <a rel='external' class="sublink" href="http://www.sitepointforums.com">SitePoint Forums</a></li>
</ul>
</p>

<p>...and many more that are described in detail in the <a rel='external' class="sublink" href="http://doc.ez.no/article/archive/2/">User Manuals</a>. In other words, eZ publish gives you all you need to build your very own version of the SitePoint Network! You'll notice on both the <a rel='external' class="sublink" href="http://publishdemo.ez.no/">demo site</a> and the <a rel='external' class="sublink" href="http://developer.ez.no">main site</a> that even the URLs are similar to SitePoint's. For example:</p>

<blockquote>http://developer.ez.no/article/articleview/367</blockquote>



<p>and</p>

<blockquote>http://www.webmasterbase.com/article/228</blockquote>



<p>Of course there's a long way to go from building a site that works like SitePoint and convincing all the SitePoint fans to pay you a visit, but you get the point.</p>



<p><em><strong>Yet another CMS?</strong></em></p>

<p>&quot;OK&quot;, I hear you say, &quot;another content management system. Big deal.&quot;</p>

<p>What makes eZ publish special is not the impressive list of features, but what's going on behind the scenes. eZ publish is in fact an application development framework, providing PHP developers with a structure in which to build applications and, from there, rapidly deploy them into a live environment, saving you many hours of coding.</p>

<p>If you've ever written you own PHP Website from scratch, you've probably found yourself wishing there was an easier way to do things. You¡¦re confronted with a multitude of issues: where to place the scripts for your site, how to build an integrated site navigation system, how to prevent reproducing the same blocks of code for every page of your site¡K and a whole host of other problems (meanwhile, your social life packs up and heads to Hawaii).The long-awaited completion of a site can often feel like a miracle... then someone comes up with a great idea for some new features and you're re-writing the entire site again, weeping quietly to yourself.</p>

<p>An application development framework eradicates the burdens of building Websites. By conforming to its rules and guidelines, you'll find the maintenance and expansion of your site a breeze. A good framework should make 90% of the design and development decisions for you. Solutions to issues such as naming conventions, where to place your scripts within your Website file system, how to design and structure your code, and all those other fine details you struggle with, are simply a matter of following a set of clear guidelines. And what about all that code you used to waste hours on, such as database connection and query functions, the work you reproduced over and over again for every new site? All that should be available within the framework for you to re-use as needed.</p>

<p>This is what eZ publish really offers: the chance to make your life as a developer a carefree and pleasant one.</p>

<p><em><strong>PHP Coder General's Warning:</strong></em></p>

<p>Developing with eZ publish means writing Object Oriented code!</p>

<p>Much as we all love to write &quot;hacked&quot; scripts using procedural code (perhaps with a few PHP functions included only when we <em>really</em> have to), the truth is, if you want to have any hair left a year or two from now, you <em>need</em> object orientation. Writing object oriented code in PHP is not just about saving time: it allows you to solve coding problems that simply cannot be solved by procedural code. Once you've got two or three PHP classes working together in an application, you'll realise you never want to go back. And then you'll be able to hack away like you've never hacked before!</p>

<p>Put another way, object orientation give us the means to write re-usable code and integrate different applications and functionality into a single whole. For example, you may already have run into difficulties on one of your sites, where you implemented a user authentication system and signed loads of people up. You're now scratching your head as to how to integrate it with a forum application like <a rel='external' class="sublink" href="http://www.vbulletin.com">VBulletin</a> or <a rel='external' class="sublink" href="http://www.phpbb.com">phpBB</a> without forcing your users to sign up again. If we all wrote more object oriented code, at least half these problems would be solved.</p>

<p>In general, the way eZ publish functions in tying together its various modules, is conceptually similar to the <a rel='external' class="sublink" href="http://www.fusebox.org/">Fusebox</a> approach. This strategy for building Web applications was conceived by developers working with Coldfusion, and has now made its way to PHP at <a rel='external' class="sublink" href="http://bombusbee.com/">Bombusbee.com</a>. The basic concept behind a fusebox-like site is to have a single script (usually index.php in the Web root) that acts as &quot;traffic cop&quot; for the site, all pages being served &quot;through&quot; index.php. For further details on the Fusebox approach, try the <a rel='external' class="sublink" href="http://bombusbee.com/downloads/files/FuseboxNewbieGuideV3PHP.pdf">Fusebox Newbie Guide</a>. From an application design perspective, eZ publish loosely conforms to the Fusebox approach, so it may help to read about Fuseboxes in preparation for the third article in this series. But don't panic! We'll leave further discussion of object orientation and application design until the third article in this series. </p>

<p>Back to eZ publish! To whet the appetite of those who know your way around PHP classes, have a look at the eZ publish <a rel='external' class="sublink" href="http://developer.ez.no/doc/view/index">Class Index</a>. Then wander over to the <a rel='external' class="sublink" href="http://sdk.ez.no">eZ publish sdk</a> currently in development for eZ publish v.3.</p>

<p>Hopefully by now you're at least sold on the idea that eZ publish is worth your effort. In that case, it's time to roll up our sleeves and get installing! eZ publish, here we come.</p>

<h5>Installing eZ publish</h5>



<p>In setting up a working version of eZ publish, I'll dare to assume you use Windows and are willing to set up a demo on your own machine. The installation process used here can very easily be applied to a LAMP (Linux, Apache, MySQL, PHP) virtual host environment common to many Web hosts.</p>

<p>It's recommended you have at least PHP version 4.0.6 installed (even better if it's PHP 4.1+) under Apache 1.3x as well as MySQL 3.23 or later. If you don't have those installed, look no further than <a rel='external' class="sublink" href="http://www.firepages.com.au">Firepage's</a> phpdev, an install set that gives you Apache, PHP and MySQL in one tidy package (plus a few other nice things like <a rel='external' class="sublink" href="http://www.webmasterbase.com/article/839">PHP-GTK</a> and <a rel='external' class="sublink" href="http://www.phpmyadmin.org/">phpMyAdmin</a>). The current phpdev5 beta3 is very stable but to save yourself some headaches, it's recommended you use Apache 1.3.x rather than 2.x (phpdev5 beta 3 comes with both).</p>

<p>The version of eZ publish used in this article series is 2.2.6. The install process may vary for different versions, and be aware that eZ publish is <em>very</em> sensitive to the correct php.ini settings. If you have any problems with the instructions used in this article, please drop your questions in the <a rel='external' class="sublink" href="http://www.sitepointforums.com">SitePoint Forums</a> discussion at the end of this article. Otherwise, you'll find plenty of people willing to help at <a rel='external' class="sublink" href="http://developer.ez.no/developer/forums/">http://developer.ez.no/developer/forums/</a>.</p>";}}