all repos — h3rald @ 014a4bffb19de55f0ef2494bc119480df3adb9b6

The sources of https://h3rald.com

contents/articles/14.html

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
-----
title: "CakePHP hybrids"
content-type: article
timestamp: 1145001300
tags: "cakephp|webdevelopment|php"
-----
<p>When I first talked to gwoo, CakePHP&#8217;s project manager, I asked him if Cake had any potential <em>limitations</em>. I asked him &#8211; I was kidding actually &#8211; wether it would be possible to build an application like Gmail using the framework and he &#8211; very seriously &#8211; simply said <em>&#8220;yes, why not?&#8221;</em>. <br />
I repeat myself when I say that CakePHP leaves plenty of freedom to developers within the bounds of its <span class="caps">MVC</span> structure: once you grasp the basic logic behind it, your possibilities are endless. I don&#8217;t want to act as a Ruby on Rails fanatic and boast that <em>you can do anything  with CakePHP</em> and things like that, but I can certainly say that CakePHP can be <em>extended</em> and <em>integrated</em> with other collections of scripts, frameworks and projects. With limitations, of course: you probably don&#8217;t want to force an integration between CakePHP and another <span class="caps">MVC</span>/Event Driven/Whatever framework, simply because it would be rather pointless and potential conflicts may occur.</p>
<p>What I keep finding online is other open source projects adopting CakePHP as <em>backend</em> and <em>structure</em>. I&#8217;m sure there are many examples which could be mentioned here, but I chose two in particular: one has been around for a few months and the other is just born.</p>
<p style="float:left;"><img src="http://base--/img/pictures/amfphp.jpg" alt="" /></p>
<p><a href="http://amfphp.org/"><span class="caps">AMFPHP</span></a> is quite an interesting project:</p>
<blockquote>
<p>&#8220;[it] is an open-source Flash Remoting gateway. It&#8217;s fast, reliable, 100% free and open-source. Flash Remoting is a technology built into the Flash player core that enables sending data between the server and the client seemlessly.&#8221;</p>
</blockquote>
<p>In other words, it makes lifes much easier for developers who&#8217;d like to integrate their flash animations and script more tightly into their <span class="caps">PHP</span> application. If you are curious to see some results, head off to <span class="caps">AMFPHP</span> <a href="http://amfphp.org/showcase.html">showcase</a>.<br />
Cool, but what has this project to do with CakePHP? Well, gwoo recently created <a href="http://cakeforge.org/projects/cakeamfphp/">CakeAMFPHP</a>, a CakeForge project which just yesterday reached its <a href="http://rd11.com/posts/view/21">0.4.0 release</a>, and it&#8217;s fully compatible with <span class="caps">AMFPHP</span> 1.2.3 and CakePHP 0.10 final.<br />
Here&#8217;s an excerpt taken from CakeAMFPHP <span class="caps">README</span>.txt file:</p>
<blockquote>
<p>&#8220;[&#8230;] <br />
1) get CakePHP 0.10 final (http://cakephp.org)<br />
2) get amfphp 1.2.3 (http://amfphp.org)<br />
3) get the <span class="caps">UFO</span> js http://www.bobbyvandersluis.com/ufo/<br />
4) put amfphp into /app/vendors<br />
5) put cakeamfphp into vendors<br />
6) put the cake_gateway.php in /app/webroot<br />
7) put the cakeamfphp.php in /app/views/helpers<br />
8) put CakeMySqlAdpater.php in /app/vendors/amfphp-core/adapters<br />
9) Voila: NetServices.setDefaultGatewayUrl( &#8216;http://localhost/cake_install/cake_gateway.php&#8217;);<br />
Access the service browser through<br />
http://localhost/cake_install/vendors/cakeamfphp/cakebrowser/&#8221;</p>
</blockquote>
<p>The installation doesn&#8217;t seem too painful at all. And &#8211; guess what &#8211; gwoo recently updated a very informative tutorial showing how to create a simple &#8211; but still impressive &#8211; bullettin board with CakeAMFPHP.</p>
<p><em>&#8220;Cool, but I never liked flash, what about <span class="caps">AJAX</span>?&#8221;</em></p>
<p style="float:left;"><img src="http://base--/img/pictures/qooxdoo.gif" alt="" /></p>
<p>CakePHP has a nice <span class="caps">AJAX</span> helper to be used in conjunction with <a href="http://prototype.conio.net/">prototype</a>, but there are truly a lot of libraries, mini-frameworks, pre-built applications to create interactive desktop-like user interfaces. Some people may already know <a href="http://qooxdoo.oss.schlund.de/">qooxdoo</a>,</p>
<blockquote>
<p>&#8220;[&#8230;] an advanced open-source JavaScript-based <span class="caps">GUI</span> toolkit. qooxdoo continues where simple <span class="caps">HTML</span> is not enough. This way qooxdoo can help you implement your <span class="caps">AJAX</span>-enhanced web 2.0 application &#8211; easier than ever before.&#8221;</p>
</blockquote>
<p>In a recent <a href="http://groups.google.com/group/cake-php/browse_thread/thread/ba219c64cd794764/1d77973293514618?lnk=raot">discussion</a> on CakePHP user group someone suggested the possibility to integrate qooxdoo with CakePHP. Apparently qooxdoo people were <a href="http://www.nabble.com/Re%3A-qooxdoo-PHP-framework-project-p3799302.html">evaluating</a> various <span class="caps">MVC</span> frameworks, and Cake was obviously listed together with two other Rails clones for <span class="caps">PHP</span>. The good news is that <a href="http://cakeforge.org/users/a100rk/">100rk</a> just started a new project called <a href="http://cakeforge.org/projects/cqx"><span class="caps">CQX</span></a>, which &#8211; although still in pre-alpha a development demo is already available, and it <em>shows off</em> most of qooxdoo&#8217;s features&#8230; <a href="http://cqx.100rk.org/trunk/">Take a look</a></p>
<p>Best of luck to 100rk and his brand new project, I really hope to see more of it soon!</p>