<?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>i.justrealized &#187; cakephp</title> <atom:link href="http://i.justrealized.com/tag/cakephp/feed/" rel="self" type="application/rss+xml" /><link>http://i.justrealized.com</link> <description>All things observable</description> <lastBuildDate>Tue, 31 Aug 2010 23:22:10 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Addons.Mozilla.org to move from CakePHP to Django</title><link>http://i.justrealized.com/2009/11/18/addons-mozilla-org-to-move-from-cakephp-to-django/</link> <comments>http://i.justrealized.com/2009/11/18/addons-mozilla-org-to-move-from-cakephp-to-django/#comments</comments> <pubDate>Wed, 18 Nov 2009 11:45:06 +0000</pubDate> <dc:creator>KahWee</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[cakephp]]></category> <category><![CDATA[django]]></category> <category><![CDATA[firefox]]></category> <category><![CDATA[migration]]></category> <category><![CDATA[mozilla]]></category><guid
isPermaLink="false">http://i.justrealized.com/?p=2683</guid> <description><![CDATA[Addons.Mozilla.org is currently using CakePHP but they will no longer in 2010. They decided to adopt Django. (Source: Micropipes.com)]]></description> <content:encoded><![CDATA[<p><a
href="https://addons.mozilla.org/en-US/firefox/">Addons.Mozilla.org</a> is currently using CakePHP but they will no longer in 2010. They decided to adopt Django. (Source: <a
href="http://micropipes.com/blog/2009/11/17/amo-development-changes-in-2010/">Micropipes.com</a>)</p> ]]></content:encoded> <wfw:commentRss>http://i.justrealized.com/2009/11/18/addons-mozilla-org-to-move-from-cakephp-to-django/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Review: CakePHP Application Development</title><link>http://i.justrealized.com/2009/11/05/review-cakephp-application-development/</link> <comments>http://i.justrealized.com/2009/11/05/review-cakephp-application-development/#comments</comments> <pubDate>Thu, 05 Nov 2009 14:33:23 +0000</pubDate> <dc:creator>KahWee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[book]]></category> <category><![CDATA[cakephp]]></category> <category><![CDATA[packt]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[review]]></category><guid
isPermaLink="false">http://i.justrealized.com/?p=2634</guid> <description><![CDATA[I have done a few projects using CakePHP the past couple of years. CakePHP has grown to become one of the more popular PHP web frameworks, think of CakePHP as Rails-inspired PHP framework. If you&#8217;re interested in CakePHP, you may like to check out CakePHP Application Development by Packt Publishing. This book covers lots of [...]]]></description> <content:encoded><![CDATA[<p>I have done a few projects using CakePHP the past couple of years. CakePHP has grown to become one of the more popular PHP web frameworks, think of CakePHP as Rails-inspired PHP framework.</p><p><a
href="http://www.packtpub.com/cakephp-application-development/mid/140909kh9a9w?utm_source=i.justrealized.com&amp;utm_medium=bookrev&amp;utm_content=blog&amp;utm_campaign=mdb_00058"><img
class="size-full wp-image-2636 alignleft" title="CakePHP Application Development" style="margin-right: 20px" src="http://justrealized.s3.amazonaws.com/media/2009/11/CakePHP-Application-Development.jpg" alt="CakePHP Application Development" width="300" height="370" /></a></p><p>If you&#8217;re interested in CakePHP, you may like to check out CakePHP Application Development by Packt Publishing. This book covers lots of beginner topics such as installation and configuration. It is a good book to get started on CakePHP, it has a step-by-step guide that can be useful for starters. The book targets CakePHP 1.2 however, the book is written before CakePHP 1.2 is released so it does not have updated screenshots in it.</p><p>Generally the book&#8217;s concept is correct. The explanations are written as if someone is talking to you. If you do not like that style of learning, best you avoid this title. CakePHP Application Development covers a creation of a sample app &#8212; Quickwall &#8212; at the end of the book. Unlike typical tutorials that teaches you how to create a blog with XX framework, this goes into more depth on how best to use the inbuilt features of CakePHP.</p><p>My major grip on this book is its numerous errors in code, and a couple of quite unforgiving ones too. The books could have been better edited. Some of the codes did not appear to run and you have to look around to check for syntax errors. It isn&#8217;t often, still it&#8217;s a bad impression. The codes in the book are badly indented too. This makes the codes hard to read. It&#8217;s a good book to learn, but can be better.</p><p>Find out more about <a
href="http://www.packtpub.com/cakephp-application-development/mid/140909kh9a9w?utm_source=i.justrealized.com&amp;utm_medium=bookrev&amp;utm_content=blog&amp;utm_campaign=mdb_000586">CakePHP Application Development here</a>, you can also have a look at the book&#8217;s <a
href="http://www.packtpub.com/article/cakephp-application-development-table-of-contents">Table of Contents here</a>.</p> ]]></content:encoded> <wfw:commentRss>http://i.justrealized.com/2009/11/05/review-cakephp-application-development/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>What I&#8217;ve been up to lately</title><link>http://i.justrealized.com/2009/08/17/what-ive-been-up-to-lately/</link> <comments>http://i.justrealized.com/2009/08/17/what-ive-been-up-to-lately/#comments</comments> <pubDate>Mon, 17 Aug 2009 14:09:58 +0000</pubDate> <dc:creator>KahWee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[cakephp]]></category> <category><![CDATA[iis]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[mac os]]></category> <category><![CDATA[macbook pro]]></category> <category><![CDATA[microsoft]]></category> <category><![CDATA[php]]></category> <category><![CDATA[sql server]]></category><guid
isPermaLink="false">http://i.justrealized.com/?p=2352</guid> <description><![CDATA[I&#8217;ve been busy this couple of weeks hence the lack of updates. I have been working mainly on my tool of choice &#8212; CakePHP. I mainly do my work on OS X for PHP. Recently I got involved in working for some software that requires Microsoft SQL Server, PHP and IIS. The whole shift towards [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been busy this couple of weeks hence the lack of updates. I have been working mainly on my tool of choice &#8212; CakePHP. I mainly do my work on OS X for PHP. Recently I got involved in working for some software that requires Microsoft SQL Server, PHP and IIS. The whole shift towards the other side slowed me down a lot. I found myself being confused over the tiniest thing like where&#8217;s my host file. Where&#8217;s the php.ini? How to configure this and that. The terms are seemingly different and watching IIS crash again and again due to me incorrect configurations frustrates me.</p><p>On the brighter note, when I working in Windows I actually realized how much I missed Windows Explorer. It&#8217;s probably the single most useful utility I miss when I switch to a MacBook.</p> ]]></content:encoded> <wfw:commentRss>http://i.justrealized.com/2009/08/17/what-ive-been-up-to-lately/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>CakePHP 1.2 and PHP 5.3 doesn&#8217;t play nice</title><link>http://i.justrealized.com/2009/08/16/cakephp-php-deprecated-error-warning/</link> <comments>http://i.justrealized.com/2009/08/16/cakephp-php-deprecated-error-warning/#comments</comments> <pubDate>Sat, 15 Aug 2009 18:50:43 +0000</pubDate> <dc:creator>KahWee</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[cakephp]]></category> <category><![CDATA[deprecation]]></category> <category><![CDATA[error]]></category> <category><![CDATA[error message]]></category> <category><![CDATA[php]]></category> <category><![CDATA[upgrade]]></category><guid
isPermaLink="false">http://i.justrealized.com/?p=2335</guid> <description><![CDATA[I just upgraded all the software only to discover PHP got upgraded to 5.3. That&#8217;s fast, PHP 5.3 isn&#8217;t out too long ago and it&#8217;s in the Macosforge repository. Even the CakePHP 1.2.4.8284 update released on August 9 did not include PHP 5.3 compatibility. Perhaps it&#8217;s time to update the CakePHP requirements and be indicative [...]]]></description> <content:encoded><![CDATA[<p>I just upgraded all the software only to discover PHP got upgraded to 5.3. That&#8217;s fast, PHP 5.3 isn&#8217;t out too long ago and it&#8217;s in the <a
href="http://www.macosforge.org/">Macosforge repository</a>. Even the CakePHP 1.2.4.8284 update released on August 9 did not include PHP 5.3 compatibility.</p><p>Perhaps it&#8217;s time to update the <a
href="http://book.cakephp.org/view/28/Requirements">CakePHP requirements</a> and be indicative of the lack of support for PHP 5.3.</p><p>Now the library is throwing deprecated notices all around &#8220;Assigning the return value of new by reference is deprecated in&#8230;&#8221;. Also there is a PHP warning:</p><div
class="codesnip-container" ><div
class="php codesnip" style="font-family:monospace;">PHP Warning<span
class="sy0">:</span> &nbsp;<a
href="http://www.php.net/strtotime"><span
class="kw3">strtotime</span></a><span
class="br0">&#40;</span><span
class="br0">&#41;</span><span
class="sy0">:</span> It is not safe to rely on the <a
href="http://www.php.net/system"><span
class="kw3">system</span></a><span
class="st_h">&#8216;s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected &#8216;</span>Asia<span
class="sy0">/</span>Singapore<span
class="st_h">&#8216; for &#8216;</span>SGT<span
class="sy0">/</span><span
class="nu19">8.0</span><span
class="sy0">/</span>no DST<span
class="st_h">&#8216; instead in&#8230;</span></div></div><p>To stop the deprecated notices, I had to modify Cake&#8217;s core, not something I like to do.</p><p>I added the line &#8220;error_reporting (E_ALL &#038; ~E_DEPRECATED);&#8221; at the top of /cake/libs/object.php. I also updated /cake/libs/configure.php by changing &#8220;error_reporting(E_ALL);&#8221; to &#8220;error_reporting (E_ALL &#038; ~E_DEPRECATED);&#8221;.</p><p><script type="text/javascript">google_ad_client = "pub-1497720434432681";
google_ad_slot = "6711626597";
google_ad_width = 468;
google_ad_height = 60;</script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </p><p>This doesn&#8217;t solve the problem exactly, it just suppresses the deprecation notices so I can continue working. For a PHP 5.3 compatible CakePHP, you&#8217;ll need to use CakePHP 1.3 which currently isn&#8217;t stable. I&#8217;ll definitely be trying it soon but in the meantime I&#8217;ll just have to suppress error reporting.</p><p>Update: <a
href="http://i.justrealized.com/2009/08/16/cakephp-php-deprecated-error-warning/comment-page-1/#comment-737">jdbartlett commented </a>on a better way:</p><div
class="codesnip-container" ><div
class="php codesnip" style="font-family:monospace;"><span
class="kw1">if</span> <span
class="br0">&#40;</span><a
href="http://www.php.net/defined"><span
class="kw3">defined</span></a><span
class="br0">&#40;</span><span
class="st0">&quot;E_DEPRECATED&quot;</span><span
class="br0">&#41;</span><span
class="br0">&#41;</span> <a
href="http://www.php.net/error_reporting"><span
class="kw3">error_reporting</span></a><span
class="br0">&#40;</span><span
class="kw4">E_ALL</span> ^ E_DEPRECATED<span
class="br0">&#41;</span><span
class="sy0">;</span></div></div><blockquote><p>If you’re not doing any debugging, you can add the above code to the top of /app/webroot/index.php and suppress the error messages without editing the core. <img
src='http://justrealized.s3.amazonaws.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p></blockquote><p>Thanks <a
href="http://jdbartlett.com">jdbartlett</a>! You saved me time. <img
src='http://justrealized.s3.amazonaws.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://i.justrealized.com/2009/08/16/cakephp-php-deprecated-error-warning/feed/</wfw:commentRss> <slash:comments>17</slash:comments> </item> <item><title>NetBeans IDE 6.7 Milestone 3 released</title><link>http://i.justrealized.com/2009/04/06/netbeans-ide-67-milestone-3-released/</link> <comments>http://i.justrealized.com/2009/04/06/netbeans-ide-67-milestone-3-released/#comments</comments> <pubDate>Mon, 06 Apr 2009 10:06:49 +0000</pubDate> <dc:creator>KahWee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[cakephp]]></category> <category><![CDATA[ide]]></category> <category><![CDATA[netbeans]]></category><guid
isPermaLink="false">http://i.justrealized.com/?p=1973</guid> <description><![CDATA[NetBeans IDE 6.7 Milestone 3 is released. I have been using this for a few days. I haven&#8217;t noticed much difference actually. I use it for PHP. I still wish for more support on CakePHP. The NetBeans team is pleased to announce the availability of NetBeans IDE 6.7 Milestone 3 (M3). Highlights of the release [...]]]></description> <content:encoded><![CDATA[<p>NetBeans IDE 6.7 Milestone 3 is released. I have been using this for a few days. I haven&#8217;t noticed much difference actually. I use it for PHP. I still wish for more support on CakePHP.</p><blockquote><h3>The NetBeans team is pleased to announce the availability of NetBeans IDE 6.7 Milestone 3 (M3).</h3><p>Highlights of the release include: </p><ul><li><a
href="http://kenai.com/">Project Kenai</a> Integration<br
/> - Create Kenai projects from within the NetBeans IDE<br
/> - Locate and open sources for Kenai projects in the IDE<br
/> - Full integration with Bugzilla</li><li>Maven<br
/> - Multi-tabbed artifact details viewer available<br
/> - Graphical view of transitive dependencies available</li><li>PHP<br
/> - Code coverage and Selenium support</li><li>Platform<br
/> - Enhancements to Output WIndow, Update Center catalog and Search performance</li><li>Profiler<br
/> - Export profiling data into CSV, HTML and XML file formats</li><li>C/C++<br
/> - Easy host setup for remote development</li><li>GlassFish Integration<br
/> - Derby support registers Derby associated with v3 Prelude instance</li><li>Integration with the Hudson Continuous Integration server</li></ul><p>Read the complete list of <a
href="http://wiki.netbeans.org/NewAndNoteWorthy">NetBeans IDE 6.7 Milestone 3 features and enhancements</a>. </p></blockquote> ]]></content:encoded> <wfw:commentRss>http://i.justrealized.com/2009/04/06/netbeans-ide-67-milestone-3-released/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>How to run XAMPP&#8217;s PHP CLI and CakePHP console</title><link>http://i.justrealized.com/2009/02/16/how-to-run-xampps-php-cli-and-cakephp-console/</link> <comments>http://i.justrealized.com/2009/02/16/how-to-run-xampps-php-cli-and-cakephp-console/#comments</comments> <pubDate>Mon, 16 Feb 2009 15:48:38 +0000</pubDate> <dc:creator>KahWee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[.net]]></category> <category><![CDATA[cakephp]]></category> <category><![CDATA[command prompt]]></category> <category><![CDATA[console]]></category> <category><![CDATA[how to]]></category> <category><![CDATA[php]]></category> <category><![CDATA[php cli]]></category> <category><![CDATA[postgresql]]></category> <category><![CDATA[tip]]></category> <category><![CDATA[windows 7]]></category> <category><![CDATA[windows vista]]></category> <category><![CDATA[xampp]]></category><guid
isPermaLink="false">http://i.justrealized.com/?p=1658</guid> <description><![CDATA[XAMPP is one of the easiest options to develop using PHP or PHP CLI. I use CakePHP for development and one of the features of CakePHP is to back the MVC. In this guide, we&#8217;ll see how to get started. This tutorial doesn&#8217;t teach you how to use CakePHP&#8217;s bake feature. This guide is specifically [...]]]></description> <content:encoded><![CDATA[<p>XAMPP is one of the easiest options to develop using PHP or PHP CLI. I use CakePHP for development and one of the features of CakePHP is to back the MVC. In this guide, we&#8217;ll see how to get started. This tutorial doesn&#8217;t teach you how to use CakePHP&#8217;s bake feature. This guide is specifically written for Windows Vista or Windows 7.</p><h3>0. Objective</h3><p>To run XAMPP&#8217;s PHP CLI, you first have to set up the environment variables for PHP CLI. Also introduce how to get started on CakePHP&#8217;s console.</p><h3>1. Setting up environment variables</h3><p><span
id="more-1658"></span></p><p>Firstly, we would need to let the command prompt know where to find php.exe. In my computer set up, it is located in &#8216;C:\xampp\php\&#8217;. Yours might be in &#8216;C:\xampp-lite\php\&#8217; depending on where you install your XAMPP.</p><p>We need to edit some system environment variables:</p><p><img
class="alignnone size-full wp-image-31" title="Editing system environment variables" src="http://justrealized.s3.amazonaws.com/media/2008/04/editing-system-environment-variables.jpg" alt="Editing system environment variables in Windows Vista." width="500" height="320" /></p><p>Click on &#8216;Edit the system environment variables&#8217;, a dialog box will pop up. Click on &#8216;Environment Variables&#8230;&#8217;, you should be greeted with the following dialog box:</p><p><img
class="alignnone size-full wp-image-32" title="Editing the path for environment variables" src="http://justrealized.s3.amazonaws.com/media/2008/04/editing-the-path-for-environment-variables.jpg" alt="Editing the path for environment variables" width="394" height="434" /></p><p>My path looks like this before I add anything:</p><div
class="codesnip-container" >%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem</div><p>Append your XAMPP PHP directory at the back of what is already there:</p><div
class="codesnip-container" >;C:\xampp\php\</div><p>Open a new command prompt (don&#8217;t use existing one), and type &#8220;php&#8221; and see if there are any problems.</p><h3>2. Avoiding MSVCR71.dll error</h3><p>I encountered an error: &#8220;php.exe &#8211; System Error: The program can&#8217;t start because MSVCR71.dll is missing from your computer. Try reinstalling the program to fix this problem.&#8221;.</p><div
id="attachment_1659" class="wp-caption alignnone" style="width: 560px"><img
src="http://justrealized.s3.amazonaws.com/media/2009/02/php-msvcr71-dll-error.png" alt="PHP MSVCR71 dll error" title="PHP MSVCR71 dll error" width="550" height="199" class="size-full wp-image-1659" /><p
class="wp-caption-text">PHP MSVCR71 dll error</p></div><p>This error is caused by the &#8220;php_pgsql.dll&#8221; extension. We can proceed by disabling <a
href="http://i.justrealized.com/tag/postgresql/">PostgreSQL</a> if we don&#8217;t use it. If you do need it, you may consider installing <a
href="http://i.justrealized.com/tag/net/">Microsoft .NET Framework 1.1</a>.</p><p>Open the file &#8216;php.ini&#8217; in &#8216;C:\xampp\php\&#8217; and search for &#8220;pgsql&#8221;. Disable the extension by placing a semicolon in the beginning of the line this way:</p><div
class="codesnip-container" ><div
class="dos codesnip" style="font-family:monospace;">;extension=php_pgsql.dll</div></div><h3>3. Command Prompt&#8217;s &#8220;Start in&#8221; setting</h3><p>You can have multiple shortcuts of command prompts in your desktop. I set my command prompt shortcut to start in &#8216;C:\xampp\htdocs\dev\app&#8217; which is my CakePHP application folder:</p><div
id="attachment_1660" class="wp-caption alignnone" style="width: 510px"><img
src="http://justrealized.s3.amazonaws.com/media/2009/02/command-prompt-properties-start-in-setting.png" alt="Command prompt properties start in setting" title="Command prompt properties start in setting" width="500" height="690" class="size-full wp-image-1660" /><p
class="wp-caption-text">Command prompt properties start in setting</p></div><p>And when I run the command prompt, it will show:</p><div
class="codesnip-container" ><div
class="dos codesnip" style="font-family:monospace;">Microsoft Windows <span
class="br0">&#91;</span>Version 6.1.7000<span
class="br0">&#93;</span><br
/> Copyright <span
class="br0">&#40;</span>c<span
class="br0">&#41;</span> <span
class="nu0">2006</span> Microsoft Corporation. &nbsp;All rights reserved.</p><p>C:\xampp\htdocs\dev\app&gt;</p></div></div><p>This is just more convenient without having to navigate through the folders again and again.</p><p><script type="text/javascript">google_ad_client = "pub-1497720434432681";
google_ad_slot = "6711626597";
google_ad_width = 468;
google_ad_height = 60;</script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </p><h3>4. Running the CakePHP console</h3><p>You should run the Cake console in your application folder this way:</p><div
class="codesnip-container" ><div
class="dos codesnip" style="font-family:monospace;">C:\xampp\htdocs\dev\app&gt;&quot;../cake/console/cake&quot; bake</div></div><p>This runs the &#8216;cake&#8217; program and tells it to bake.</p><p>For a list of CakePHP console commands to use, you can try:</p><div
class="codesnip-container" ><div
class="dos codesnip" style="font-family:monospace;">C:\xampp\htdocs\dev\app&gt;&quot;../cake/console/cake&quot; help</div></div><h3>That&#8217;s all</h3><p>You can also put the CakePHP console path in your Windows environment variables. However note that if you have multiple projects with different versions, this method is less than ideal. Hope it helps.</p> ]]></content:encoded> <wfw:commentRss>http://i.justrealized.com/2009/02/16/how-to-run-xampps-php-cli-and-cakephp-console/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Some suggestions for .gitignore</title><link>http://i.justrealized.com/2008/12/15/some-suggestions-for-gitignore/</link> <comments>http://i.justrealized.com/2008/12/15/some-suggestions-for-gitignore/#comments</comments> <pubDate>Mon, 15 Dec 2008 10:36:15 +0000</pubDate> <dc:creator>KahWee</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[cakephp]]></category> <category><![CDATA[git]]></category> <category><![CDATA[gitignore]]></category> <category><![CDATA[ignore]]></category> <category><![CDATA[mac os]]></category> <category><![CDATA[netbeans]]></category> <category><![CDATA[suggestion]]></category> <category><![CDATA[version]]></category> <category><![CDATA[windows]]></category><guid
isPermaLink="false">http://i.justrealized.com/?p=1272</guid> <description><![CDATA[This is more of a personal note. You may find it useful too. Here&#8217;s how to ignore files and folders using Git. You can create a file &#8220;.gitignore&#8221; and place in the files and folders that you wish to ignore (separated with a line break). In the file: &#8220;./.gitignore&#8221; Here&#8217;s a list of standard things [...]]]></description> <content:encoded><![CDATA[<p>This is more of a personal note. You may find it useful too.</p><p>Here&#8217;s how to ignore files and folders using Git. You can create a file &#8220;.gitignore&#8221; and place in the files and folders that you wish to ignore (separated with a line break).</p><h3>In the file: &#8220;./.gitignore&#8221;</h3><p>Here&#8217;s a list of standard things to do a .gitignore. It ignores the thumbnail files generated by Mac OSX and Windows. (I&#8217;m on Windows Vista.) You can place this on the top folder of your Git project:</p><div
class="codesnip-container" ><div
class="ini codesnip" style="font-family:monospace;">nbproject<br
/> .DS_Store<br
/> Thumbs.db<br
/> Desktop.ini</div></div><p>&#8220;nbproject&#8221; is for NetBeans.</p><h3>In the file: &#8220;./app/.gitignore&#8221;</h3><p>Well, if you use CakePHP, you may want to add an additional .gitignore file in your CakePHP app directory:</p><div
class="codesnip-container" ><div
class="ini codesnip" style="font-family:monospace;">tmp/**/*<br
/> config/database.php</div></div><p>I am open to suggestions what other files or folders are good to ignore but these are all I can recall. You can read more about <a
href="http://www.kernel.org/pub/software/scm/git/docs/gitignore.html">gitignore at kernal.org</a>.</p> ]]></content:encoded> <wfw:commentRss>http://i.justrealized.com/2008/12/15/some-suggestions-for-gitignore/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Django 1.0 alpha released</title><link>http://i.justrealized.com/2008/07/22/django-10-alpha-released/</link> <comments>http://i.justrealized.com/2008/07/22/django-10-alpha-released/#comments</comments> <pubDate>Tue, 22 Jul 2008 05:00:29 +0000</pubDate> <dc:creator>KahWee</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[alpha]]></category> <category><![CDATA[cakephp]]></category> <category><![CDATA[development]]></category> <category><![CDATA[django]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[release]]></category><guid
isPermaLink="false">http://i.justrealized.com/?p=565</guid> <description><![CDATA[Okay, Django 1.0 alpha has been released finally. I don&#8217;t have the time to test this out but I played around with some pre 1.0 alpha builds a couple of weeks back and that time the software was quite stable already. Django 1.0 alpha released! In accordance with the Django 1.0 release roadmap, tonight we&#8217;ve [...]]]></description> <content:encoded><![CDATA[<p>Okay, Django 1.0 alpha has been released finally. I don&#8217;t have the time to test this out but I played around with some pre 1.0 alpha builds a couple of weeks back and that time the software was quite stable already.</p><blockquote><h3>Django 1.0 alpha released!</h3><p>In accordance with the Django 1.0 release roadmap, tonight we&#8217;ve released the first &#8220;alpha&#8221; testing version of Django 1.0. This release includes all of the major features due for inclusion in the final Django 1.0, though some lower-priority items are still scheduled to be included before the 1.0 feature freeze, which will occur with the first beta release next month.</p><p>The next step on that path will be the first Django 1.0 beta release, currently scheduled for August 5. If you&#8217;d like to help out, please review our documentation for contributors and feel free to join in one of the development sprints scheduled for the run up to 1.0; the full schedule is available in the Django 1.0 release roadmap.</p></blockquote><p>Now when would CakePHP 1.2 be released?</p> ]]></content:encoded> <wfw:commentRss>http://i.justrealized.com/2008/07/22/django-10-alpha-released/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to load models from another CakePHP application</title><link>http://i.justrealized.com/2008/06/30/how-to-load-models-from-another-cakephp-application/</link> <comments>http://i.justrealized.com/2008/06/30/how-to-load-models-from-another-cakephp-application/#comments</comments> <pubDate>Mon, 30 Jun 2008 13:06:24 +0000</pubDate> <dc:creator>KahWee</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[cakephp]]></category> <category><![CDATA[controller]]></category> <category><![CDATA[database]]></category> <category><![CDATA[deprecation]]></category> <category><![CDATA[model]]></category> <category><![CDATA[php]]></category> <category><![CDATA[phpmyadmin]]></category> <category><![CDATA[scaffold]]></category><guid
isPermaLink="false">http://i.justrealized.com/?p=433</guid> <description><![CDATA[CakePHP is great for administering database relations (tables), something like using PhpMyAdmin. But PhpMyAdmin lacks the ability to associate relations together. Admin interfaces to manage relations through associations are therefore better done using CakePHP 1.2. However, to create an administrative application on top of your main CakePHP application is just messy and hard to maintain. [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://cakephp.org">CakePHP</a> is great for administering database relations (tables), something like using PhpMyAdmin. But PhpMyAdmin lacks the ability to associate relations together. Admin interfaces to manage relations through associations are therefore better done using CakePHP 1.2.</p><p>However, to create an administrative application on top of your main CakePHP application is just messy and hard to maintain. One of CakePHP&#8217;s most powerful feature is scaffolding where you could declare:</p><div
class="codesnip-container" ><div
class="php codesnip" style="font-family:monospace;"><span
class="kw2">&lt;?php</span> <br
/> <span
class="kw2">class</span> AppController <span
class="kw2">extends</span> Controller <span
class="br0">&#123;</span><br
/> &nbsp; <span
class="kw2">var</span> <span
class="re0">$scaffold</span><span
class="sy0">;</span><br
/> <span
class="br0">&#125;</span><br
/> <span
class="sy1">?&gt;</span></div></div><p>&#8230;and all controllers would have scaffolding. Unfortunately, we can&#8217;t do such magic on our deployed application. So that leaves us with only one way &#8211; make a CakePHP 1.2 Admin application that loads models from our Main application.</p><p>In summary, we did this:</p><ol><li>Create a new application called &#8216;admin&#8217; to load the database and models from our existing application &#8216;main&#8217;.</li><li>Load the models and do scaffolding.</li><li>Create a simple page to link to all our scaffold views.</li></ol><p>Ultimately, we want to maintain the admin interface as little as possible. The main application should not have changes in code.</p><h3>0. Structure for this example</h3><p>My models are Student, Classroom and Teacher since I like school. Here&#8217;s my rough folder structure:</p><blockquote><h3>/trunk/admin</h3><ul><li>/config</li><li>/controllers</li><li>/views</li><li>/webroot</li><li>app_controller.php</li><li>index.php</li></ul><h3>/trunk/main</h3><ul><li>/config</li><li>/controllers</li><li>/models<br
/> - classroom.php<br
/> - student.php<br
/> - teacher.php</li><li>/views</li><li>/webroot</li><li>app_controller.php</li><li>index.php</li></ul></blockquote><h3>1. Bootstrapping in Admin</h3><p>Edit the Admin &#8216;bootstrap.php&#8217; in /trunk/admin/config/ to load models from Main application. I&#8217;m using Windows Vista, that&#8217;s why the C drive.</p><div
class="codesnip-container" ><div
class="php codesnip" style="font-family:monospace;"><span
class="kw2">&lt;?php</span><br
/> <span
class="co1">// C:\justrealized\trunk\main\</span><br
/> <span
class="re0">$main_app</span> <span
class="sy0">=</span> ROOT<span
class="sy0">.</span>DS<span
class="sy0">.</span><span
class="st0">&quot;main&quot;</span><span
class="sy0">.</span>DS<span
class="sy0">;</span><br
/> <span
class="co1">// C:\justrealized\trunk\main\models\</span><br
/> <span
class="re0">$main_app_models</span> <span
class="sy0">=</span> <span
class="re0">$main_app</span><span
class="sy0">.</span><span
class="st0">&quot;models&quot;</span><span
class="sy0">.</span>DS<span
class="sy0">;</span><br
/> <span
class="co1">// Add these to modelPaths</span><br
/> <span
class="re0">$this</span><span
class="sy0">-&gt;</span><span
class="me1">modelPaths</span> <span
class="sy0">=</span> <a
href="http://www.php.net/array"><span
class="kw3">array</span></a><span
class="br0">&#40;</span><span
class="re0">$main_app</span><span
class="sy0">,</span> <span
class="re0">$main_app_models</span><span
class="br0">&#41;</span><span
class="sy0">;</span></p><p><span
class="co1">// Models to be loaded, we will use this again</span><br
/> Configure<span
class="sy0">::</span><span
class="me2">write</span><span
class="br0">&#40;</span><span
class="st0">&quot;ModelsToLoad&quot;</span><span
class="sy0">,</span> <a
href="http://www.php.net/array"><span
class="kw3">array</span></a><span
class="br0">&#40;</span><br
/> &nbsp; <span
class="st0">&quot;Classroom&quot;</span><span
class="sy0">,</span> <br
/> &nbsp; <span
class="st0">&quot;Student&quot;</span><span
class="sy0">,</span> <br
/> &nbsp; <span
class="st0">&quot;Teacher&quot;</span><span
class="sy0">,</span> <br
/> <span
class="br0">&#41;</span><span
class="br0">&#41;</span><span
class="sy0">;</span><br
/> <span
class="co1">// import the models</span><br
/> App<span
class="sy0">::</span><span
class="me2">import</span><span
class="br0">&#40;</span><span
class="st0">&quot;Model&quot;</span><span
class="sy0">,</span> Configure<span
class="sy0">::</span><span
class="me2">read</span><span
class="br0">&#40;</span><span
class="st0">&quot;ModelsToLoad&quot;</span><span
class="br0">&#41;</span><span
class="br0">&#41;</span><span
class="sy0">;</span><br
/> <span
class="sy1">?&gt;</span></div></div><p>Previously in CakePHP 1.1, there is loadModel but that has been deprecated in favor of App::Import(&#8216;Model&#8217;, $models);.</p><p>Also, make sure you have &#8216;app_model.php&#8217; in your /trunk/main/, i.e. your Main application:</p><div
class="codesnip-container" ><div
class="php codesnip" style="font-family:monospace;"><span
class="kw2">&lt;?php</span> <br
/> <span
class="kw2">class</span> AppModel <span
class="kw2">extends</span> Model <span
class="br0">&#123;</span><br
/> <span
class="br0">&#125;</span><br
/> <span
class="sy1">?&gt;</span></div></div><h3>2. Getting our database configuration</h3><p>We wouldn&#8217;t want to maintain another database.php, so the Admin will use Main application&#8217;s database settings. Editing Admin&#8217;s database.php:</p><div
class="codesnip-container" ><div
class="php codesnip" style="font-family:monospace;"><span
class="kw2">&lt;?php</span><br
/> <span
class="co2"># db config from C:\justrealized\trunk\main\config\database.php<br
/> </span><span
class="kw1">require</span><span
class="br0">&#40;</span>ROOT<span
class="sy0">.</span>DS<span
class="sy0">.</span><span
class="st0">&quot;app&quot;</span><span
class="sy0">.</span>DS<span
class="sy0">.</span><span
class="st0">&quot;config&quot;</span><span
class="sy0">.</span>DS<span
class="sy0">.</span><span
class="st0">&quot;database.php&quot;</span><span
class="br0">&#41;</span><span
class="sy0">;</span><br
/> <span
class="sy1">?&gt;</span></div></div><p>Now we&#8217;ll have our models nicely loaded.</p><h3>3. Setting up Admin&#8217;s controllers</h3><p>We can create a file called &#8216;app_controller.php&#8217; and place it on /trunk/admin/. We scaffold every controller:</p><div
class="codesnip-container" ><div
class="php codesnip" style="font-family:monospace;"><span
class="kw2">&lt;?php</span> <br
/> <span
class="kw2">class</span> AppController <span
class="kw2">extends</span> Controller <span
class="br0">&#123;</span><br
/> &nbsp; <span
class="kw2">var</span> <span
class="re0">$scaffold</span><span
class="sy0">;</span><br
/> <span
class="br0">&#125;</span><br
/> <span
class="sy1">?&gt;</span></div></div><p>And we create our three controllers &#8211; classroom_controller.php, student_controller.php and teacher_controller.php. It looks like this inside classroom_controller.php:</p><div
class="codesnip-container" ><div
class="php codesnip" style="font-family:monospace;"><span
class="kw2">&lt;?php</span><br
/> <span
class="kw2">class</span> ClassroomsController <span
class="kw2">extends</span> AppController <span
class="br0">&#123;</span><br
/> &nbsp; <span
class="kw2">var</span> <span
class="re0">$name</span> <span
class="sy0">=</span> <span
class="st0">&quot;Classrooms&quot;</span><span
class="sy0">;</span><br
/> <span
class="br0">&#125;</span><br
/> <span
class="sy1">?&gt;</span></div></div><h3>4. The Admin is done</h3><p>Now, go to your Admin application to see your classrooms. Mine is at http://localhost:7171/classrooms/</p><p>If everything is done correctly, you should see your admin interface with the default CakePHP theme.</p><h3>5. Setup the Admin homepage</h3><p>There&#8217;s nothing at the homepage, let&#8217;s put links to our views. Remember that we write the configuration &#8216;ModelsToLoad&#8217; earlier on? Now it&#8217;s time to use it.</p><p>Create a file called &#8216;home.ctp&#8217; in /trunk/admin/views/pages/home.ctp. And throw in the following codes:</p><div
class="codesnip-container" ><div
class="php codesnip" style="font-family:monospace;"><span
class="kw2">&lt;?php</span> <span
class="re0">$models</span> <span
class="sy0">=</span> Configure<span
class="sy0">::</span><span
class="me2">read</span><span
class="br0">&#40;</span><span
class="st0">&quot;ModelsToLoad&quot;</span><span
class="br0">&#41;</span><span
class="sy0">;</span> <span
class="sy1">?&gt;</span><br
/> &lt;h2&gt;Listing all available models&lt;/h2&gt;<br
/> &lt;ul&gt;<br
/> &nbsp; <span
class="kw2">&lt;?php</span> <span
class="kw1">foreach</span><span
class="br0">&#40;</span><span
class="re0">$models</span> <span
class="kw1">as</span> <span
class="re0">$model</span><span
class="br0">&#41;</span><span
class="sy0">:</span> <span
class="sy1">?&gt;</span><br
/> &nbsp; &lt;li&gt;<span
class="kw2">&lt;?php</span> <span
class="kw1">echo</span> <span
class="re0">$html</span><span
class="sy0">-&gt;</span><span
class="me1">link</span><span
class="br0">&#40;</span><span
class="re0">$model</span><span
class="sy0">,</span> <span
class="st0">&quot;/&quot;</span><span
class="sy0">.</span>low<span
class="br0">&#40;</span><span
class="re0">$model</span><span
class="br0">&#41;</span><span
class="sy0">.</span><span
class="st0">&quot;s&quot;</span><span
class="br0">&#41;</span><span
class="sy0">;</span> <span
class="sy1">?&gt;</span>&lt;/li&gt;<br
/> &nbsp; <span
class="kw2">&lt;?php</span> <span
class="kw1">endforeach</span> <span
class="sy1">?&gt;</span><br
/> &lt;/ul&gt;</div></div><p>The above reads from the array of models and make links for easy access from the homepage.</p><p><script type="text/javascript">google_ad_client = "pub-1497720434432681";
google_ad_slot = "6711626597";
google_ad_width = 468;
google_ad_height = 60;</script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </p><h3>Conclusion</h3><p>Although this looks complicated, but it&#8217;s quite easy to set up. When you have a new model, add it to &#8216;ModelsToLoad&#8217; and create the corresponding controller for it. This post is originally titled &#8220;How to create a CakePHP admin inteface by loading models from an existing CakePHP application&#8221; but that is just too long. I couldn&#8217;t locate a guide on using App::import() and how models can be loaded from external applications so I had to look at Cake&#8217;s code. Due to limitations of my WordPress plugins, I had to use double quotes instead of single quotes in all my PHP codes.</p><p>Once again, CakePHP&#8217;s scaffolding is a wonderful feature. Take some time to play with it, the rewards are tremendous.</p> ]]></content:encoded> <wfw:commentRss>http://i.justrealized.com/2008/06/30/how-to-load-models-from-another-cakephp-application/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>CakePHP&#8217;s built-in Pages Controller</title><link>http://i.justrealized.com/2008/06/29/cakephps-built-in-pages-controller/</link> <comments>http://i.justrealized.com/2008/06/29/cakephps-built-in-pages-controller/#comments</comments> <pubDate>Sun, 29 Jun 2008 12:19:53 +0000</pubDate> <dc:creator>KahWee</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[cakephp]]></category> <category><![CDATA[controller]]></category> <category><![CDATA[router]]></category> <category><![CDATA[routing]]></category> <category><![CDATA[url]]></category><guid
isPermaLink="false">http://i.justrealized.com/?p=449</guid> <description><![CDATA[CakePHP 1.2 comes with in built PagesController which helps you easily create static pages. It&#8217;s easy to set up, you just have to put your pages view in /views/pages/. All the codes are for routes.php. &#60;?php # View is in /views/pages/home.ctp Router::connect&#40;&#8216;/&#8217;, array&#40;&#8216;controller&#8217; =&#62; &#8216;pages&#8217;, &#8216;action&#8217; =&#62; &#8216;display&#8217;, &#8216;home&#8217;&#41;&#41;; ?&#62; The page title ($pageTitle) would [...]]]></description> <content:encoded><![CDATA[<p>CakePHP 1.2 comes with in built PagesController which helps you easily create static pages. It&#8217;s easy to set up, you just have to put your pages view in /views/pages/. All the codes are for routes.php.</p><div
class="codesnip-container" ><div
class="php codesnip" style="font-family:monospace;"><span
class="kw2">&lt;?php</span><br
/> <span
class="co2"># View is in /views/pages/home.ctp<br
/> </span>Router<span
class="sy0">::</span><span
class="me2">connect</span><span
class="br0">&#40;</span><span
class="st_h">&#8216;/&#8217;</span><span
class="sy0">,</span> <a
href="http://www.php.net/array"><span
class="kw3">array</span></a><span
class="br0">&#40;</span><span
class="st_h">&#8216;controller&#8217;</span> <span
class="sy0">=&gt;</span> <span
class="st_h">&#8216;pages&#8217;</span><span
class="sy0">,</span> <span
class="st_h">&#8216;action&#8217;</span> <span
class="sy0">=&gt;</span> <span
class="st_h">&#8216;display&#8217;</span><span
class="sy0">,</span> <span
class="st_h">&#8216;home&#8217;</span><span
class="br0">&#41;</span><span
class="br0">&#41;</span><span
class="sy0">;</span><br
/> <span
class="sy1">?&gt;</span></div></div><p>The page title ($pageTitle) would be &#8216;Home&#8217; for the above.</p><p>If you want your URL to be /about/my-company, you can do the following:</p><div
class="codesnip-container" ><div
class="php codesnip" style="font-family:monospace;"><span
class="kw2">&lt;?php</span><br
/> <span
class="co2"># View is in /views/pages/about/my_company.ctp<br
/> </span>Router<span
class="sy0">::</span><span
class="me2">connect</span><span
class="br0">&#40;</span><br
/> &nbsp; <span
class="st_h">&#8216;/about/my-company&#8217;</span><span
class="sy0">,</span> <br
/> &nbsp; <a
href="http://www.php.net/array"><span
class="kw3">array</span></a><span
class="br0">&#40;</span><br
/> &nbsp; &nbsp; <span
class="st_h">&#8216;controller&#8217;</span> <span
class="sy0">=&gt;</span> <span
class="st_h">&#8216;pages&#8217;</span><span
class="sy0">,</span><br
/> &nbsp; &nbsp; <span
class="st_h">&#8216;action&#8217;</span> <span
class="sy0">=&gt;</span> <span
class="st_h">&#8216;display&#8217;</span><span
class="sy0">,</span><br
/> &nbsp; &nbsp; <span
class="st_h">&#8216;about&#8217;</span><span
class="sy0">,</span><br
/> &nbsp; &nbsp; <span
class="st_h">&#8216;my_company&#8217;</span><span
class="sy0">,</span><br
/> &nbsp; <span
class="br0">&#41;</span><br
/> <span
class="br0">&#41;</span><span
class="sy0">;</span><br
/> <span
class="sy1">?&gt;</span></div></div><p>The page title would be &#8216;My Company&#8217; this time since underscores are converted to spaces. Pretty useful.</p> ]]></content:encoded> <wfw:commentRss>http://i.justrealized.com/2008/06/29/cakephps-built-in-pages-controller/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc (user agent is rejected)
Database Caching 25/82 queries in 0.068 seconds using apc
Content Delivery Network via Amazon Web Services: S3: justrealized.s3.amazonaws.com

Served from: i.justrealized.com @ 2010-09-03 09:45:51 -->