<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><!-- generator="wordpress/2.3.1" --><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Cake Notes</title>
	<link>http://www.cakenotes.com</link>
	<description>Observations from a self-confessed CakePHP newb</description>
	<pubDate>Fri, 21 Dec 2007 16:15:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/CakeNotes" type="application/rss+xml" /><feedburner:emailServiceId>1497387</feedburner:emailServiceId><feedburner:feedburnerHostname>http://www.feedburner.com</feedburner:feedburnerHostname><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Deploying my CakePHP application: blank page scare</title>
		<link>http://www.cakenotes.com/deploying-my-cakephp-application-blank-page-scare/</link>
		<comments>http://www.cakenotes.com/deploying-my-cakephp-application-blank-page-scare/#comments</comments>
		<pubDate>Fri, 21 Dec 2007 16:15:25 +0000</pubDate>
		<dc:creator>sarah</dc:creator>
		
		<category><![CDATA[CakePHP 1.2]]></category>

		<category><![CDATA[Deployment]]></category>

		<category><![CDATA[Errors]]></category>

		<category><![CDATA[blank page]]></category>

		<category><![CDATA[empty page]]></category>

		<category><![CDATA[installation]]></category>

	<!-- AutoMeta Start -->
	<category>checkbox</category>
	<category>my</category>
	<category>to do</category>
	<category>list</category>
	<category>my</category>
	<category>development</category>
	<category>machine</category>
	<category>polished</category>
	<category>and</category>
	<category>well behaved</category>
	<category>pretty</category>
	<category>self satisfied</category>
	<category>my</category>
	<category>cakephp</category>
	<category>app</category>
	<category>a</category>
	<category>neat</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.cakenotes.com/deploying-my-cakephp-application-blank-page-scare/</guid>
		<description><![CDATA[Yesterday I was pretty self-satisfied when I got my CakePHP app all polished and well-behaved on my development machine. I just had a neat little checkbox on my to-do list left to go: &#8220;Install app on server&#8221;. I figured that the happy standard PHP and MySQL combo would mean an easy deployment with only a [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I was pretty self-satisfied when I got my CakePHP app all polished and well-behaved on my development machine. I just had a neat little checkbox on my to-do list left to go: &#8220;Install app on server&#8221;. I figured that the happy standard PHP and MySQL combo would mean an easy deployment with only a couple of config changes.</p>
<p>One of these days I&#8217;m going to transform from an optimistic idealist to a full-on cynic.</p>
<p>I got everything uploaded, database migrated, connection settings changed, and went to the index page. Or rather, where the index page <em>should</em> have been. Instead, there was a blank page.</p>
<p>I tested some other pages. Nothing. I went to my error log. Nothing. I messed with some .htaccess files. Nothing. I googled. Nothing. I was beginning to get a little worried because I had no idea what was wrong and had committed to getting this thing visible for testing before the day was out.</p>
<p>And then, finally, I found a conversation in the CakePHP Google Group entitled &#8220;<a href="http://groups.google.com/group/cake-php/browse_thread/thread/889295952424caf9/245af39a60260f4c?#245af39a60260f4c" title="Tips when you get a blank or empty page with CakePHP">Empty page response</a>.&#8221; That sounded promising. Sure enough, some other poor souls had encountered the same issue, and several more-experienced bakers had thrown out some potential fixes.</p>
<p>I went through each fix (with the exception of the server changes, since I&#8217;m on shared hosting and don&#8217;t have access) and was even more concerned when even the fixes that had solved the problem for others failed to give me anything.</p>
<p>I finally got to the last suggestion (deleting a cached file) feeling slightly hopeless. Imagine my surprise (and delight!) when I deleted one little file and everything suddenly started working!</p>
<p>I didn&#8217;t have the time or interest to try each of the fixes independently, so it may have been the cumulative effect of several of them, or it may have been just the last one. If this happens again, I&#8217;ll apply the fixes in reverse order. <img src='http://www.cakenotes.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
<p class="akst_link"><a href="http://www.cakenotes.com/?p=8&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_8" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.cakenotes.com/deploying-my-cakephp-application-blank-page-scare/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Saving date and datetime fields to the database</title>
		<link>http://www.cakenotes.com/saving-date-and-datetime-fields-to-the-database/</link>
		<comments>http://www.cakenotes.com/saving-date-and-datetime-fields-to-the-database/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 23:37:17 +0000</pubDate>
		<dc:creator>sarah</dc:creator>
		
		<category><![CDATA[CakePHP 1.1]]></category>

		<category><![CDATA[CakePHP 1.2]]></category>

		<category><![CDATA[Form]]></category>

		<category><![CDATA[Helpers]]></category>

	<!-- AutoMeta Start -->
	<category>manual cakephp org chapter helpers</category>
	<category>title</category>
	<category>job  amp</category>
	<category>save  this  amp</category>
	<category>tempdocs cakephp org  toc144520</category>
	<category>title</category>
	<category>intval  this  amp</category>
	<category>data</category>
	<category>cakebaker 42dh com 2006 01 19 beforesave example</category>
	<category>title</category>
	<category>www donutczar com cake1point2 donuts form_helper</category>
	<category>title</category>
	<category>code gt</category>
	<category>this  amp</category>
	<category>code gt</category>
	<category />
	<category />
	<category />
	<category />
	<category>this  amp</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.cakenotes.com/saving-date-and-datetime-fields-to-the-database/</guid>
		<description><![CDATA[I&#8217;ve been using CakePHP 1.2&#8217;s Form Helper on a trial project, and I&#8217;ve generally been very pleased with how easy it makes the whole process. I don&#8217;t have to worry much about what kind of data I&#8217;m collecting or deal with the mechanics of saving; it just works.
Well, mostly. I found some helpful examples of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://tempdocs.cakephp.org/#TOC144520" title="CakePHP 1.2 temporary documentation on Form Helper">CakePHP 1.2&#8217;s Form Helper</a> on a trial project, and I&#8217;ve generally been very pleased with how easy it makes the whole process. I don&#8217;t have to worry much about what kind of data I&#8217;m collecting or deal with the mechanics of saving; it just works.</p>
<p>Well, mostly. I found <a href="http://www.donutczar.com/cake1point2/donuts/form_helper" title="Form Helper examples">some helpful examples of Form Helper usage</a>, but kept getting stuck on one field, in my case called &#8220;expiration&#8221;, which was a date field in MySQL.</p>
<p>The Form Helper did a great job of automatically outputting some select boxes to let users put in the date, but the date was not saved. A Google search was surprisingly unhelpful, but fortunately, I did eventually figure out how to do it from two sources.</p>
<p>The first was from the <a href="http://manual.cakephp.org/chapter/helpers" title="CakePHP 1.1 manual on Helpers">CakePHP 1.1 manual</a> (but it&#8217;s still relevant in this case); search for &#8220;Concatenating time data before saving a model&#8221;. That&#8217;s basically the method I&#8217;ve gone with at this point:</p>
<blockquote><p><code>	$this-&gt;data['Job']['expiration'] = date('Y-m-d', mktime(<br />
0,<br />
0,<br />
null,<br />
intval($this-&gt;data['Job']['expiration_month']),<br />
intval($this-&gt;data['Job']['expiration_day']),<br />
intval($this-&gt;data['Job']['expiration_year'])));</code></p>
<p><code>if ($this-&gt;Job-&gt;save($this-&gt;data))</code><br />
<code> {</code><br />
<code>    $this-&gt;Session-&gt;setFlash('Your job has been saved.');</code><br />
<code>    $this-&gt;redirect('/users/index');</code><br />
<code> }</code></p></blockquote>
<p>The second was <a href="http://cakebaker.42dh.com/2006/01/19/beforesave-example/" title="beforeSave() example">a post on cakebaker about beforeSave()</a>. This looks like a more elegant way of doing it, but I&#8217;m not sure if it requires a core change (it did when he wrote it but it&#8217;s been a while). In this case, what I have now works, so I&#8217;m not going to mess with it, but I&#8217;m particularly posting this so that I remember this method in the future.</p>
<p class="akst_link"><a href="http://www.cakenotes.com/?p=7&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_7" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.cakenotes.com/saving-date-and-datetime-fields-to-the-database/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
