<?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>ZEE4</title>
	<atom:link href="http://zee4.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://zee4.com</link>
	<description>Zoltan Hunt, web-designer and developer in Toronto, Canada</description>
	<lastBuildDate>Sun, 09 Oct 2011 21:06:54 +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>CakePHP Expandable Behaviour Tip</title>
		<link>http://zee4.com/2011/01/cakephp-expandable-behaviour-tip/</link>
		<comments>http://zee4.com/2011/01/cakephp-expandable-behaviour-tip/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 00:23:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[YYZtech]]></category>
		<category><![CDATA[behaviours]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[debuggable.com]]></category>

		<guid isPermaLink="false">http://zee4.com/?p=166</guid>
		<description><![CDATA[When YYZtech was being updated to use the VSS (Venue Storage System) from the previous system, it became clear that VSS needed to be updated as well. One of the original goals of VSS was that it could be a &#8230; <a href="http://zee4.com/2011/01/cakephp-expandable-behaviour-tip/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When  YYZtech was being updated to use the VSS (Venue Storage System) from  the previous system, it became clear that VSS needed to be updated as  well. One of the original goals of VSS was that it could be a directory  system for different kinds of things as long as they where physical  venues of some kind and so they had certain properties like an actual  address, hours they open to the public, etc.</p>
<p>As  part of that, a way of storing “meta” information was needed, that is  information that was unique to a venue or type of venue that not all  would have, much like WordPress lets additional information about a post  be stored in a separate table which makes, say, adding an ISBN number  field to book reviews easy.</p>
<p>After rolling our own for several projects, <a href="http://www.debuggable.com/posts/unlimited-model-fields-expandable-behavior:48428c2e-9a88-47ec-ae8e-77a64834cda3" target="_blank">Felix Geisendörfer’s Expandable behaviour</a> was chosen because it was simple to set-up and use and it just worked.  Hopefully CakePHP at some point includes a similar functionality as an  &#8220;official&#8221; add on much like virtual fields was added in CakePHP 1.3</p>
<p>Which leads to a “gotcha”&#8230;.<br />
One  issue combining virtual fields and the Expandable behaviour is that  virtual fields can end up being interpreted as new fields by Expandable  and Expandable then saving them. What’s worse, is that when the table  entry is loaded, the virtual field and field from Expandable are  combined with one overwriting the other.</p>
<p>This  particular behaviour happened when we added a way of cloning venues,  removing and replacing certain information along the way. The reason for  this would be adding a chain store location; the address and phone  number would change but the description or products sold probably  wouldn’t. Now the table that stored the venues had a virtual field,  full_name, that contained the name and sub-name of a venue (e.g. “Joe’s  Bar”, “and Delicatessen” as “Joe’s Bar and Delicatessen”) which  Expandable saw as a new field and saved the virtual field to its table  and led to about 20 minutes trying to figure out if there was some kind  of weird caching issue going on.</p>
<p>Anyways, the fix was to turn off the virtual fields like so:<br />
$this-&gt;Venue-&gt;virtualFields = false;</p>
<p>&#8230;and that was the end of that problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://zee4.com/2011/01/cakephp-expandable-behaviour-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nexus One Update</title>
		<link>http://zee4.com/2010/07/nexus-one-update/</link>
		<comments>http://zee4.com/2010/07/nexus-one-update/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 19:18:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://zee4.com/?p=154</guid>
		<description><![CDATA[The Day after Canada Day I was walking around Halifax and got a message on the Nexus phone that an update was ready to download. By the size of it, it wasn&#8217;t a big surprise what it was: the 2.2 &#8230; <a href="http://zee4.com/2010/07/nexus-one-update/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Day after Canada Day I was walking around  Halifax and got a message on the Nexus phone that an update was ready to  download.</p>
<p>By the size of it, it wasn&#8217;t a big surprise what it was: the <a id="aol2" title="2.2 update (Froyo) had arrived" href="http://googlenexusoneboard.blogspot.com/2010/06/new-android-22-software-update-for.html">2.2 update (Froyo) had  arrived</a>. There aren&#8217;t a lot of obvious changes apart from some small changes to the interface, but most of them  seem to be <a href="http://developer.android.com/sdk/android-2.2-highlights.html" target="_blank">under the hood</a>. The much talked-about tethering (turn your  phone into a WiFi hot-spot) is there, as are <a id="vh45" title="general speed improvements" href="http://www.engadget.com/2010/07/07/froyo-versus-ios-4-the-browser-showdown-video/">general speed improvements</a>.</p>
<p>I also went to the market and downloaded the Flash player which means  visiting a number of web pages is much more satisfying. In short, some  new features, a bit faster, and nothing broke (yet) &#8211; I&#8217;m happy.  Hopefully other Android users will be getting their updates soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://zee4.com/2010/07/nexus-one-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nexus One Experience</title>
		<link>http://zee4.com/2010/05/nexus-one-experience/</link>
		<comments>http://zee4.com/2010/05/nexus-one-experience/#comments</comments>
		<pubDate>Wed, 26 May 2010 20:59:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[commentary]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[mobile google]]></category>

		<guid isPermaLink="false">http://zee4.com/?p=145</guid>
		<description><![CDATA[I&#8217;ve been using a Nexus One for about the last month on Fido&#8217;s network. Overall it&#8217;s a good phone and quite a step up from my previous, semi-indestructible, smart-phone; I say &#8220;semi&#8221; as, though the Nokia E62 handled being dropped &#8230; <a href="http://zee4.com/2010/05/nexus-one-experience/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using a Nexus One for about the last month on Fido&#8217;s network. Overall it&#8217;s a good phone and quite a step up from my previous, semi-indestructible, smart-phone; I say &#8220;semi&#8221; as, though the Nokia E62 handled being dropped numerous times onto pavement, torrential Toronto rain eventually did it in.</p>
<p>Nexus One is the AndroidOS phone that Google sold themselves up until last month, though they&#8217;re now looking to sell it through carriers over here as they&#8217;ve already started with mobile companies in the U.K. and points east.  I haven&#8217;t had any real problems running on Fido, so based on my experience, putting it officially on Rogers/Fido would be a natural move &#8211; plus it&#8217;s a higher-spec. phone than Telus&#8217; current Android models.</p>
<p><strong>Setting up on Fido</strong><br />
While the Nexus runs just fine as a phone on Fido as soon as you pop in the SIM card, it&#8217;s not a Rogers/Fido phone so you have to set some things up yourself. For getting G3-speed data running, Brill Bappin has a great page at: <a title="http://brill.pappin.ca/2010/03/getting-nexus-one-working-on-fido.html" href="http://brill.pappin.ca/2010/03/getting-nexus-one-working-on-fido.html" target="_blank">brill.pappin.ca</a> on getting the Nexus working on Fido.</p>
<p><strong>Impressions</strong><br />
Overall,  the interface is not as polished as the iPhone, but it&#8217;s definitely got more stuff in it. A case in point is WiFi; I use the free WiFi that Second Cups offers with BoldStreet networks, the problem I kept getting though with my iPod Touch was it seemed to get them confused when visiting several different Second Cups over a week.  This wasn&#8217;t a problem with Android, in the odd time it got confused, I just hit the &#8220;forget&#8221; button under the connection to make it forget the old connection. On the iPhone my best guess is the Forget must be buried somewhere under the settings. On the downside, a  lot of websites that seem to be only checking for iPhone and sending up the regular web page.</p>
<p>The camera shoots photos/video quite well  during daylight. It has a auto-focus and a LED-flash, but that still  doesn&#8217;t do much for night photography. One interesting thing is that it  records location using the phones build-in location sensors. Using WiFi  and the camera will eat up battery life and I find it needs to be  charged about every other day with normal usage, though you could  probably extend this by turning off WiFi/Bluetooth and background  data-sync &#8211; all easily done from settings.</p>
<p>Software-wise, you can  download apps right onto your phone &#8211; in fact, this is one of the  things you get used to: not having to plug your phone into a computer to  update files. Both Twitter, Facebook and FourSquare have free apps now.</p>
<p>Finally,  one problem I had early on was with the on-screen keyboard going wonky.  Google recommends: 1) make sure you&#8217;re not touching more than one place  (including your sleeves), 2) turn off Nexus completely (hold down power switch, select Turn Off).﻿</p>
]]></content:encoded>
			<wfw:commentRss>http://zee4.com/2010/05/nexus-one-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple: Back to 1984</title>
		<link>http://zee4.com/2010/04/apple-back-to-1984/</link>
		<comments>http://zee4.com/2010/04/apple-back-to-1984/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 17:28:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[commentary]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://zee4.com/?p=142</guid>
		<description><![CDATA[It&#8217;s been widely reported that last week Apple made some changes to what tools developers can use to create applications for the iPhone and iPad. Blogger John Gruber also did a pretty solid analysis of why Apple did this: namely &#8230; <a href="http://zee4.com/2010/04/apple-back-to-1984/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been <a id="ltkw" title="widely reported" href="http://news.bbc.co.uk/2/hi/technology/8616274.stm" target="_blank">widely reported</a> that last week  Apple made some changes to what tools developers can use to create  applications for the iPhone and iPad. Blogger John Gruber also did a <a id="jwop" title="pretty solid analysis of why Apple did this" href="http://daringfireball.net/2010/04/why_apple_changed_section_331" target="_blank">pretty  solid analysis of why Apple did this</a>: namely to keep developers  developing applications that run primarily on the iPhone. I agree in the  short-term this makes sense for them, but it seems like they&#8217;re  forgetting some lessons.</p>
<p>What Apple is fighting is the  commodification of a type of product, namely mobile phones and soon web  tablets. This happened before to them: in the mid-1980s the Macintosh  was quite innovative in terms of a user-friendliness, compared to the  many of the personal computers available at the time. By the mid-1990s  this had changed: Microsoft had created a &#8220;good enough&#8221; copy of the Mac  experience with Windows and prices on hardware had fallen so that  Apple&#8217;s products where quite expensive by comparison. The Mac continued  to be popular in some circles, but had essentually became the Porsche  that people bought calendars of before buying a Honda.</p>
<p>While the  Porsche example is not perfect &#8212; people buy a high-end sports car for  different reasons than they choose a phone &#8212; the challenges are not.  Like Porsche, Apple has to protect its brand by demonstrating that there  is a reason you are spending several hundred dollars on a phone. One of  the ways it can do this by having lots of applications that are unique  to the iPhone. One way to do this is make sure developers invest the  time and money creating an iPhone application, and not spend that on  writing for competing phones. The contract changes made last week which  seem to be primarily aimed at Adobe&#8217;s Flash software are designed to ban  technologies that would make it easier for developers to write  applications that would run on several platforms, essentially making the  iPhone&#8217;s offerings less unique. While I don&#8217;t anybody is going to be  throwing their iPad into Boston harbour over this, it&#8217;s not going to  help Apple&#8217;s image with developers any more than the ongoing issues with  the less-than-transparent App Store approval process is doing.  Short-term the effect is pretty nil, medium-term though it&#8217;s going to  make the alternatives more attractive.</p>
<p>While the iPhone had  become ubiquitous and in 2010 arguably still provides the best user  experience of any smart-phone, its probably only a matter of time before  someone, maybe Google, maybe RIM, maybe even Nokia come up with  something good enough. Apple lost the PC market because it tried to be  Porsche; Apple risks this happening again, but this time it&#8217;s not going  to take 15 years.</p>
]]></content:encoded>
			<wfw:commentRss>http://zee4.com/2010/04/apple-back-to-1984/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>February 2010 Update</title>
		<link>http://zee4.com/2010/03/february-2010-update/</link>
		<comments>http://zee4.com/2010/03/february-2010-update/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 16:13:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zee4.com/?p=140</guid>
		<description><![CDATA[Launched VancouverGym.ca, like Toronto-Gym.ca, it is a directory of gyms, fitness centres and health-food stores in the Vancouver/Lower Mainland area.]]></description>
			<content:encoded><![CDATA[<p>Launched <a href="http://VancouverGym.ca " target="_blank">VancouverGym.ca</a>, like <a href="http://Toronto-Gym.ca" target="_blank">Toronto-Gym.ca</a>, it is a directory of gyms, fitness centres and health-food stores in the Vancouver/Lower Mainland area.</p>
]]></content:encoded>
			<wfw:commentRss>http://zee4.com/2010/03/february-2010-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why no Buzz for Google&#8217;s Twitter</title>
		<link>http://zee4.com/2010/02/why-no-buzz-for-googles-twitter/</link>
		<comments>http://zee4.com/2010/02/why-no-buzz-for-googles-twitter/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 02:13:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[commentary]]></category>
		<category><![CDATA[buzz]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://zee4.com/?p=135</guid>
		<description><![CDATA[Google launched Buzz last week to generally better press than Apple received seems to have received for it's iPad, though I wonder if there are some similarities. While Buzz offers more features, it might turn out to be less fun. <a href="http://zee4.com/2010/02/why-no-buzz-for-googles-twitter/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Google launched Buzz last week to generally better press than Apple received seems to have received for it&#8217;s iPad, though I wonder if there are some similarities. For one thing, both of these are kind of re-imagines of already successful products. The iPad is basically the iPhone on a grander scale; if you watch Apple&#8217;s videos it&#8217;s clear they are thinking, &#8220;This is what we did with the iPhone- but what if we had a bigger screen?&#8221; Google&#8217;s Buzz of course is kind of reminiscent of Google Wave which was promoted famously as &#8220;What if we where inventing email today?&#8221; Buzz might well be asking &#8220;What if we invented Twitter today?&#8221;</p>
<p>There&#8217;s plenty of ways that kind of thinking can go right or wrong, but I&#8217;m wondering if what made Twitter what it is today was that it was kind of retro to begin with- and that&#8217;s what makes it fun. I&#8217;ve tried to explain Twitter to people for about 2 years now. The 140-character limit is kind of arbitrary- <a href="http://latimesblogs.latimes.com/technology/2009/05/invented-text-messaging.html" target="_blank">text messages can be up to 160 characters</a> and  computers-type limits would be multiples of 8, resulting in numbers like  128 or 256 characters.  So yes, it&#8217;s a bit of a toy, but it&#8217;s limitations are what make it a challenge, you can&#8217;t be sloppy with Twitter, it takes a bit of thinking to pack much  meaning into 140 characters &#8211;spaces and punctuation included&#8211; and that in turn that appeals to <a href="http://browseinside.harpercollins.com/index.aspx?isbn13=9780061897276" target="_blank">certain people</a>.</p>
<p>Google Buzz does away with that limit of course.  While  Buzz of course has no limits on text, it lets you add photos, links, probably video too. It&#8217;s certainly probably more practical, but it might not turn out to be as much fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://zee4.com/2010/02/why-no-buzz-for-googles-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>January 2010 update</title>
		<link>http://zee4.com/2010/02/january-2010-update/</link>
		<comments>http://zee4.com/2010/02/january-2010-update/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 05:58:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zee4.com/?p=133</guid>
		<description><![CDATA[This January we launched a updated version of the Leaside Business Park website. The new website streamlines the site navigation as well as a general clean-up of the site and the code behind it.]]></description>
			<content:encoded><![CDATA[<p>This January we launched a updated version of the <a href="http://leasidebusinesspark.com" target="_blank">Leaside Business Park</a> website. The new website streamlines the site navigation as well as a general clean-up of the site and the code behind it.</p>
]]></content:encoded>
			<wfw:commentRss>http://zee4.com/2010/02/january-2010-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP database config quick-tip</title>
		<link>http://zee4.com/2010/01/cakephp-database-config-quick-tip/</link>
		<comments>http://zee4.com/2010/01/cakephp-database-config-quick-tip/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 16:53:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://zee4.com/?p=121</guid>
		<description><![CDATA[Most CakePHP programmers have seen this simple way of storing the development and production database settings in one file: class DATABASE_CONFIG &#123; &#160; &#160; var $prod = array&#40; &#160; &#160; &#160; &#160; &#8230; &#160; &#160; &#160; &#160; &#39;database&#39; =&#62; &#39;live_mysite&#39; &#8230; <a href="http://zee4.com/2010/01/cakephp-database-config-quick-tip/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Most CakePHP programmers have seen this simple way of storing the development and production database settings in one file:</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">class</span> DATABASE_CONFIG <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">var</span> <span class="re1">$prod</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">&#8230;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;database&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;live_mysite&#39;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">var</span> <span class="re1">$test</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="sy0">&#8230;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#39;database&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;local_mysite&#39;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="co1">// the construct function is called automatically, and chooses prod or dev.</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">function</span> __construct<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//check to see if server name is set (thanks Frank)</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="kw3">isset</span><span class="br0">&#40;</span><span class="re1">$_SERVER</span><span class="br0">&#91;</span><span class="st0">&#39;SERVER_NAME&#39;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">switch</span><span class="br0">&#40;</span><span class="re1">$_SERVER</span><span class="br0">&#91;</span><span class="st0">&#39;SERVER_NAME&#39;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">&#39;127.0.0.1&#39;</span><span class="sy0">:</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">default</span> <span class="sy0">=</span> <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">test</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">default</span><span class="sy0">:</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">default</span> <span class="sy0">=</span> <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">prod</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span> <span class="co1">// we are likely baking, use our local db</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">default</span> <span class="sy0">=</span> <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">test</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>If you haven&#8217;t, check out <a href="http://edwardawebb.com/programming/php-programming/cakephp/automatically-choose-database-connections-cakephp">Edward A. Webb&#8217;s original post from <del datetime="2010-01-11T20:45:57+00:00">1998</del> 2008</a>.</p>
<p>This same technique can be used in the bootstrap.php file for other settings that change based on the server, for instance GoogleMap keys:</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span> <span class="kw3">strpos</span><span class="br0">&#40;</span> <span class="re1">$_SERVER</span><span class="br0">&#91;</span><span class="st0">&#39;HTTP_HOST&#39;</span><span class="br0">&#93;</span><span class="sy0">,</span><span class="st0">&#39;MySite.com&#39;</span><span class="br0">&#41;</span> <span class="sy0">!==</span> <span class="kw2">false</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; Configure<span class="sy0">::</span><span class="me2">write</span><span class="br0">&#40;</span><span class="st0">&#39;GMAP_KEY&#39;</span><span class="sy0">,</span> <span class="st0">&#39;ABQIAA&#8230;qcPrtZgKHQ&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">else</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; Configure<span class="sy0">::</span><span class="me2">write</span><span class="br0">&#40;</span><span class="st0">&#39;GMAP_KEY&#39;</span><span class="sy0">,</span> <span class="st0">&#39;ABQIAB&#8230;e6qfWeeY8Q&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>However, when baking a model, the database file only defines two types: <strong>prog</strong> and <strong>test</strong> so you pick one and end up with a model file with a line like: </p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> <span class="re1">$useDbConfig</span> <span class="sy0">=</span> <span class="st0">&#39;test&#39;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>in your baked model that doesn&#8217;t cause any problems right up until upload it to your live server late one night and start getting errors about being unable to make a connection- guess who did that?</p>
<p>The solution is simple: just define a default</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> <span class="re1">$default</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>somewhere in the file, now when you bake cake will give you the option of using the default connection which won&#8217;t add any problem-causing $useDbConfig to your model. </p>
<p>Hope this saves someone 20 minutes <img src='http://zee4.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://zee4.com/2010/01/cakephp-database-config-quick-tip/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>December &#8217;09 Wrap-Up</title>
		<link>http://zee4.com/2010/01/december-09-wrap-up/</link>
		<comments>http://zee4.com/2010/01/december-09-wrap-up/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 16:40:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zee4.com/?p=116</guid>
		<description><![CDATA[This past December we launched 2 new websites serving the Toronto area and a re-launch of an older website. Toronto-Gym.ca Launched on December 27th, Toronto-Gym.ca is a directory of gyms, fitness centres and sports and health stores in Toronto and &#8230; <a href="http://zee4.com/2010/01/december-09-wrap-up/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This past December we launched 2 new websites serving the Toronto area and a re-launch of an older website.</p>
<p><a href="http://Toronto-Gym.ca" target="_blank">Toronto-Gym.ca</a><br />
Launched on December 27th, Toronto-Gym.ca is a directory of gyms, fitness centres and sports and health stores in Toronto and the GTA. A Vancouver version of this site is expected to be launched in early 2010.</p>
<p><a href="http://TorontoIndustryNetwork.com" target="_blank">TorontoIndustryNetwork.com</a><br />
Toronto Industry Network is a group of manufacturers and manufacturing associations with operations in the City of Toronto. Collectively the Network employees approximately 35,000 people directly and another 100,000 indirectly through suppliers and customers.</p>
<p><a href="http://halifax-restaurants.com" target="_blank">Halifax-Restaurants.com</a><br />
Halifax-Restaurants.com was re-launched after about a year-long break. This is a sister site to SimcoeDining.com that will be covering more places to eat in Halifax, Nova Scotia in the coming months.</p>
]]></content:encoded>
			<wfw:commentRss>http://zee4.com/2010/01/december-09-wrap-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding robots meta-tag to a CakePHP view</title>
		<link>http://zee4.com/2009/11/adding-robots-meta-tag-to-cakephp-view/</link>
		<comments>http://zee4.com/2009/11/adding-robots-meta-tag-to-cakephp-view/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 19:51:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[simcoedining]]></category>

		<guid isPermaLink="false">http://zee4.com/2009/11/adding-robots-meta-tag-to-cakephp-view/</guid>
		<description><![CDATA[Here&#8217;s a little how-to I discovered a few months ago while I was working on SimcoeDining.com and realized that Google was indexing a whole lot of mostly blank pages. To solve this, I figured I&#8217;d better put a no-index on &#8230; <a href="http://zee4.com/2009/11/adding-robots-meta-tag-to-cakephp-view/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little how-to I discovered a few months ago while I was working on SimcoeDining.com and realized that Google was indexing a whole lot of mostly blank pages.</p>
<p>To solve this, I figured I&#8217;d better put a no-index on those pages fast; after mucking around with CakePHP&#8217;s html->meta handler (because I wanted the meta tag in the header where it belonged) and not finding anything, I came up with:</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="re1">$html</span><span class="sy0">-&gt;</span><span class="me1">meta</span><span class="br0">&#40;</span><span class="st0">&#39;robots&#39;</span><span class="sy0">,</span> <span class="kw2">null</span><span class="sy0">,</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="st0">&#39;name&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;robots&#39;</span><span class="sy0">,</span> <span class="st0">&#39;content&#39;</span> <span class="sy0">=&gt;</span> <span class="st0">&#39;noindex&#39;</span><span class="br0">&#41;</span> <span class="sy0">,</span><span class="kw2">false</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>BTW: The pages where empty at the time because there wasn&#8217;t a lot of data in the system, so a lot of searches where coming up empty- that&#8217;s been &#8220;fixed&#8221; now too.</p>
<p>Hopefully this saves someone else 20 minutes <img src='http://zee4.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://zee4.com/2009/11/adding-robots-meta-tag-to-cakephp-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

