<?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>PHP Developer</title>
	<atom:link href="http://php-developer.co.za/feed/" rel="self" type="application/rss+xml" />
	<link>http://php-developer.co.za</link>
	<description>Just another PsyWeb Sites site</description>
	<lastBuildDate>Fri, 25 Nov 2011 10:49:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Stopping unresponsive programs in Ubuntu</title>
		<link>http://php-developer.co.za/2011/01/20/stopping-unresponsive-programs-in-ubuntu/</link>
		<comments>http://php-developer.co.za/2011/01/20/stopping-unresponsive-programs-in-ubuntu/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 07:35:51 +0000</pubDate>
		<dc:creator>phpdeveloper</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[kill]]></category>
		<category><![CDATA[progrem]]></category>

		<guid isPermaLink="false">http://www.php-developer.co.za/?p=72</guid>
		<description><![CDATA[This is a simple problem,with a simple solution. Which I will forget. Hence the post. ps aux &#124; grep nameofprogram This will list all programs running that include nameofprogram, as well as their program ids (pid) kill -9 programid Stops the program. Simple really.]]></description>
			<content:encoded><![CDATA[<p>This is a simple problem,with a simple solution. Which I will forget. Hence the post.</p>
<blockquote><p>ps aux | grep nameofprogram</p></blockquote>
<p>This will list all programs running that include nameofprogram, as well as their program ids (pid)</p>
<blockquote><p>kill -9 programid</p></blockquote>
<p>Stops the program.</p>
<p>Simple really.</p>
]]></content:encoded>
			<wfw:commentRss>http://php-developer.co.za/2011/01/20/stopping-unresponsive-programs-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tis the season&#8230;..</title>
		<link>http://php-developer.co.za/2010/12/07/tis-the-season/</link>
		<comments>http://php-developer.co.za/2010/12/07/tis-the-season/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 07:36:35 +0000</pubDate>
		<dc:creator>phpdeveloper</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.php-developer.co.za/?p=69</guid>
		<description><![CDATA[Its that time of year again, where we look forward to family gathering, presents and stuffing our faces with copious amounts of food. In the meantime, we have the PHP Advent Calendar, to count down the days to Christmas and learn some new PHP goodies for the new year.]]></description>
			<content:encoded><![CDATA[<p>Its that time of year again, where we look forward to family gathering, presents and stuffing our faces with copious amounts of food.</p>
<p>In the meantime, we have the <a title="PHP Advent" href="http://phpadvent.org/2010" target="_blank">PHP Advent</a> Calendar, to count down the days to Christmas and learn some new PHP goodies for the new year.</p>
]]></content:encoded>
			<wfw:commentRss>http://php-developer.co.za/2010/12/07/tis-the-season/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mozilla Add-ons you can&#039;t live without.</title>
		<link>http://php-developer.co.za/2010/11/23/mozilla-add-ons-you-cant-live-without/</link>
		<comments>http://php-developer.co.za/2010/11/23/mozilla-add-ons-you-cant-live-without/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 12:53:22 +0000</pubDate>
		<dc:creator>phpdeveloper</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[add-ons]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://www.php-developer.co.za/?p=66</guid>
		<description><![CDATA[As a PHP developer there are a hoard of Mozilla Firefox add-ons that will not only make your life easier, but will make you a better developer. These are the list of add-ons that are installed by default in my Firefox Browser. Firebug &#8211; absolutely the best way to debug javascript (and therefore also ajax) [...]]]></description>
			<content:encoded><![CDATA[<p>As a PHP developer there are a hoard of Mozilla Firefox add-ons that will not only make your life easier, but will make you a better developer.</p>
<p>These are the list of add-ons that are installed by default in my Firefox Browser.</p>
<p><a title="Firebug" href="https://addons.mozilla.org/en-US/firefox/addon/1843/" target="_blank">Firebug</a> &#8211; absolutely the best way to debug javascript (and therefore also ajax) in your web projects. <em>console.log</em> beats using <em>alert()</em> anyday.</p>
<p><a title="Web Developer" href="https://addons.mozilla.org/en-US/firefox/addon/60/" target="_blank">Web Developer</a> &#8211; the first developer add-on I ever installed and one that I can&#8217;t live without. Manipulate everything from styling to sessions using this tool.</p>
<p><a title="Tamper Data" href="https://addons.mozilla.org/en-US/firefox/addon/966/" target="_blank">Tamper Data</a> &#8211; extremely useful tool for viewing/modifying your http requests to see what is being sent/received each time a page is loaded.</p>
<p><a title="PHP developer Toolbar" href="https://addons.mozilla.org/en-US/firefox/addon/12686/" target="_blank">PHP Developer Toolbar</a> &#8211; tired of opening php.net each time you want to search a function. Use this handy toolbar to save time and frustration.</p>
]]></content:encoded>
			<wfw:commentRss>http://php-developer.co.za/2010/11/23/mozilla-add-ons-you-cant-live-without/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy CakePHP in Ubuntu</title>
		<link>http://php-developer.co.za/2009/12/08/easy-cakephp-in-ubuntu/</link>
		<comments>http://php-developer.co.za/2009/12/08/easy-cakephp-in-ubuntu/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 19:45:19 +0000</pubDate>
		<dc:creator>phpdeveloper</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[bake]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.php-developer.co.za/?p=55</guid>
		<description><![CDATA[I&#8217;ve always setup a new CakePHP project by extracting the current stable build into a project directory and editing the core.php and database.php files manually. I usually then change to the /cake/console directory of the project and run php cake.php bake (having already installed the php-cli) to bake my code. I know there are other [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always setup a new CakePHP project by extracting the current stable build into a project directory and editing the <em>core.php</em> and <em>database.php</em> files manually. I usually then change to the <em>/cake/console</em> directory of the project and run <em>php cake.php bake</em> (having already installed the php-cli) to bake my code.</p>
<p>I know there are other ways to make this process simpler but its always just worked for me and I am usually to lazy/busy/unmotivated to try something new.</p>
<p>Today, however, I stumbled across a great way to set up CakePHP in Ubuntu so that building new projects is a simple matter of running one line from the command line and you are ensured of using the same stable &#8220;shell&#8221; version of Cake each time. It is also extremely easy to upgrade your &#8220;shell&#8221; version whenever you want. (It also makes baking even easier than the way I was doing it but that&#8217;s just an added bonus !)</p>
<p>(This may or may not also be possible in other Ubuntu like systems that have the same CakePHP repositories eg Mint, Debian etc)</p>
<p>1) Download and extract the latest stable version of <a title="CakePHP" href="http://cakephp.org/" target="_blank">CakePHP</a> to a folder on your machine.</p>
<p>2) Install <em>cakephp-scripts</em> from the Ubuntu repositories</p>
<p>$<em> sudo apt-get install cakephp-scripts</em></p>
<p>This will install the current version of CakePHP in the Ubuntu repository, as well as the <em>php-cli</em> (command line interface) and setup the Cake console for easy use from the command line.</p>
<p>3) Copy the folders from the latest stable version to your system</p>
<p>Currently you have installed whatever version of cake was included in your version of Ubuntu&#8217;s repositories. If you are running an older version of Ubuntu or just want to run the very latest stable version, you need to update your Cake version by copying it from the extracted folder in step 1.</p>
<p>The &#8220;shell&#8221; version of CakePHP you installed in step 2 is located in <em>/usr/share/php/cake</em>. You will notice that the directory structure is slightly different from the extracted version, but a little common sense will enable you to see what needs to be copied to where (basically, from the extracted directory, copy the <em>app</em> directory and everything from inside the <em>cake</em> directory into the <em>/usr/share/php/cake</em> directory).</p>
<p>You can also upgrade your &#8220;shell&#8221; by downloading/extracting a newer stable version of CakePHP and repeating the above step.</p>
<p>Now baking with Cake becomes even easier.</p>
<p>Change to your web root (usually /var/www/ or wherever you usually develop your PHP applications) and run</p>
<p>$<em> cake bake projectname<br />
</em></p>
<p>where <em>projectname</em> is the name of a new project you want to create. You will be presented with the Cake console, which will set up your project folder and copy over all the code from the CakePHP &#8220;shell&#8221;. It will also set up a random Security Salt value, add some default CAKE_CORE_INCLUDE_PATHs and guide you through setting up your database configuration(s).</p>
<p>You can then change directory to your <em>projectname</em> directory and run</p>
<p><em>$ cake bake</em></p>
<p>to bake your Models, Views and Controllers.</p>
<p>Happy Baking&#8230;</p>
<p>UPDATE: I just noticed another nice side effect of this way of creating Cake projects, default app_controller.php, app_helper.php and app_model.php files are created in the project root folder. <img src='http://php-developer.co.za/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://php-developer.co.za/2009/12/08/easy-cakephp-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Advent 2009</title>
		<link>http://php-developer.co.za/2009/12/02/php-advent-2009/</link>
		<comments>http://php-developer.co.za/2009/12/02/php-advent-2009/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 06:54:13 +0000</pubDate>
		<dc:creator>phpdeveloper</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[advent]]></category>

		<guid isPermaLink="false">http://www.php-developer.co.za/?p=52</guid>
		<description><![CDATA[I had no idea something like this existed but what a great idea. 24 days of worth of PHP articles to keep the Christmas Blues away. Today&#8217;s article is something very close to my heart and discusses the topic of Comprehensible Code. Go, read, expand your minds&#8230;.]]></description>
			<content:encoded><![CDATA[<p>I had no idea something like this existed but what a great idea. <a title="PHP Advent 2009" href="http://phpadvent.org/2009" target="_blank">24 days of worth of PHP articles</a> to keep the Christmas Blues away.</p>
<p>Today&#8217;s article is something very close to my heart and discusses the topic of <a title="Comprehensible Code" href="http://phpadvent.org/2009/comprehensible-code-by-paul-jones" target="_blank">Comprehensible Code</a>.</p>
<p>Go, read, expand your minds&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://php-developer.co.za/2009/12/02/php-advent-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ambit Recruitment website goes live</title>
		<link>http://php-developer.co.za/2009/11/25/ambit-recruitment-website-goes-live/</link>
		<comments>http://php-developer.co.za/2009/11/25/ambit-recruitment-website-goes-live/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 20:52:48 +0000</pubDate>
		<dc:creator>phpdeveloper</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ambit recruitment]]></category>

		<guid isPermaLink="false">http://www.php-developer.co.za/?p=47</guid>
		<description><![CDATA[Personal experience will always advise our actions. So, the objective is to ensure positive experiences are repeated as often as possible, to encourage further positive outcomes. That’s the simple premise on which Ambit Recruitment operates the business of fitting the right people into the right positions. The Ambit Recruitment website is a bit of a [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Personal experience will always advise our actions. So, the objective is to ensure positive experiences are repeated as often as possible, to encourage further positive outcomes.</p>
<p>That’s the simple premise on which Ambit Recruitment operates the business of fitting the right people into the right positions.</p></blockquote>
<p>The <a title="www.ambitrecruitment.co.za" href="http://www.ambitrecruitment.co.za" target="_blank">Ambit Recruitment website</a> is a bit of a milestone for me, as it is the first site that I handcoded from scratch (HTML/CSS/PHP). I am quite proud of how it turned out.</p>
]]></content:encoded>
			<wfw:commentRss>http://php-developer.co.za/2009/11/25/ambit-recruitment-website-goes-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>South African HTML image map</title>
		<link>http://php-developer.co.za/2009/08/09/south-african-html-image-map/</link>
		<comments>http://php-developer.co.za/2009/08/09/south-african-html-image-map/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 20:00:23 +0000</pubDate>
		<dc:creator>phpdeveloper</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[South Africa]]></category>

		<guid isPermaLink="false">http://www.php-developer.co.za/?p=39</guid>
		<description><![CDATA[I recently had to create an image map of South Africa, displaying each of the provinces with links to content for each province. As it took me most of the day to complete I thought it might be handy for someone else too. So in true open source fashion here it is for you to [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to create an image map of South Africa, displaying each of the provinces with links to content for each province.</p>
<p>As it took me most of the day to complete I thought it might be handy for someone else too.</p>
<p>So in true open source fashion <a title="SA Web Map" href="http://www.php-developer.co.za/downloads/sa_web_map.zip" target="_blank">here it is for you to download and enjoy</a>.</p>
<p>All I ask is that if you do use it, you post a link back to my site.</p>
]]></content:encoded>
			<wfw:commentRss>http://php-developer.co.za/2009/08/09/south-african-html-image-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating from Drupal to WordPress</title>
		<link>http://php-developer.co.za/2009/07/18/migrating-from-drupal-to-wordpress/</link>
		<comments>http://php-developer.co.za/2009/07/18/migrating-from-drupal-to-wordpress/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 16:17:49 +0000</pubDate>
		<dc:creator>phpdeveloper</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.php-developer.co.za/?p=37</guid>
		<description><![CDATA[Well, it finally happened. After months of frustration with Drupal as a blog tool, I gave up and decided it was time to move over to WordPress. I&#8217;m sure as a CMS system Drupal can be quite wonderful, but for running and managing a simple blog site, I have yet to come across a better [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it finally happened. After months of frustration with Drupal as a blog tool, I gave up and decided it was time to move over to WordPress.</p>
<p>I&#8217;m sure as a CMS system Drupal can be quite wonderful, but for running and managing a simple blog site, I have yet to come across a better platform than WordPress.</p>
<p>However the migration of the database content from one system to another had it&#8217;s ups and downs. Fortunately for me, not many people read this blog, so I only had to migrate the posts data from one database to the other.</p>
<p>Below is the script I wrote to do so, in the hopes that this might save someone else the hassle of writing it themselves.</p>
<p>P.S. This was for a Drupal 6 to WordPress 2.8.2 migration. If it doesn&#8217;t work for you because you are working with different versions of either Drupal or WordPress, drop me a line and I will try to modify it for you.<br />
<code></p>
<p>	/**<br />
	* Setup database constants<br />
	*/<br />
	define('DRUPAL', 'phpdevec_drpl1');<br />
	define('WORDPRESS', 'phpdevec_wordpress');<br />
	define('URL', 'http://www.php-developer.co.za/');<br />
	/**<br />
	* Setup server constants<br />
	*/<br />
	define("SERVER", "localhost");<br />
	define('USER', 'phpdevec_drpl1');<br />
	define('PASSWORD', 'L8xb3OuZdQV0');</p>
<p>	/**<br />
	* debug function outputs data<br />
	*/<br />
	function debug($data){<br />
		echo '
<pre>';
		print_r($data);
		echo '</pre>
<p>';<br />
	}</p>
<p>	/**<br />
	* Connect to server and database<br />
	*/<br />
	function connect($db) {<br />
		// database connection<br />
		$conn = mysql_connect(SERVER, USER, PASSWORD);<br />
		if (!$conn) {<br />
			//connection to server failed<br />
			die("Cannot connect to server");<br />
			return false;<br />
		}</p>
<p>		$dbSelected = mysql_select_db($db, $conn);<br />
		if(!$dbSelected) {<br />
			// database connection failed<br />
			die("Cannot connect to database");<br />
			return false;<br />
		}<br />
		return $conn;<br />
	}</p>
<p>	/**<br />
	* Close database connection<br />
	*/<br />
	function disconnect($conn){<br />
		if ($conn){<br />
			// connection exists to close<br />
			if (!mysql_close($conn)){<br />
				// database connection failed<br />
				die("Cannot close database connection");<br />
				return false;<br />
			}<br />
			return true;<br />
		}<br />
		// default return in case the original connection failed<br />
		return true;<br />
	}</p>
<p>	/**<br />
	* Generic SQL SELECT, checks type<br />
	* (SELECT, INSERT, UPDATE [DELETE])<br />
	*<br />
	* @param string $sql query<br />
	* @param string $type object or assoc<br />
	* @return mixed $return array of rows if select or true/false if insert/update/delete<br />
	*/</p>
<p>	function sql($sql, $database, $type = 'assoc'){<br />
		$return = '';</p>
<p>		// check database connection<br />
		$connection = connect($database);<br />
		if (!$connection){<br />
			$return = false;<br />
		}</p>
<p>		$sql = ltrim($sql);<br />
		$query_type = substr($sql, 0, 6);</p>
<p>		// run query<br />
		$rst = mysql_query($sql);</p>
<p>		if (!$rst){<br />
			// query failed for some reason<br />
			die("Error in MySQL query: " . $sql);<br />
			$return = false;<br />
		}else {</p>
<p>			if (strtoupper($query_type) == "SELECT"){<br />
				// query was SELECT<br />
				$return = array();<br />
				$rows = mysql_num_rows($rst);</p>
<p>				switch($type) {<br />
					case 'assoc' : // return as assoc array<br />
						while($row = mysql_fetch_array($rst)) {<br />
							// gather rows<br />
							$return[] = $row;<br />
						}<br />
						break;<br />
					default : //return as object<br />
					while($row = mysql_fetch_object($rst)) {<br />
						// gather rows<br />
						$return[] = $row;<br />
					}<br />
				}<br />
			}else {<br />
				// query was INSERT, UPDATE OR DELETE<br />
				$queryType = 'UPDATE';<br />
				if (mysql_insert_id()){<br />
					// query was INSERT<br />
					$id = mysql_insert_id();<br />
					$queryType = 'INSERT';<br />
					$return = $id;<br />
				}else {<br />
					$rows = mysql_affected_rows();<br />
					$return = $rows;<br />
				}<br />
			}<br />
		}</p>
<p>		// disconnect from database<br />
		disconnect($connection);</p>
<p>		//return rows / whether insert/update/delete successful<br />
		return $return;<br />
	}</p>
<p>	$sql = "SELECT n.*, nv.body as content FROM node as n LEFT JOIN node_revisions as nv on n.nid = nv.nid WHERE n.type = 'blog'";</p>
<p>	$nodes = sql($sql, DRUPAL);</p>
<p>	//debug($nodes);</p>
<p>	$Nodes = array();</p>
<p>	foreach ($nodes as $node){<br />
		$nId = $node['nid'];<br />
		$sql = "SELECT * FROM comments WHERE nid = '$nId'";<br />
		$comments = sql($sql, DRUPAL);<br />
		$node['comments'] = $comments;<br />
		$Nodes[] = $node;<br />
	}</p>
<p>	//debug($Nodes);</p>
<p>	foreach ($Nodes as $node){<br />
		//publish draft</p>
<p>		$two_hours = 2*3600;<br />
		$date = $node['created'];<br />
		$gmt_date = $date - $two_hours;<br />
		$modified = $node['changed'];<br />
		$gmt_modified = $modified - $two_hours;</p>
<p>		$post_date = date('Y-m-d H:i:s', $date);<br />
		$post_date_gmt = date('Y-m-d H:i:s', $gmt_date);<br />
		$post_modified = date('Y-m-d H:i:s', $modified);<br />
		$post_modified_gmt = date('Y-m-d H:i:s', $gmt_modified);</p>
<p>		$post_title = mysql_escape_string($node['title']);<br />
		$post_content = mysql_escape_string($node['content']);<br />
		$post_name = strtolower(str_replace(array(' ', '.'), array('-', ''), $post_title));</p>
<p>		$status = $node['status'] == '1' ? 'publish' : 'draft';</p>
<p>		$sql = "INSERT INTO phpdevec_posts SET<br />
			post_author = 1,<br />
			post_date = '$post_date',<br />
			post_date_gmt = '$post_date_gmt',<br />
			post_content = '$post_content',<br />
			post_title = '$post_title',<br />
			post_status = '$status',<br />
			comment_status = 'open',<br />
			ping_status = 'open',<br />
			post_name = '$post_name',<br />
			post_modified = '$post_modified',<br />
			post_modified_gmt = '$post_modified_gmt',<br />
			post_parent = '0',<br />
			menu_order = '0',<br />
			post_type = 'post',<br />
			comment_count = 0";</p>
<p>		$id = sql($sql, WORDPRESS);</p>
<p>		if (!$id){<br />
			die('An error occured adding the data to the database');</p>
<p>		}</p>
<p>		/*<br />
		if (!empty($comments)){<br />
			foreach ($comments as $comment){<br />
			}<br />
		}<br />
		*/</p>
<p>		$guid = URL . "?p=$id";</p>
<p>		$sql = "UPDATE phpdevec_posts SET guid = '$guid' WHERE ID = '$id'";</p>
<p>		$updated_rows = sql($sql, WORDPRESS);</p>
<p>		if (!$updated_rows){<br />
			die('An error occured updating record no '. $id);<br />
		}<br />
	}</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://php-developer.co.za/2009/07/18/migrating-from-drupal-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Riding on Rails</title>
		<link>http://php-developer.co.za/2009/07/12/riding-on-rails/</link>
		<comments>http://php-developer.co.za/2009/07/12/riding-on-rails/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 19:12:59 +0000</pubDate>
		<dc:creator>phpdeveloper</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[FCK Editor]]></category>

		<guid isPermaLink="false">http://www.php-developer.co.za/?p=14</guid>
		<description><![CDATA[I&#8217;ve decided to spend less of my free time on blogging and more on learning new things. I had planned to change this site to run on WordPress, but have decided instead to learn Ruby on Rails. From what I can see it is (in many ways) similar to CakePHP (which I love) but with [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided to spend less of my free time on blogging and more on learning new things. I had planned to change this site to run on WordPress, but have decided instead to learn Ruby on Rails.</p>
<p>From what I can see it is (in many ways) similar to CakePHP (which I love) but with more of a command line/linux approach. Also it&#8217;s a new and interesting language to learn, so I&#8217;m sure there will be some exciting challenges along the way.</p>
<p>I don&#8217;t know where this new road will take me, but if its anything like CakePHP, I&#8217;m sure it will be fun. (yes, only geeks find coding fun!)</p>
<p>In other (u)interesting news, the FCK Editor helper I wrote has been used as part of someone else&#8217;s <a title="cake-bake-enhanced" href="http://github.com/josegonzalez/cake-bake-enhanced/tree/master" target="_blank">cake-bake-enhanced project</a>.</p>
<p>To be honest I think it&#8217;s kinda cool, my first CakePHP helper and people are actually finding it worthwhile&#8230;time to write some more&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://php-developer.co.za/2009/07/12/riding-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing with CakePHP: Creating a simple admin control panel</title>
		<link>http://php-developer.co.za/2009/04/25/developing-with-cakephp-creating-a-simple-admin-control-panel/</link>
		<comments>http://php-developer.co.za/2009/04/25/developing-with-cakephp-creating-a-simple-admin-control-panel/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 08:32:10 +0000</pubDate>
		<dc:creator>phpdeveloper</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[admin]]></category>

		<guid isPermaLink="false">http://www.php-developer.co.za/?p=13</guid>
		<description><![CDATA[If you are like me, you prefer to have a specific url mapped to your applications control panel/backend etc. This is usually something along the lines of www.url.com/admin or www.url.com/cms. Normally during the CakePHP &#8220;bake&#8221; process, the system will ask you what you want your admin route to be (default &#8220;admin&#8221;). Once this has been [...]]]></description>
			<content:encoded><![CDATA[<p>If you are like me, you prefer to have a specific url mapped to your applications control panel/backend etc.<br />
This is usually something along the lines of www.url.com/admin or www.url.com/cms.</p>
<p>Normally during the CakePHP &#8220;bake&#8221; process, the system will ask you what you want your admin route to be (default &#8220;admin&#8221;). Once this has been set you are merely 3 simple steps away from creating your own simple user control panel&#8230;.</p>
<p>Step 1) Routing the admin url.<br />
Add the following to your app/config/routes.php</p>
<blockquote><p>Router::connect(&#8216;/admin/&#8217;, array(&#8216;controller&#8217; =&gt; &#8216;admin&#8217;, &#8216;action&#8217; =&gt; &#8216;index&#8217;));</p></blockquote>
<p>This will route url.com/admin to the admin controller index function</p>
<p>Step 2) Creating the admin controller<br />
Create the admin_controller.php file in /app/controllers/ and add the following code</p>
<blockquote><p>class AdminController extends AppController<br />
{<br />
var $name = &#8216;Admin&#8217;;<br />
var $uses = array(); //This controller does not need to use a model</p>
<p>function index(){</p>
<p>}<br />
}</p></blockquote>
<p>Step 3) Create your views<br />
Create the app/views/admin/ directory and add an index.ctp view to it, with whaterver code you prefer (mine  is merely a bunch of links to other controllers at this stage)</p>
<blockquote>
<ul>
<li>link(&#8216;Posts&#8217;, &#8216;posts/&#8217;);</li>
<li>link(&#8216;Comments&#8217;, &#8216;comments/&#8217;);</li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://php-developer.co.za/2009/04/25/developing-with-cakephp-creating-a-simple-admin-control-panel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

