


<?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>Learn DooPHP</title>
	<atom:link href="http://learn.doophp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://learn.doophp.com</link>
	<description>Learn DooPHP - a high performance MVC based PHP framework</description>
	<lastBuildDate>Thu, 18 Aug 2011 19:47:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>(Deutsch) DooPHP Einsteiger-Tutorial</title>
		<link>http://learn.doophp.com/2011/08/deutsch-doophp-einsteiger-tutorial/</link>
		<comments>http://learn.doophp.com/2011/08/deutsch-doophp-einsteiger-tutorial/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 19:38:38 +0000</pubDate>
		<dc:creator>roman</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[doophp]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[introduction to doophp]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=247</guid>
		<description><![CDATA[<p>Alle, die auf der Suche nach einem Einsteiger-Tutorial für den Start mit DooPHP sind, finden hier eine einfache Anleitung zur Installation und Basis-Konfiguration einer typischen Webanwendung: <a title="DooPHP: Installation und Konfiguration (Anleitung)" href="http://realpr.de/doophp-installation-konfiguration-anleitung.html"><strong>DooPHP Installation und Konfiguration</strong></a></p>
]]></description>
		<wfw:commentRss>http://learn.doophp.com/2011/08/deutsch-doophp-einsteiger-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get DooPHP running on Google App Engine</title>
		<link>http://learn.doophp.com/2011/07/get-doophp-running-on-google-app-engine/</link>
		<comments>http://learn.doophp.com/2011/07/get-doophp-running-on-google-app-engine/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 08:17:50 +0000</pubDate>
		<dc:creator>Leng</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[google app engine]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[quercus]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=225</guid>
		<description><![CDATA[<p>Google App Engine is a PaaS that enables you to build and host web apps on the same systems that power Google applications. App Engine offers fast development and deployment; simple administration, with no need to worry about hardware, patches or backups; and effortless scalability. With the latest <a href="http://code.google.com/appengine/docs/java/channel/overview.html">Channel API</a> it enables applications to send messages in real time without the use of polling. App engine currently only supports Python and Java and there are no PHP APIs available yet.</p>
<p>However, there&#8217;s a workaround to get PHP running on GAE.  With Quercus, you can run PHP on JVM which is supported in GAE infrastructure<span><em>. <a href="http://www.caucho.com/resin-3.0/quercus/">Quercus</a></em> is Caucho Technology&#8217;s fast, open-source, 100% Java implementation of the PHP language. Latest version of Quercus supports PHP 5.3.2 thus features like namespace and closure in PHP 5.3 are available. You can use Java </span>classes from PHP(with Quercus) to access various API such as Mail, URL Fetch, XMPP, Task Queues, Google Accounts on App Engine.</p>
<p>Here is an example of DooPHP <a href="http://doophp.appspot.com/">URI routing demo</a> running on GAE</p>
<p>Now, there are a few steps to get you started with Quercus and GAE.</p>
<p><strong>Step 1:</strong> Download and install Resin from http://www.caucho.com/download/</p>
<p><strong>Step 2: </strong>Download and install Google App Engine SDK for Java from http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Java</p>
<p><strong>Step 3:</strong> Download this example <a href="http://doophp.appspot.com/doophp-gae.zip">doophp-gae.zip</a> and upzip it to your preferred location</p>
<p><strong>Step 4:</strong> Copy resin.jar</p>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2011/07/get-doophp-running-on-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intro to DooPHP slides (PHP Malaysia meetup 2011)</title>
		<link>http://learn.doophp.com/2011/02/intro-to-doophp-slides-php-malaysia-meetup-2011/</link>
		<comments>http://learn.doophp.com/2011/02/intro-to-doophp-slides-php-malaysia-meetup-2011/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 07:51:17 +0000</pubDate>
		<dc:creator>Leng</dc:creator>
				<category><![CDATA[News & Updates]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[doophp]]></category>
		<category><![CDATA[doophp 1.4]]></category>
		<category><![CDATA[introduction to doophp]]></category>
		<category><![CDATA[php meetup]]></category>
		<category><![CDATA[slides]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=223</guid>
		<description><![CDATA[<p>For those who are looking for the presentation slides for DooPHP used in  PHP Malaysia Meetup 2011. You can also click on the link to <span id="IL_AD1">download</span> the <a title="intro to doophp" href="http://doophp.com/files/intro-to-doophp.pdf">PDF</a> or <a title="intro to doophp" href="http://doophp.com/files/intro-to-doophp.apk">android apk</a></p>
<div id="__ss_7008383" style="width: 100%; text-align: center;"><strong style="display: block; margin: 12px 0pt 4px;"><a title="Intro to DooPHP" href="http://www.slideshare.net/darkredz/intro-to-doophp">Intro to DooPHP 1.4</a></strong></div>
]]></description>
		<wfw:commentRss>http://learn.doophp.com/2011/02/intro-to-doophp-slides-php-malaysia-meetup-2011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Handling sessions without Apache sessions</title>
		<link>http://learn.doophp.com/2010/09/handling-sessions-without-apache-sessions/</link>
		<comments>http://learn.doophp.com/2010/09/handling-sessions-without-apache-sessions/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 16:08:00 +0000</pubDate>
		<dc:creator>Milos Kovacki</dc:creator>
				<category><![CDATA[Demos & Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=216</guid>
		<description><![CDATA[<p>You are all familiar that Apache sessions are slow and sometimes insecure. In this text I will try to implement way of handling sessions with all Doo::cache mechanisms that are available in DooPhp.<br />
So our sessions will be stored in some of the cache mechanisms. First we will start with writting our session class that will start and end session, we will save it in protected/class folder.<br />
Here is our Session.class</p>
<pre class="brush: php;">
&#60;?php
/**
 * Session handler
 *
 * @author Milos Kovacki &#60;kovacki@gmail.com&#62;
 * @copyright Milos Kovacki 2010 &#60;kovacki@gmail.com&#62;
 */
 class Session
 {

 public static $_sessionId = NULL;
 public static $session = array();

 /**
 * Start session
 */
 public static function startSession() {
 self::$_sessionId = (isset($_COOKIE['session_id']) ? $_COOKIE['session_id'] : NULL);
 if ((!self::$_sessionId)&#124;&#124;(!(self::$session=Doo::cache(Doo::conf()-&#62;sessionCacheType)-&#62;get('session_'.self::$_sessionId)))) {
 // Create new session
 self::$_sessionId = md5($_SERVER['REMOTE_ADDR'] . time() . rand(0,128));
 self::$session['ip'] = $_SERVER['REMOTE_ADDR'];
 self::$session['created'] = time();
 }
 setcookie('session_id', self::$_sessionId, (time()+3600*24*90), '/');
 }

 /**
 * End session
 */
 public static function endSession() {
 $sessionStored = Doo::cache(Doo::conf()-&#62;sessionCacheType)-&#62;set('session_'.self::$_sessionId, self::$session);
 }

 }
</pre>
<p>You all noticed variable  Doo::conf()-&#62;sessionCacheType so we need to add it in our protected/config/common.conf edit it and add:</p>
<pre class="brush: php;">

$config['sessionCacheType'] = 'apc';
</pre>
<p>You can choose any type that is supported in Doo::cache, now we will edit our index.php, here is my bootstrap:</p>
<pre class="brush: php;">

&#60;?php
/**
* BOOTSTRAP
*/
//ini_set('display_errors', 1);
include './protected/config/common.conf.php';
include './protected/config/routes.conf.php';
include $config['BASE_PATH'].'Doo.php';</pre>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2010/09/handling-sessions-without-apache-sessions/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Upload and Resize Pictures with DooGdImage</title>
		<link>http://learn.doophp.com/2010/01/upload-and-resize-pictures-with-doogdimage/</link>
		<comments>http://learn.doophp.com/2010/01/upload-and-resize-pictures-with-doogdimage/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 04:19:51 +0000</pubDate>
		<dc:creator>Leng</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[DooGdImage]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[image resize]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=186</guid>
		<description><![CDATA[<p>First you must have an upload form in your HTML, notice that the file input field in the form below is <strong>profile_pic</strong></p>
<pre class="brush: php;">&#60;form action=&#34;/uploadme&#34; method=&#34;post&#34; enctype=&#34;multipart/form-data&#34; name=&#34;upload-photo&#34;&#62;
 &#60;input name=&#34;profile_pic&#34; type=&#34;file&#34; /&#62;
 &#60;input type=&#34;submit&#34; value=&#34;submit&#34;/&#62;
&#60;/form&#62;
</pre>
<p>In Controller, create an instance of <strong>DooGdImage</strong>, along with the upload/source path and the path to save your resized pictures:</p>
<pre class="brush: php;">
 Doo::loadHelper('DooGdImage');
 //upload/source path, and output saved path
 $gd = new DooGdImage('/var/www/uploaded/', '/var/www/resized_pic/');
</pre>
<p>Call uploadImage() to save the uploaded file with a new name. The example below save the picture with the date as file name, <strong>img_20100104203245.jpg</strong></p>
<pre class="brush: php;">$uploadImg = $gd-&#62;uploadImage('profile_pic', 'img_' .date('Ymdhis'));
</pre>
<p>Before your resize the picture, you can set the quality, generated image type and file name suffix (optional)</p>
<pre class="brush: php;">
 $gd-&#62;generatedQuality = 85;
 $uploadImage-&#62;generatedType=&#34;jpg&#34;;

 //This thumbnail is 46x46 pixels, resize adaptively (perfect 46x46 crop from center)
 //Pic name is img_201001011200_46x46.jpg
 $gd-&#62;thumbSuffix = '_46x46';
 $gd-&#62;adaptiveResize($uploadImg,46,46);
</pre>
<p>You can use createThumb/createSquare to resize the pictures too.</p>
<pre class="brush: php;">
 //Resize propotionally (so will not be perfect 75x75 depends on the image ratio, no cropping done)
 //Pic name is img_201001011200_75x75.jpg
 $gd-&#62;thumbSuffix = '_75x75';
 $gd-&#62;createThumb($uploadImg, 75, 75);
</pre>
<p>Some updates*</p>
<p>You can validate if the uploaded images meet your requirements by using checkImageType(), checkImageSize() and checkImageExtension()</p>
<ul>
<li><strong>checkImageType()</strong> &#8211; check if image mime type is in the allowed list. Default: JPEGs, GIFs and PNGs</li>
<li><strong>checkImageExtension()</strong> &#8211; check if image file extension is in the allowed list.</li></ul>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2010/01/upload-and-resize-pictures-with-doogdimage/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Profiling and DB Profiling with DooPHP</title>
		<link>http://learn.doophp.com/2009/12/profiling-and-db-profiling-with-doophp/</link>
		<comments>http://learn.doophp.com/2009/12/profiling-and-db-profiling-with-doophp/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 15:41:08 +0000</pubDate>
		<dc:creator>Leng</dc:creator>
				<category><![CDATA[Demos & Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db profiling]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[profiler]]></category>
		<category><![CDATA[profiling]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=174</guid>
		<description><![CDATA[<p>If you have read the previous tutorial on <a href="http://learn.doophp.com/2009/12/using-doophp-logging-tools/">logging</a> you will find that <strong>profiling </strong>with DooPHP framework is relatively similar to the way you log messages.</p>
<p>Performance profiling can be used to measure the time &#38; memory needed for the specified code blocks and find out what the performance bottleneck is. Instead of calling log() you change it to<strong> beginProfile()</strong> and <strong>endProfile()</strong>. We need to mark the beginning and the end of each code block by inserting the following methods:</p>
<pre class="brush: php;">
Doo::logger()-&#62;beginProfile('block_id_here');
//...everything here will be profiled
Doo::logger()-&#62;endProfile('block_id_here');
</pre>
<p>Code blocks need to be nested properly. A code block cannot intersect with another. It must be either at a parallel level or be completely enclosed by the other code block.</p>
<p>All of the profiled results can be organized in category, simply pass in another parameter at the end of the method beginProfile():</p>
<pre class="brush: php;">
//default category is 'application'
Doo::logger()-&#62;beginProfile('id', 'editpost');
//...everything here will be profiled
Doo::logger()-&#62;endProfile('id');
</pre>
<p>To retrieve the profiled results, you called <strong>getProfileResult()</strong>. You have to pass in the block ID as parameter and you will get an associative array which shows you the time and memory used when processing the code block.</p>
<pre class="brush: php;">
Doo::logger()-&#62;beginProfile('block_id');
//...everything here will be profiled
Doo::logger()-&#62;endProfile('block_id');
$result = Doo::logger()-&#62;getProfileResult('block_id');
</pre>
<p>To view the profiled results, you just have to call showLogs(). By default it will return a neatly</p>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/12/profiling-and-db-profiling-with-doophp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using DooPHP Logging Tools</title>
		<link>http://learn.doophp.com/2009/12/using-doophp-logging-tools/</link>
		<comments>http://learn.doophp.com/2009/12/using-doophp-logging-tools/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 02:58:16 +0000</pubDate>
		<dc:creator>Leng</dc:creator>
				<category><![CDATA[Demos & Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[normal]]></category>
		<category><![CDATA[profiling]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=154</guid>
		<description><![CDATA[<p>DooPHP comes with its own <strong>profiler and logging tool</strong> by default. The class that handle this in the framework is DooLog (<em>dooframework/app/logging/DooLog.php</em>)</p>
<p>There are a few methods in this file where you can use for profiling and logging queries or important message in your application. You can log a message by calling:</p>
<pre class="brush: php;">
Doo::logger()-&#62;log('Something fishy here!', DooLog::Alert);
</pre>
<p>Or you can use the Alias methods instead of passing the log level:</p>
<pre class="brush: php;">
Doo::logger()-&#62;alert('Something fishy here!');
Doo::logger()-&#62;emerg('message...');
Doo::logger()-&#62;crit('message...');
Doo::logger()-&#62;err('message...');
Doo::logger()-&#62;warn('message...');
Doo::logger()-&#62;notice('message...');
Doo::logger()-&#62;info('message...');
Doo::logger()-&#62;trace('message...');
</pre>
<p>All of the log messages can be organized by category, simply pass in another parameter at the end of the methods:</p>
<pre class="brush: php;">
Doo::logger()-&#62;log('Something fishy here!', DooLog::ALERT, 'editpost');
Doo::logger()-&#62;emerg('message...', 'editpost');
Doo::logger()-&#62;alert('message...', 'editpost');
</pre>
<p>To view the logged messages, you just have to call showLogs(). By default DooLog will return a neatly formatted XML log which can be filtered by level or category. You can get a plain text log if you need so:</p>
<pre class="brush: php;">
//display all logs
echo Doo::logger()-&#62;showLogs();

//display plain text log
echo Doo::logger()-&#62;showLogs(false);

//display only logs in category editpost
echo Doo::logger()-&#62;showLogs(true, null, 'editpost');

//display only logs in level Alert and category editpost
echo Doo::logger()-&#62;showLogs(true, DooLog::ALERT, 'editpost');
</pre>
<p>When you have to write the log messages into file, all you have to do is call writeLogs(). Similar to showLogs(), it writes the XML string to file by default.</p>
<pre class="brush: php;">

//Creates a log file</pre>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/12/using-doophp-logging-tools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DooFlashMessenger</title>
		<link>http://learn.doophp.com/2009/11/dooflashmessenger/</link>
		<comments>http://learn.doophp.com/2009/11/dooflashmessenger/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 01:19:24 +0000</pubDate>
		<dc:creator>Milos Kovacki</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=145</guid>
		<description><![CDATA[<p>Hi guys, DooFlashMessenger is here, in this tutorial I will explain you how can you use it with just 3 lines of code. Same thing you have in class comments.</p>
<p>Well lets begin, we start with calling class:</p>
<pre class="brush: php;">
$flash = new DooFlashMessenger();
</pre>
<p>Now we must give access to DooFlashMessenger from view, we do that like this:</p>
<pre class="brush: php;">
DooController::view()-&#62;flashMessenger = $flash;
</pre>
<p>When we can access from view to flashMessenger we can display messages from flashMessenger, we do that with displayMesssages() method.<br />
Here is the code you need to have in your template file:</p>
<pre class="brush: php;">
$flash-&#62;displayMessages();
</pre>
<p>Thats about it, now you just need to add some message to flash messenger, message will be stored in session, with next execution of DooFlashMessenger class messages that are stored in session will be printed with displayMessages() method. Calling displayMessages() method will echo all messages that are stored.</p>
<p>Adding messages to flashMessenger is done by calling method addMessage:</p>
<pre class="brush: php;">
$flash-&#62;addMessage(&#34;This is just test message&#34;);
</pre>
<p>That&#8217;s it if you have any questions please do ask.</p>
]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/11/dooflashmessenger/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Using DooTranslator for translation</title>
		<link>http://learn.doophp.com/2009/10/using-dootranslator-for-translation/</link>
		<comments>http://learn.doophp.com/2009/10/using-dootranslator-for-translation/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 12:05:32 +0000</pubDate>
		<dc:creator>Milos Kovacki</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[easy]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=141</guid>
		<description><![CDATA[<p>DooTranslator finnaly came out, it supports &#8220;<strong>Csv</strong>&#8220;, &#8220;<strong>Gettext</strong>&#8220;, &#8220;<strong>Array</strong>&#8220;, &#8220;<strong>Ini</strong>&#8221; for now, soon it will be implemented other &#8220;file types&#8221;. So for example you have your translation file with this contents:</p>
<p><strong>en.svn</strong></p>
<pre class="brush: php;">
test;&#34;This is just a test!&#34;
</pre>
<p>Lets initialize DooTranslator class:</p>
<pre class="brush: php;">
$translator = Doo::translator('Csv', $this-&#62;_basePath . 'languages/en/LC_MESSAGES/en.csv');
 echo $translator-&#62;translate(&#34;test&#34;);
</pre>
<p>As you can see its very simple, first argument is file type for translation and second is path to the file, third argument can be options array. For Csv you can set options like: delimiter, enclosure and length. Default value for delimiter is &#8220;;&#8221; and for enclosure is &#8220;.</p>
<p>Now we will add some options to our call, lets say we want some other delimiter then &#8220;;&#8221; and we want to add some caching.</p>
<pre class="brush: php;">
$translator = Doo::translator('Csv', $this-&#62;_basePath . 'languages/en/LC_MESSAGES/main.csv', array('cache' =&#62; 'apc', 'delimiter' =&#62; '&#124;'));
</pre>
<p>So now we have added cache mechanism that is &#8220;apc&#8221; and we added delimiter that is &#8220;&#124;&#8221;, now in our en.csv we must change delimiter:</p>
<pre class="brush: php;">
test&#124;&#34;This is just a test!&#34;
</pre>
<p>Supported cache mechanisms are &#8220;apc&#8221;, &#8220;php&#8221;, &#8220;xcache&#8221; and &#8220;eaccelerator&#8221;.</p>
<p>Now lets add placeholders for translate method:</p>
<pre class="brush: php;">
$translator-&#62;translate(&#34;Hello [_1], wellcome to my website!&#34;, array(&#34;John&#34;));
</pre>
<p>This will show translated string with: &#8220;Hello John, wellcome to my website!&#8221;.</p>
<p>Ok thats about it, if you have any questions please do ask, this is simple translation class its still</p>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/10/using-dootranslator-for-translation/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Managing your database(s) with DooPHP</title>
		<link>http://learn.doophp.com/2009/10/managing-your-databases-with-doophp/</link>
		<comments>http://learn.doophp.com/2009/10/managing-your-databases-with-doophp/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 18:22:10 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[difficult]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=137</guid>
		<description><![CDATA[<p>This tutorial will demonstrate how to use the DooManageDb and DooUpdateDb classes to manage your projects database.</p>
<p>These classes have been developed to allow your application(s) to be independent of the database your users choose to use by allowing standard database definition to be used to define your database which is then translated into the SQL needed for the database engine the user is using. It also supports easy upgrading (and downgrading) of the database to allow for better version control support and rolling out of updates and unit testing.</p>
<p>In order to follow this tutorial you will need to use the latest version of DooPHP avaliable form the SVN repository (or version 1.3 or above &#8211; not out at the time of writing). The current implementation only supports MySQL and PgSQL at the moment so you will also need one of these 2 databases in order to follow the guide.</p>
<p>The first thing we need to do is to create a simple controller to run our tests from. Therefore create a new controller in your protected/controller/ folder. In this example I will use the controller &#8220;DatabaseController&#8221;. Now enter the following into the controller:</p>
<pre class="brush: php;">
&#60;?php
class DatabaseController extends DooController {

	public function updateDatabase() {

		echo '&#60;h1&#62;Update Database to Head&#60;/h1&#62;' . PHP_EOL;

		/* DB Updater</pre>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/10/managing-your-databases-with-doophp/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
