<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<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/"
	>

<channel>
	<title>SourceHosting.blog &#187; Software Development</title>
	<link>http://blog.sourcehosting.net</link>
	<description>Various ramblings on the subjects of SaaS, software development, source code control, configuration management and entrepreneurship</description>
	<pubDate>Thu, 08 May 2008 18:38:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>Basic Views In CodeIgniter</title>
		<link>http://blog.sourcehosting.net/2008/03/07/rendering-views-in-codeigniter/</link>
		<comments>http://blog.sourcehosting.net/2008/03/07/rendering-views-in-codeigniter/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 20:24:53 +0000</pubDate>
		<dc:creator>Greg Larkin</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[codeigniter]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[mvc]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[ports]]></category>

		<guid isPermaLink="false">http://blog.sourcehosting.net/2008/03/07/rendering-views-in-codeigniter/</guid>
		<description><![CDATA[Hi everyone,
A while back, I hooked up my CodeIgniter sample application to a MySQL database. That was easy, and now I&#8217;ll show how to move your presentation code into separate view files, instead of echo&#8217;ing HTML from inside a controller file.
According to the CodeIgniter manual, views are stored in the /views (hmm, that makes sense!) [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone,</p>
<p><a href="http://blog.sourcehosting.net/2008/02/20/hooking-codeigniter-to-mysql/" >A while back</a>, I hooked up my CodeIgniter sample application to a MySQL database. That was easy, and now I&#8217;ll show how to move your presentation code into separate view files, instead of echo&#8217;ing HTML from inside a controller file.</p>
<p>According to the <a href="http://codeigniter.com/user_guide/general/views.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/codeigniter.com');" target="_blank">CodeIgniter manual</a>, views are stored in the <code>/views</code> (hmm, that makes sense!) directory of your application, and they can be divided up across functional areas with subdirectories. Since it&#8217;s possible to create page snippets and load them in sequence, you might have a directory structure like this:</p>
<pre>
/views
  /global
    /layout
      /header.php
      /footer.php
  /navigation
      /left_side.php
      /bottom_links.php
  /user
    /add.php
    /edit.php
    /delete.php
    ...
  /group
    /add.php
    /edit.php
    /delete.php
    ...
  /...
  /...</pre>
<p>Then when you want to render a particular page, say the &#8220;add user&#8221; page of your web app&#8217;s administrative interface, the code would look like this:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">view</span><span class="br0">&#40;</span><span class="st0">&#8216;global/layout/header.php&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">view</span><span class="br0">&#40;</span><span class="st0">&#8216;global/navigation/left_side.php&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">view</span><span class="br0">&#40;</span><span class="st0">&#8216;user/add.php&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">view</span><span class="br0">&#40;</span><span class="st0">&#8216;global/navigation/bottom_links.php&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">view</span><span class="br0">&#40;</span><span class="st0">&#8216;global/layout/footer.php&#8217;</span><span class="br0">&#41;</span>;</div>
<p>I haven&#8217;t gotten that complex yet, but I did move the code to display my user count into a view and set the value in the controller like so:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">function</span> count_users<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$numUsers</span> = <span class="re0">$this</span>-&gt;<span class="me1">user</span>-&gt;<span class="me1">count_users</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$data</span> = <a href="http://www.php.net/array" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.php.net');"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#8216;num_users&#8217;</span> =&gt; <span class="re0">$numUsers</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">view</span><span class="br0">&#40;</span><span class="st0">&#8216;user/showcount&#8217;</span>, <span class="re0">$data</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
<p>The file <code>/views/user/showcount.php</code> is pretty simple:</p>
<div class="dean_ch" style="white-space: wrap;">
&lt;html&gt;<br />
&lt;head&gt;&lt;title&gt;Welcome to the User Area!&lt;/title&gt;&lt;/head&gt;<br />
&lt;body&gt;<br />
This page is rendered by the file: &lt;?php echo __FILE__; ?&gt;<br />
&lt;p&gt;There are &lt;?php echo $num_users; ?&gt; users defined in the database.<br />
&lt;p&gt;&lt;?php echo anchor(&#8217;user&#8217;, &#8216;Go back&#8217;); ?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
<p>Ok, this all seems to be pretty easy. Of course, there&#8217;s a bunch more functionality in the CodeIgniter framework, but I think what I&#8217;ll do for my next post is shift gears and go through the same basic exercises using CakePHP, Prado, and the Zend Framework.</p>
<p>It will be interesting to see if there&#8217;s any similarity to the way the classic &#8220;Hello, world.&#8221; program varies in complexity <a href="http://www.roesler-ac.de/wolfram/hello.htm" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.roesler-ac.de');" target="_blank">based on implementation language</a>!</p>
<p>Keep in touch,<br />
Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sourcehosting.net/2008/03/07/rendering-views-in-codeigniter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FreeBSD Port For CodeIgniter Upgraded to 1.6.1</title>
		<link>http://blog.sourcehosting.net/2008/03/06/freebsd-port-codeigniter-161/</link>
		<comments>http://blog.sourcehosting.net/2008/03/06/freebsd-port-codeigniter-161/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 00:01:05 +0000</pubDate>
		<dc:creator>Greg Larkin</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[codeigniter]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[freebsd]]></category>

		<category><![CDATA[mvc]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[ports]]></category>

		<guid isPermaLink="false">http://blog.sourcehosting.net/2008/03/06/freebsd-port-codeigniter-161/</guid>
		<description><![CDATA[Hi everyone,
I&#8217;ve submitted some new FreeBSD port upgrades over the past week, including new support for CodeIgniter 1.6.1. In addition to the version bump of the upstream distribution, I also added some new bits to allow customization of certain CI files. The port is also careful to avoid removing those modified files when a new [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone,</p>
<p>I&#8217;ve submitted some new FreeBSD port upgrades over the past week, including new support for CodeIgniter 1.6.1. In addition to the version bump of the upstream distribution, I also added some new bits to allow customization of certain CI files. The port is also careful to avoid removing those modified files when a new port upgrade comes along.</p>
<p>The reference for how to handle user-configurable files installed as part of a port can be found in the excellent <a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freebsd.org');" target="_blank">FreeBSD Porter&#8217;s Handbook</a> in the <a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/plist-config.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freebsd.org');" target="_blank">Configuration Files section</a>.</p>
<p>In the new CodeIgniter port, the following user-configurable files are installed:<br />
<code><br />
&lt;INSTALL_DIR&gt;/index.php<br />
&lt;INSTALL_DIR&gt;/index.php.sample<br />
&lt;INSTALL_DIR&gt;/system/application/config/autoload.php<br />
&lt;INSTALL_DIR&gt;/system/application/config/autoload.php.sample<br />
&lt;INSTALL_DIR&gt;/system/application/config/config.php<br />
&lt;INSTALL_DIR&gt;/system/application/config/config.php.sample<br />
&lt;INSTALL_DIR&gt;/system/application/config/database.php<br />
&lt;INSTALL_DIR&gt;/system/application/config/database.php.sample<br />
&lt;INSTALL_DIR&gt;/system/application/config/hooks.php<br />
&lt;INSTALL_DIR&gt;/system/application/config/hooks.php.sample<br />
&lt;INSTALL_DIR&gt;/system/application/config/mimes.php<br />
&lt;INSTALL_DIR&gt;/system/application/config/mimes.php.sample<br />
&lt;INSTALL_DIR&gt;/system/application/config/routes.php<br />
&lt;INSTALL_DIR&gt;/system/application/config/routes.php.sample<br />
&lt;INSTALL_DIR&gt;/system/application/config/smileys.php<br />
&lt;INSTALL_DIR&gt;/system/application/config/smileys.php.sample<br />
&lt;INSTALL_DIR&gt;/system/application/config/user_agents.php<br />
&lt;INSTALL_DIR&gt;/system/application/config/user_agents.php.sample<br />
</code></p>
<p>What this does is install a reference copy of each file (*.sample) that is not expected to be edited by the user.  The actual file that CodeIgniter uses to render pages (no .sample suffix) is user-configurable as needed.</p>
<p>Then some crazy-looking shell code in the <a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/porting-desc.html#AEN99" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freebsd.org');" target="_blank">pkg-plist file</a> makes sure that any edited files are not removed if the port is deinstalled or upgraded (reformatted for readability):</p>
<div class="dean_ch" style="white-space: wrap;">@unexec <span class="kw1">if</span> <span class="kw2">cmp</span> -s %D/%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php.sample \</p>
<p>&nbsp; &nbsp; %D/%%WWWDIR%/%%CI_CONF_DIR%%/autoload.php; <span class="kw1">then</span> \</p>
<p>&nbsp; &nbsp; <span class="kw2">rm</span> -f %D/%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php; <span class="kw1">else</span> \</p>
<p>&nbsp; &nbsp; %%ECHO_MSG%% <span class="st0">&quot;===&gt; Customized %D/%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php <span class="es0">\</span></p>
<p>&nbsp; &nbsp; has not been removed&quot;</span>; <span class="kw1">fi</span></p>
<p>%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php.sample</p>
<p>@<span class="kw3">exec</span> <span class="kw1">if</span> <span class="br0">&#91;</span> ! -f %D/%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php <span class="br0">&#93;</span>; <span class="kw1">then</span> \</p>
<p>&nbsp; &nbsp; <span class="kw2">cp</span> -p %D/%F %B/autoload.php; <span class="kw1">fi</span></div>
<p>This concept needs to be implemented in several of the other ports that I maintain, including <a href="http://www.freshports.org/www/cakephp/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freshports.org');" target="_blank">CakePHP</a> and <a href="http://www.freshports.org/www/prado/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freshports.org');" target="_blank">Prado</a>. If anyone has a list of files that are user-configurable in each of those frameworks, please send it along!</p>
<p>Keep in touch,<br />
Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sourcehosting.net/2008/03/06/freebsd-port-codeigniter-161/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hooking My CodeIgniter Application to MySQL</title>
		<link>http://blog.sourcehosting.net/2008/02/20/hooking-codeigniter-to-mysql/</link>
		<comments>http://blog.sourcehosting.net/2008/02/20/hooking-codeigniter-to-mysql/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 00:19:45 +0000</pubDate>
		<dc:creator>Greg Larkin</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[codeigniter]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[mvc]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.sourcehosting.net/2008/02/20/hooking-codeigniter-to-mysql/</guid>
		<description><![CDATA[Hi everyone,
When I last posted about my sample application development with CodeIgniter, I had created a simple Hello, World application. The next thing I want to explore is how easy it is to connect to a MySQL database and retrieve data.
As a quick side note, the CodeIgniter User Guide is well-written and very clear with [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone,</p>
<p>When I last posted about my sample application development with CodeIgniter, I had created a simple Hello, World application. The next thing I want to explore is how easy it is to connect to a MySQL database and retrieve data.</p>
<p>As a quick side note, the <a href="http://codeigniter.com/user_guide/" onclick="javascript:pageTracker._trackPageview('/outbound/article/codeigniter.com');" target="_blank">CodeIgniter User Guide</a> is well-written and very clear with plenty of examples.  That&#8217;s always nice to see and instills some confidence in the quality of the underlying code.</p>
<p>According to the guide, all of the database connections should be defined in the <code>application/config/database.php</code> file. After setting up a new database named &#8220;ci&#8221; and a database user, I opened <code>database.php</code> and set up my connection:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$db</span><span class="br0">&#91;</span><span class="st0">&#8216;default&#8217;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;hostname&#8217;</span><span class="br0">&#93;</span> = <span class="st0">&quot;localhost&quot;</span>;<br />
<span class="re0">$db</span><span class="br0">&#91;</span><span class="st0">&#8216;default&#8217;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;username&#8217;</span><span class="br0">&#93;</span> = <span class="st0">&quot;ci&quot;</span>;<br />
<span class="re0">$db</span><span class="br0">&#91;</span><span class="st0">&#8216;default&#8217;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;password&#8217;</span><span class="br0">&#93;</span> = <span class="st0">&quot;ci&quot;</span>;<br />
<span class="re0">$db</span><span class="br0">&#91;</span><span class="st0">&#8216;default&#8217;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;database&#8217;</span><span class="br0">&#93;</span> = <span class="st0">&quot;ci&quot;</span>;<br />
<span class="re0">$db</span><span class="br0">&#91;</span><span class="st0">&#8216;default&#8217;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;dbdriver&#8217;</span><span class="br0">&#93;</span> = <span class="st0">&quot;mysql&quot;</span>;<br />
<span class="re0">$db</span><span class="br0">&#91;</span><span class="st0">&#8216;default&#8217;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;dbprefix&#8217;</span><span class="br0">&#93;</span> = <span class="st0">&quot;&quot;</span>;<br />
<span class="re0">$db</span><span class="br0">&#91;</span><span class="st0">&#8216;default&#8217;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;active_r&#8217;</span><span class="br0">&#93;</span> = <span class="kw2">TRUE</span>;<br />
<span class="re0">$db</span><span class="br0">&#91;</span><span class="st0">&#8216;default&#8217;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;pconnect&#8217;</span><span class="br0">&#93;</span> = <span class="kw2">TRUE</span>;<br />
<span class="re0">$db</span><span class="br0">&#91;</span><span class="st0">&#8216;default&#8217;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;db_debug&#8217;</span><span class="br0">&#93;</span> = <span class="kw2">TRUE</span>;<br />
<span class="re0">$db</span><span class="br0">&#91;</span><span class="st0">&#8216;default&#8217;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;cache_on&#8217;</span><span class="br0">&#93;</span> = <span class="kw2">FALSE</span>;<br />
<span class="re0">$db</span><span class="br0">&#91;</span><span class="st0">&#8216;default&#8217;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;cachedir&#8217;</span><span class="br0">&#93;</span> = <span class="st0">&quot;&quot;</span>;</div>
<p>That was easy enough.  Now I&#8217;ve got the skeleton of a model defined in <code>application/models/user_model.php</code>:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">class</span> Group_model <span class="kw2">extends</span> Model <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw2">function</span> Group_model<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; parent::<span class="me2">Model</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">database</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<p>The <code>$this-&gt;load-&gt;database()</code> statement automatically connects to MySQL using the default connection I defined previously. Now I can use the <code>$this-&gt;db</code> object to run queries and process results elsewhere in my model file.</p>
<p>I&#8217;ll replace my original hard-coded count_users function with something that runs an actual database query:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">function</span> count_users<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="re0">$query</span> = <span class="re0">$this</span>-&gt;<span class="me1">db</span>-&gt;<span class="me1">query</span><span class="br0">&#40;</span><span class="st0">&#8216;SELECT COUNT(*) AS num_users FROM user&#8217;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$query</span>-&gt;<span class="me1">num_rows</span><span class="br0">&#40;</span><span class="br0">&#41;</span> &gt; <span class="nu0">0</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$query</span>-&gt;<span class="me1">row</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-&gt;<span class="me1">num_users</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<p>Of course, I have to leave a newbie coding error in there for someone to notice. <a href="http://www.imdb.com/title/tt0091042/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.imdb.com');" target="_blank">Anyone? Anyone? Bueller?</a></p>
<p>Here&#8217;s my simple MySQL database schema:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="co1">&#8211;</span><br />
<span class="co1">&#8211; Table structure for table `user`</span><br />
<span class="co1">&#8211;</span></p>
<p><span class="kw1">CREATE TABLE</span> IF <span class="kw3">NOT</span> <span class="kw1">EXISTS</span> `user` <span class="br0">&#40;</span><br />
`id` <span class="kw2">INT</span><span class="br0">&#40;</span><span class="nu0">11</span><span class="br0">&#41;</span> <span class="kw3">NOT NULL</span> <span class="kw3">AUTO_INCREMENT</span>,<br />
`user_name` <span class="kw2">VARCHAR</span><span class="br0">&#40;</span><span class="nu0">128</span><span class="br0">&#41;</span> <span class="kw3">NOT NULL</span>,<br />
`full_name` <span class="kw2">VARCHAR</span><span class="br0">&#40;</span><span class="nu0">128</span><span class="br0">&#41;</span> <span class="kw3">NOT NULL</span>,<br />
`email` <span class="kw2">VARCHAR</span><span class="br0">&#40;</span><span class="nu0">128</span><span class="br0">&#41;</span> <span class="kw3">NOT NULL</span>,<br />
<span class="kw1">PRIMARY KEY</span> &nbsp;<span class="br0">&#40;</span>`id`<span class="br0">&#41;</span><br />
<span class="br0">&#41;</span> ENGINE=MyISAM &nbsp;<span class="kw3">DEFAULT</span> <span class="kw3">CHARSET</span>=latin1 <span class="kw3">AUTO_INCREMENT</span>=<span class="nu0">3</span> ;</p>
<p><span class="co1">&#8211;</span><br />
<span class="co1">&#8211; Dumping data for table `user`</span><br />
<span class="co1">&#8211;</span></p>
<p><span class="kw1">INSERT</span> <span class="kw1">INTO</span> `user` <span class="br0">&#40;</span>`id`, `user_name`, `full_name`, `email`<span class="br0">&#41;</span> <span class="kw1">VALUES</span><br />
<span class="br0">&#40;</span><span class="nu0">1</span>, <span class="st0">&#8216;glarkin&#8217;</span>, <span class="st0">&#8216;Greg Larkin&#8217;</span>, <span class="st0">&#8216;glarkin@sourcehosting.net&#8217;</span><span class="br0">&#41;</span>,<br />
<span class="br0">&#40;</span><span class="nu0">2</span>, <span class="st0">&#8216;morsel&#8217;</span>, <span class="st0">&#8216;Morsel The Cat&#8217;</span>, <span class="st0">&#8216;morsel@meow.com&#8217;</span><span class="br0">&#41;</span>;</div>
<p>When I navigate to my <code>/codeigniter/user/count_users/</code> URL, I see:</p>
<p><code>There are 2 users defined</code></p>
<p>Great! Next up, we&#8217;ll take a look at creating an actual output page with views.</p>
<p>Keep in touch,<br />
Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sourcehosting.net/2008/02/20/hooking-codeigniter-to-mysql/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CodeIgniter 1.6.1 Is Released</title>
		<link>http://blog.sourcehosting.net/2008/02/15/codeigniter-161-released/</link>
		<comments>http://blog.sourcehosting.net/2008/02/15/codeigniter-161-released/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 21:31:51 +0000</pubDate>
		<dc:creator>Greg Larkin</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[codeigniter]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[mvc]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[ports]]></category>

		<guid isPermaLink="false">http://blog.sourcehosting.net/2008/02/15/codeigniter-161-released/</guid>
		<description><![CDATA[Hi everyone,
I just saw that CodeIgniter 1.6.1 has been released. I guess that means I&#8217;d better get on the stick and upgrade the FreeBSD CodeIgniter port! Once I do that, I&#8217;ll upgrade my PHP Framework VM with the new version of the port and continue on with the experimentation.
Keep in touch,
Greg
]]></description>
			<content:encoded><![CDATA[<p>Hi everyone,</p>
<p>I just saw that <a href="http://codeigniter.com/news/codeigniter_161_released/" onclick="javascript:pageTracker._trackPageview('/outbound/article/codeigniter.com');" target="_blank">CodeIgniter 1.6.1 has been released</a>. I guess that means I&#8217;d better get on the stick and upgrade the <a href="http://www.freshports.org/www/codeigniter/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freshports.org');" target="_blank">FreeBSD CodeIgniter port</a>! Once I do that, I&#8217;ll upgrade my PHP Framework VM with the new version of the port and continue on with the experimentation.</p>
<p>Keep in touch,<br />
Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sourcehosting.net/2008/02/15/codeigniter-161-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Diving Into CodeIgniter</title>
		<link>http://blog.sourcehosting.net/2008/02/08/diving-into-codeigniter/</link>
		<comments>http://blog.sourcehosting.net/2008/02/08/diving-into-codeigniter/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 22:19:06 +0000</pubDate>
		<dc:creator>Greg Larkin</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[codeigniter]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[mvc]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.sourcehosting.net/2008/02/08/diving-into-codeigniter/</guid>
		<description><![CDATA[Hi everyone,
Now that I&#8217;ve got my FreeBSD virtual machine set up with the various PHP frameworks, it&#8217;s time to start putting together a sample application in each one to learn their strengths and weaknesses. The sample application will be a simple mailing list manager and contain common features such as:

User account self-registration
Email generation
Management interface
MySQL database [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone,</p>
<p>Now that I&#8217;ve got my FreeBSD virtual machine set up with the various PHP frameworks, it&#8217;s time to start putting together a sample application in each one to learn their strengths and weaknesses. The sample application will be a simple mailing list manager and contain common features such as:</p>
<ul>
<li>User account self-registration</li>
<li>Email generation</li>
<li>Management interface</li>
<li>MySQL database backend</li>
</ul>
<p>I think that will exercise enough of each framework to get a good handle on their functionality and ease of use.<br />
I&#8217;m starting off with <a href="http://www.codeigniter.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.codeigniter.com');" target="_blank">CodeIgniter</a>. At first glance, the documentation seems excellent, and the code is commented very clearly. Looking at the <code>index.php</code> file in the root installation directory (<code>/usr/local/www/codeigniter</code> on FreeBSD), I see:</p>
<div class="dean_ch" style="white-space: wrap;">
/*<br />
|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| APPLICATION FOLDER NAME<br />
|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
|<br />
| If you want this front controller to use a different &quot;application&quot;<br />
| folder then the default one you can set its name here. The folder<br />
| can also be renamed or relocated anywhere on your server.<br />
| For more info please see the user guide:<br />
| http://www.codeigniter.com/user_guide/general/managing_apps.html<br />
|<br />
|<br />
| NO TRAILING SLASH!<br />
|<br />
*/<br />
$application_folder = &quot;application&quot;;<br />
&nbsp;</div>
<p>Ok, that seems easy enough. To keep the default application intact and start working on my custom application, I simply copied the existing application directory to <code>/usr/local/www/ci_sourcehosting</code> and updated the <code>index.php</code> file.</p>
<div class="dean_ch" style="white-space: wrap;">
$application_folder = &quot;/usr/local/www/ci_sourcehosting&quot;;<br />
&nbsp;</div>
<p>According to the welcome page displayed by CodeIgniter, I have to change the <code>views/welcome_message.php</code> file to change the default page contents. Ok, easy enough&#8230;</p>
<p><a href="http://blog.sourcehosting.net/wp-content/uploads/2008/02/codeigniter-my-hello-world.png"  target="_blank"><img src='http://blog.sourcehosting.net/wp-content/plugins/power-thumbnail/show-image.php?type=resize&amp;id=29&amp;r=0.3519313304721&amp;w=400&amp;h=246' alt='Custom Hello World on CodeIgniter' width='400' height='246' /></a></p>
<p>The <code>controllers/welcome.php</code> controller is called by default, and that&#8217;s configured in the <code>config/routes.php</code> file in your application directory.</p>
<p>To create a new controller, simply create a new class that extends Controller and name it with a capital letter. Save the new class to the lowercase version of the class name into the <code>/controllers</code> directory, and you&#8217;re ready to test.</p>
<p>My simple class is:</p>
<div class="dean_ch" style="white-space: wrap;">
class User extends Controller {<br />
&nbsp; &nbsp; function index()<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;Welcome to the user controller&#8217;;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; function count-users()<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;There are 0 users defined&#8217;;<br />
&nbsp; &nbsp; }<br />
}<br />
&nbsp;</div>
<p>When I visit <code>http://192.168.95.128/codeigniter/user</code>, I see:</p>
<p><code>Welcome to the user controller</code></p>
<p>and <code>http://192.168.95.128/codeigniter/user/count-users</code> displays:</p>
<p><code>There are 0 users defined</code></p>
<p>Ok, that&#8217;s pretty straightforward, but I did have to do a bit of mucking about to get the URLs to look like <code>http://192.168.95.128/codeigniter/user/count</code> instead of <code>http://192.168.95.128/<strong>index.php</strong>/codeigniter/user/count</code>.</p>
<p>The CodeIgniter manual specifies a .htaccess file to be placed in the directory where the index.php front controller is located:</p>
<div class="dean_ch" style="white-space: wrap;">
RewriteEngine on<br />
RewriteCond $1 !^(index.php|images|robots.txt)<br />
RewriteRule ^(.*)$ /index.php/$1 [L]<br />
&nbsp;</div>
<p>Normally, this works fine, except Apache 2.2 specifies <code>AllowOverride None</code> by default, so .htaccess files don&#8217;t work. After changing that, I had to make one small change to the .htaccess file, since my CodeIgniter installation is rooted at <code>/codeigniter</code>:</p>
<div class="dean_ch" style="white-space: wrap;">
RewriteRule ^(.*)$ /codeigniter/index.php/$1 [L]<br />
&nbsp;</div>
<p>Next time, we&#8217;ll take a look at hooking CodeIgniter to MySQL.</p>
<p>Keep in touch,<br />
Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sourcehosting.net/2008/02/08/diving-into-codeigniter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing PHP Frameworks with the FreeBSD Ports Tree</title>
		<link>http://blog.sourcehosting.net/2008/02/01/freebsd-cakephp-installation/</link>
		<comments>http://blog.sourcehosting.net/2008/02/01/freebsd-cakephp-installation/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 16:21:51 +0000</pubDate>
		<dc:creator>Greg Larkin</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[cakephp]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[freebsd]]></category>

		<category><![CDATA[mvc]]></category>

		<category><![CDATA[ports]]></category>

		<guid isPermaLink="false">http://blog.sourcehosting.net/2008/02/01/freebsd-cakephp-installation/</guid>
		<description><![CDATA[Hi everyone,
Ok, let&#8217;s proceed to install the various PHP frameworks that we&#8217;ll use to create a sample application.
As I mentioned in a previous post, the basic command for installing any port in the tree is:
cd /usr/ports/&#60;category&#62;/&#60;appname&#62; &#38;&#38; make install clean
Let&#8217;s start with the CakePHP framework:
cd /usr/ports/www/cakephp &#38;&#38; make install clean
After typing that command, you should [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone,</p>
<p>Ok, let&#8217;s proceed to install the various PHP frameworks that we&#8217;ll use to create a sample application.</p>
<p>As I mentioned in a previous post, the basic command for installing any port in the tree is:</p>
<pre>cd /usr/ports/&lt;category&gt;/&lt;appname&gt; &amp;&amp; make install clean</pre>
<p>Let&#8217;s start with the <a href="http://www.cakephp.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.cakephp.org');" target="_blank">CakePHP framework</a>:</p>
<pre>cd /usr/ports/www/cakephp &amp;&amp; make install clean</pre>
<p>After typing that command, you should see this on the screen:</p>
<p><a href="http://blog.sourcehosting.net/wp-content/uploads/2008/01/make-install-options.png"  target="_blank"><img src='http://blog.sourcehosting.net/wp-content/plugins/power-thumbnail/show-image.php?type=resize&amp;id=19&amp;r=0.54094827586207&amp;w=400&amp;h=251' alt='FreeBSD Port Installation Options' width='400' height='251' /></a></p>
<p>Hmm, what is that screen for? The FreeBSD ports collection has a robust infrastructure for configuring software applications prior to installation. In this case, CakePHP works with multiple different database backends, so the port writer (i.e. <a href="http://www.linkedin.com/in/greglarkin" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.linkedin.com');" target="_blank">me</a>) decided to provide options so the prerequisite bits are installed before the port proper.</p>
<p>Looking at the options provided here, the first one named &#8220;PROD&#8221; determines the way that the Apache web server is configured for CakePHP. If this is a production server, this option should be selected so navigating to &#8220;http://&lt;servername&gt;/&#8221; displays the CakePHP welcome page.  Since I am installing multiple frameworks on the same machine, I&#8217;ll leave this option unchecked. That way, each framework welcome page will be found at &#8220;http://&lt;servername&gt;/&lt;frameworkname&gt;/&#8221;.</p>
<p>I plan to use MySQL as a database backend, so the following screenshot shows the MYSQL option selected. The dialog box is navigated with the tab and arrow keys on your keyboard, and the spacebar toggles the option selections:</p>
<p><a href="http://blog.sourcehosting.net/wp-content/uploads/2008/01/make-install-options-mysql.png"  target="_blank"><img src='http://blog.sourcehosting.net/wp-content/plugins/power-thumbnail/show-image.php?type=resize&amp;id=20&amp;r=0.54094827586207&amp;w=400&amp;h=251' alt='FreeBSD Port MySQL Option' width='400' height='251' /></a></p>
<p>Tab to the OK button and hit Enter, and the port build starts. Here is the full transcript of the process:</p>
<a rel="nofollow" title="Download version 0.1 of cakephp.log" onclick="if (window.urchinTracker) urchinTracker ('/downloads/2008/02/cakephp.log');" href="/downloads/2008/02/cakephp.log">CakePHP Port Build Transcript</a>
<p>Notice that by selecting the MYSQL option prior to installation, the port build fetched and built the MySQL client library and the PHP MySQL module, as well as some other packages:</p>
<p>mysql-client-5.0.51<br />
php5-pcre-5.2.5_1<br />
php5-pdo-5.2.5_1<br />
php5-pdo_mysql-5.2.5_1<br />
php5-session-5.2.5_1</p>
<p>This helps us get a working PHP installation that supports CakePHP out of the box.</p>
<p>Now, it&#8217;s the moment of truth - does the CakePHP default page display correctly?  In order to load the page on your host machine, find the VM&#8217;s IP address with the following command:</p>
<pre>/sbin/ifconfig -a | grep -w inet | grep -v 127.0.0.1 | awk '{ print $2 }'</pre>
<p>That gives me 192.168.95.128, so here&#8217;s the URL where I should find the CakePHP default page: http://192.168.95.128/cakephp/. The address will likely be different for you.</p>
<p>This looks good!</p>
<p><a href="http://blog.sourcehosting.net/wp-content/uploads/2008/02/cakephp-default.png"  target="_blank"><img src='http://blog.sourcehosting.net/wp-content/plugins/power-thumbnail/show-image.php?type=resize&amp;id=25&amp;r=0.39084967320261&amp;w=400&amp;h=299' alt='CakePHP Default Page' width='400' height='299' /></a></p>
<p>Now as an exercise for the reader, try installing the rest of the frameworks and make sure that they display their welcome pages:</p>
<p><a href="http://www.freshports.org/www/codeigniter/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freshports.org');" target="_blank">CodeIgniter</a><br />
<a href="http://www.freshports.org/www/prado/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freshports.org');" target="_blank">PRADO</a><br />
<a href="http://www.freshports.org/www/zend-framework/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freshports.org');" target="_blank">Zend Framework</a></p>
<p>If you have any trouble, write in with comments and feedback.</p>
<p>Keep in touch,<br />
Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sourcehosting.net/2008/02/01/freebsd-cakephp-installation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Update the FreeBSD Ports Tree</title>
		<link>http://blog.sourcehosting.net/2008/01/28/freebsd-portsnap-sample-run/</link>
		<comments>http://blog.sourcehosting.net/2008/01/28/freebsd-portsnap-sample-run/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 19:18:42 +0000</pubDate>
		<dc:creator>Greg Larkin</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[freebsd]]></category>

		<category><![CDATA[portsnap]]></category>

		<guid isPermaLink="false">http://blog.sourcehosting.net/2008/01/28/freebsd-portsnap-sample-run/</guid>
		<description><![CDATA[Hi everyone,
Now that we&#8217;ve got the FreeBSD 6.2 VM booted up under VMware Player or VMware Server,  we need to make sure that we&#8217;ve got the latest version of the ports tree installed. Since you may be reading this well after I build the original VM image, the FreeBSD ports tree has probably changed [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone,</p>
<p>Now that we&#8217;ve got the FreeBSD 6.2 VM booted up under VMware Player or VMware Server,  we need to make sure that we&#8217;ve got the latest version of the ports tree installed. Since you may be reading this well after I build the original VM image, the <a href="http://www.freebsd.org/ports/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freebsd.org');" target="_blank">FreeBSD ports tree</a> has probably changed a lot, and it&#8217;s possible that new versions of the PHP frameworks are available.</p>
<p>First of all, what is the ports tree? Quite simply, it&#8217;s a large collection of directories (18,000+ at last count!), one for every 3rd party software package that has been ported to FreeBSD. What does this gain you? The idea is that any piece of ported software can be installed on your FreeBSD system as easily as typing the following command in the appropriate directory:</p>
<pre>cd /usr/ports/&lt;category&gt;/&lt;appname&gt; &amp;&amp; make install clean</pre>
<p>e.g.</p>
<pre>cd /usr/ports/databases/mysql50-server &amp;&amp; make install clean</pre>
<p>That&#8217;s it! The same command will install anything from a simple Perl module to the Java development kit.</p>
<p>The command to update your FreeBSD VM with the latest ports tree is equally simple. Log in as root and type the following:</p>
<pre>portsnap fetch update</pre>
<p>You&#8217;ll see some output like this:</p>
<a rel="nofollow" title="Download version 0.1 of portsnap.log" onclick="if (window.urchinTracker) urchinTracker ('/downloads/2008/01/portsnap.log');" href="/downloads/2008/01/portsnap.log">Sample FreeBSD portsnap run</a>
<p>Now we&#8217;re ready to install some PHP frameworks, but that&#8217;s a post for another day!</p>
<p>Keep in touch,<br />
Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sourcehosting.net/2008/01/28/freebsd-portsnap-sample-run/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Booting Your First VMware Virtual Machine</title>
		<link>http://blog.sourcehosting.net/2008/01/25/boot-a-vmware-virtual-machine/</link>
		<comments>http://blog.sourcehosting.net/2008/01/25/boot-a-vmware-virtual-machine/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 16:13:57 +0000</pubDate>
		<dc:creator>Greg Larkin</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[freebsd]]></category>

		<category><![CDATA[virtual appliance]]></category>

		<category><![CDATA[virtual machine]]></category>

		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://blog.sourcehosting.net/2008/01/25/boot-a-vmware-virtual-machine/</guid>
		<description><![CDATA[Hello everyone,
Now that we&#8217;ve got some example virtual machines to play around with, let&#8217;s move on to the next step and get one running.
I&#8217;m using VMware Player on Windows XP, and the VM files have been extracted to My Documents\My Virtual Machines. The folder contents look like this:

Digging into the VM installation directory proper, you [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone,</p>
<p>Now that we&#8217;ve got some <a href="http://torrents.sourcehosting.net:10692/torrents/FreeBSD+6.2+Basic+Installation+-+Bare+Bones.zip.torrent?CEFC37315130C147CE7D8B4B63F30BEB939C5B81" onclick="javascript:pageTracker._trackPageview('/outbound/article/torrents.sourcehosting.net:10692');" target="_blank">example virtual machines</a> to <a href="http://torrents.sourcehosting.net:10692/torrents/FreeBSD+6.2+Basic+Installation+-+Apache+2.2+%2B+PHP+5.2.5.zip.torrent?58AB0331EA8BAA4AD50EB103B428A8E52F13884B" onclick="javascript:pageTracker._trackPageview('/outbound/article/torrents.sourcehosting.net:10692');" target="_blank">play around with</a>, let&#8217;s move on to the next step and get one running.</p>
<p>I&#8217;m using <a href="http://www.vmware.com/products/player/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.vmware.com');" target="_blank">VMware Player</a> on Windows XP, and the VM files have been extracted to My Documents\My Virtual Machines. The folder contents look like this:</p>
<p><a href="http://blog.sourcehosting.net/wp-content/uploads/2008/01/vmware-installation-directory.png"  target="_blank" title="VMware Installation Directory"><img src='http://blog.sourcehosting.net/wp-content/plugins/power-thumbnail/show-image.php?type=resize&amp;id=11&amp;r=0.5&amp;w=400&amp;h=300' alt='VMware Installation Directory' width='400' height='300' /></a></p>
<p>Digging into the VM installation directory proper, you see all of the files that make up your  virtual machine:</p>
<p><a href="http://blog.sourcehosting.net/wp-content/uploads/2008/01/virtual-machine-directory.png"  title="Virtual Machine Directory" target="_blank"><img src='http://blog.sourcehosting.net/wp-content/plugins/power-thumbnail/show-image.php?type=resize&amp;id=12&amp;r=0.5&amp;w=400&amp;h=300' alt='Virtual Machine Directory' width='400' height='300' /></a></p>
<p>The .vmx file is a text file that contains all of the virtual machine configuration options. You can change the VM memory allocation, add/remove devices, etc. just by editing that file. The .vmdk files are the virtual machine&#8217;s disks and store its state across reboots.</p>
<p>If your VM ever runs out of disk space and you still have room on your host operating system, you can create additional vmdk files and attach them to the VM. That sure is easier than cracking open a server case and physically installing new drives!</p>
<p>Next, double-click on the <strong>FreeBSD 6.2 Basic Installation.vmx</strong> file, and VMware Player starts up and boots the VM:</p>
<p><a href="http://blog.sourcehosting.net/wp-content/uploads/2008/01/freebsd-boot-menu.png"  title="FreeBSD Boot Menu" target="_blank"><img src='http://blog.sourcehosting.net/wp-content/plugins/power-thumbnail/show-image.php?type=resize&amp;id=13&amp;r=0.54094827586207&amp;w=400&amp;h=251' alt='FreeBSD Boot Menu' width='400' height='251' /></a></p>
<p>After the usual messages, the virtual machine has booted, and you see the familiar UNIX login prompt:</p>
<p><a href="http://blog.sourcehosting.net/wp-content/uploads/2008/01/freebsd-boot-completion.png"  title="FreeBSD Boot Completion" target="_blank"><img src='http://blog.sourcehosting.net/wp-content/plugins/power-thumbnail/show-image.php?type=resize&amp;id=14&amp;r=0.54094827586207&amp;w=400&amp;h=251' alt='FreeBSD Boot Completion' width='400' height='251' /></a></p>
<p>Next time, we&#8217;ll dive into installing the various PHP frameworks under FreeBSD. The FreeBSD ports system is designed for ease of use, and you&#8217;ll see how simple it is to get a software package and all of its dependencies installed with one command.</p>
<p>Keep in touch,<br />
Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sourcehosting.net/2008/01/25/boot-a-vmware-virtual-machine/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FreeBSD 6.2 VMware Image for the PHP Framework Face-Off</title>
		<link>http://blog.sourcehosting.net/2008/01/18/freebsd-vmware-image/</link>
		<comments>http://blog.sourcehosting.net/2008/01/18/freebsd-vmware-image/#comments</comments>
		<pubDate>Sat, 19 Jan 2008 02:30:36 +0000</pubDate>
		<dc:creator>Greg Larkin</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[freebsd]]></category>

		<category><![CDATA[mvc]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[virtual appliance]]></category>

		<category><![CDATA[virtual machine]]></category>

		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://blog.sourcehosting.net/2008/01/18/freebsd-vmware-image/</guid>
		<description><![CDATA[Hi all,
After my last post, I realized it might be nice to provide a clean VMware image of FreeBSD 6.2 for folks who want to follow along as I try out the various PHP frameworks.
The first thing you&#8217;ll need to start up the virtual machine is one of the following free VMware tools:

VMware Player
VMware Server

Both [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all,</p>
<p>After my last post, I realized it might be nice to provide a clean VMware image of FreeBSD 6.2 for folks who want to follow along as I try out the various PHP frameworks.</p>
<p>The first thing you&#8217;ll need to start up the virtual machine is one of the following free VMware tools:</p>
<ul>
<li><a href="http://www.vmware.com/products/player/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.vmware.com');" target="_blank">VMware Player</a></li>
<li><a href="http://www.vmware.com/products/server/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.vmware.com');" target="_blank">VMware Server</a></li>
</ul>
<p>Both of these tools allow you to run virtual machines on your server and/or desktop. The VMware Player is most useful if you just want to run pre-built virtual machines and use them for experimentation and evaluation. VMware Server gives the ability to create your own custom virtual machines and install your choice of operating system.</p>
<p>Once you have one of those tools installed on your machine, download a FreeBSD 6.2 VMware image from the <a href="http://torrents.sourcehosting.net:10692/" onclick="javascript:pageTracker._trackPageview('/outbound/article/torrents.sourcehosting.net:10692');" target="_blank">SourceHosting.net BitTorrent tracker</a>. You can find detailed instructions on setting up the VMware image in a <a href="http://blog.sourcehosting.net/2008/01/31/freebsd-vmware-images-available-on-bittorrent/"  target="_blank">subsequent blog posting</a>.</p>
<p>The OS install is configured as follows:</p>
<ul>
<li>Root user has no password</li>
<li>Networking is configured with DHCP and uses NAT for outbound connections</li>
<li>Extracted size is 11Gb</li>
<li>FreeBSD ports tree is installed in /usr/ports and is current as of 01/30/08</li>
<li>Latest security patches as of 01/17/08 have been applied</li>
</ul>
<p>Extract the downloaded file somewhere on your drive and fire up VMware Player or VMware Server and follow the prompts to start the VM.</p>
<p>In case you&#8217;re new to FreeBSD, there&#8217;s a wealth of information in the <a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freebsd.org');" target="_blank">Handbook</a>.  After you&#8217;ve logged in and had a look around, you can use the following command to shut the VM down cleanly:</p>
<p><code>/sbin/shutdown -p now</code></p>
<p>Look for a new post soon describing how to install each of the PHP frameworks.</p>
<p>Keep in touch,<br />
Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sourcehosting.net/2008/01/18/freebsd-vmware-image/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP Framework Face-Off</title>
		<link>http://blog.sourcehosting.net/2008/01/15/php-framework-face-off/</link>
		<comments>http://blog.sourcehosting.net/2008/01/15/php-framework-face-off/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 20:22:10 +0000</pubDate>
		<dc:creator>Greg Larkin</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[mvc]]></category>

		<category><![CDATA[orm]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.sourcehosting.net/2008/01/15/php-framework-face-off/</guid>
		<description><![CDATA[Hello everyone,
I recently created a FreeBSD port for each of the following PHP frameworks:

CakePHP (stable)
CakePHP (development)
CodeIgniter
PRADO
Zend Framework

I originally started with the Zend Framework port a while back, thinking I would use it to rebuild the SourceHosting.net web site. Since I want all software on the SourceHosting.net FreeBSD servers to be installed and upgraded using the [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone,</p>
<p>I recently created a <a href="http://www.freebsd.org/ports/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freebsd.org');" target="_blank">FreeBSD port</a> for each of the following PHP frameworks:</p>
<ul>
<li><a href="http://www.cakephp.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.cakephp.org');" target="_blank">CakePHP</a> (stable)</li>
<li><a href="http://www.cakephp.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.cakephp.org');" target="_blank">CakePHP</a> (development)</li>
<li><a href="http://www.codeigniter.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.codeigniter.com');" target="_blank">CodeIgniter</a></li>
<li><a href="http://www.pradosoft.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.pradosoft.com');" target="_blank">PRADO</a></li>
<li><a href="http://framework.zend.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/framework.zend.com');" target="_blank">Zend Framework</a></li>
</ul>
<p>I originally started with the Zend Framework port <a href="http://www.freebsd.org/cgi/getmsg.cgi?fetch=989538+0+/usr/local/www/db/text/2006/cvs-ports/20061112.cvs-ports" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.freebsd.org');" target="_blank">a while back</a>, thinking I would use it to rebuild the SourceHosting.net web site. Since I want all software on the SourceHosting.net FreeBSD servers to be installed and upgraded using the ports system, I had to build the ZF port first. The only problem with building a port is that it doesn&#8217;t always require you to learn the ins and outs of actually using the software that you are porting.</p>
<p>The web site rebuilding project is still in the planning phases, and now that I&#8217;ve created ports for some additional PHP frameworks, I thought it might be useful to put together a simple web site using each one. I&#8217;ve read a lot of comments about each one, the strong points and weaknesses, but I think a hands-on experiment with each one will help a lot to narrow down the final choice.</p>
<p>A slightly more advanced <a href="http://en.wikipedia.org/wiki/Hello_world_program" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');" target="_blank">&#8220;Hello, world.&#8221; program</a> than the one in my original dog-eared copy of <a href="http://en.wikipedia.org/wiki/The_C_Programming_Language_%28book%29" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');" target="_blank">K&amp;R</a> ought to make the final choice easy to make. I&#8217;ll post progress here, and send any comments you have along the way.</p>
<p>Keep in touch,<br />
Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sourcehosting.net/2008/01/15/php-framework-face-off/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
