Revision history for WikkaCake11


Revision [23465]

Last edited on 2016-05-20 07:38:48 by BrianKoontz [Replaces old-style internal links with new pipe-split links.]
Additions:
=====Integrating Wikka and [[http://www.cakephp.org | CakePHP]]=====
[[http://blog.wikkawiki.org/2007/08/18/have-your-cakephp-and-eat-it-too/ | Wikka Developer Blog]]
[[http://bakery.cakephp.org/articles/view/wikkacake-using-cakephp-as-an-embedded-framework | The Bakery]] [[http://web.archive.org/web/20070819094408/http://bakery.cakephp.org/articles/view/wikkacake-using-cakephp-as-an-embedded-framework | (archived version)]]<<
I advocate the use of Wikka as a [[Docs:FlexibleWikka | presentation framework for rapid development]] of Internet-based applications. Wikka does a great job of handling user authentication, session tracking, and presentation, but does not offer much in the way of easily customizable, high-level database read/write access. Enter [[http://www.cakephp.org | CakePHP]]: A rapid-development PHP framework that handles many of the low-level DB access details so you don't have to. While Cake itself offers similar framework functionality as Wikka, my goal was to implement a totally self-contained Cake application within Wikka. The look-and-feel would be all Wikka, while the Cake engine would provide a database abstraction layer independent of Wikka.
My development environment consists of Mac OSX 10.3.9, running the latest [[WikkaSVN | trunk version]] of Wikka. The Cake version I'm currently using is 1.1.16.5421. Please be aware that Cake versions starting with 1.2 have significant API changes that may not be compatible with the setup instructions that follow. I have not tested this setup on Wikka 1.1.6.3 or earlier, but other than some directory restructuring, I see no reason why these instructions won't be applicable to earlier Wikka versions.
[[http://www.cakephp.org/downloads | Download]] the latest 1.1.x version of Cake and use whatever method is appropriate for your system to unzip/untar the Cake distribution to your ##3rdparty/plugins## directory. As a matter of convenience, Unix/OSX users may want to either create a symlink to the cake distribution directory:
This is the "heart" of the Cake application, as the Dispatcher is what kicks off the Cake core engine. The problem here is that there is a conflict between the way Cake parses a URL (it expects a controller action as the URL target) and what Wikka expects (an action name as the URL target). Thanks to the [[http://debuggable.com/posts/learning-from-the-cakephp-source-code-part-i:480f4dd6-28d0-445e-a1dc-4ceacbdd56c | work of]] [[http://debuggable.com/posts/learning-from-the-cakephp-source-code-part-ii:480f4dd6-57fc-4715-8709-439acbdd56cb | Felix Geisendorfer]], we have an easy way of overriding the default Cake dispatch mechanism, allowing us to create a new Dispatcher and dispatch us to wherever we want to go. Since Wikka implements handlers as a URL extension (i.e., ##wikka/CakeTest/edit## invokes the Wikka editor on the ##CakeTest## page), we must use another mechanism to pass actions to Cake. I've chosen to use GET parameters (i.e., ##wikka/CakeTest?action=add##). By default, no GET parameters should invoke your controller's ##index()## method directly (don't worry if this doesn't make sense at the moment). Anything else passed as a GET parameter is a Cake action and should be dispatched as such.
This might not make much sense to you if you're learning Cake as you go. My suggestion would be to create a simple Cake application (the [[http://manual.cakephp.org/appendix/blog_tutorial | Cake tutorial]] is an excellent place to start), get it working as a standalone app, and then simply copy everything under your ##app## directory to your ##caketest## action.
At this point, if you're ready to tackle a new Cake application, start with the extensive [[http://manual.cakephp.org | Cake documentation]]. The [[http://manual.cakephp.org/appendix/blog_tutorial | Cake tutorial]] is an excellent hands-on project that lends itself easily to conversion to a WikkaCake app. I've also found the [[http://www.thinkingphp.org | ThinkingPHP]] blog to be an excellent source of information about Cake that's not covered by the Cake manual and API.
I will be posting a simple WikkaCake application I developed for the [[http://opennic.jdcomputers.com.au | OpenNIC]] wiki to track ""OpenNIC"" [[http://opennic.jdcomputers.com.au/VolunteerHosts | public servers]]. It's based loosely upon the blog tutorial mentioned earlier.
Deletions:
=====Integrating Wikka and [[http://www.cakephp.org CakePHP]]=====
[[http://blog.wikkawiki.org/2007/08/18/have-your-cakephp-and-eat-it-too/ Wikka Developer Blog]]
[[http://bakery.cakephp.org/articles/view/wikkacake-using-cakephp-as-an-embedded-framework The Bakery]] [[http://web.archive.org/web/20070819094408/http://bakery.cakephp.org/articles/view/wikkacake-using-cakephp-as-an-embedded-framework (archived version)]]<<
I advocate the use of Wikka as a [[Docs:FlexibleWikka presentation framework for rapid development]] of Internet-based applications. Wikka does a great job of handling user authentication, session tracking, and presentation, but does not offer much in the way of easily customizable, high-level database read/write access. Enter [[http://www.cakephp.org CakePHP]]: A rapid-development PHP framework that handles many of the low-level DB access details so you don't have to. While Cake itself offers similar framework functionality as Wikka, my goal was to implement a totally self-contained Cake application within Wikka. The look-and-feel would be all Wikka, while the Cake engine would provide a database abstraction layer independent of Wikka.
My development environment consists of Mac OSX 10.3.9, running the latest [[WikkaSVN trunk version]] of Wikka. The Cake version I'm currently using is 1.1.16.5421. Please be aware that Cake versions starting with 1.2 have significant API changes that may not be compatible with the setup instructions that follow. I have not tested this setup on Wikka 1.1.6.3 or earlier, but other than some directory restructuring, I see no reason why these instructions won't be applicable to earlier Wikka versions.
[[http://www.cakephp.org/downloads Download]] the latest 1.1.x version of Cake and use whatever method is appropriate for your system to unzip/untar the Cake distribution to your ##3rdparty/plugins## directory. As a matter of convenience, Unix/OSX users may want to either create a symlink to the cake distribution directory:
This is the "heart" of the Cake application, as the Dispatcher is what kicks off the Cake core engine. The problem here is that there is a conflict between the way Cake parses a URL (it expects a controller action as the URL target) and what Wikka expects (an action name as the URL target). Thanks to the [[http://debuggable.com/posts/learning-from-the-cakephp-source-code-part-i:480f4dd6-28d0-445e-a1dc-4ceacbdd56c work of]] [[http://debuggable.com/posts/learning-from-the-cakephp-source-code-part-ii:480f4dd6-57fc-4715-8709-439acbdd56cb Felix Geisendorfer]], we have an easy way of overriding the default Cake dispatch mechanism, allowing us to create a new Dispatcher and dispatch us to wherever we want to go. Since Wikka implements handlers as a URL extension (i.e., ##wikka/CakeTest/edit## invokes the Wikka editor on the ##CakeTest## page), we must use another mechanism to pass actions to Cake. I've chosen to use GET parameters (i.e., ##wikka/CakeTest?action=add##). By default, no GET parameters should invoke your controller's ##index()## method directly (don't worry if this doesn't make sense at the moment). Anything else passed as a GET parameter is a Cake action and should be dispatched as such.
This might not make much sense to you if you're learning Cake as you go. My suggestion would be to create a simple Cake application (the [[http://manual.cakephp.org/appendix/blog_tutorial Cake tutorial]] is an excellent place to start), get it working as a standalone app, and then simply copy everything under your ##app## directory to your ##caketest## action.
At this point, if you're ready to tackle a new Cake application, start with the extensive [[http://manual.cakephp.org Cake documentation]]. The [[http://manual.cakephp.org/appendix/blog_tutorial Cake tutorial]] is an excellent hands-on project that lends itself easily to conversion to a WikkaCake app. I've also found the [[http://www.thinkingphp.org ThinkingPHP]] blog to be an excellent source of information about Cake that's not covered by the Cake manual and API.
I will be posting a simple WikkaCake application I developed for the [[http://opennic.jdcomputers.com.au OpenNIC]] wiki to track ""OpenNIC"" [[http://opennic.jdcomputers.com.au/VolunteerHosts public servers]]. It's based loosely upon the blog tutorial mentioned earlier.


Revision [21302]

Edited on 2010-12-29 20:51:32 by BrianKoontz [deprecated]
Additions:
**{{color c="red" text="This page has been deprecated."}}**
Deletions:
**{{color c="red" text="This page has been deprecated."}}


Revision [21301]

Edited on 2010-12-29 20:51:13 by BrianKoontz [deprecated]
Additions:
**{{color c="red" text="This page has been deprecated."}}
Deletions:
**[{color c="red" text="This page has been deprecated."}}


Revision [21300]

Edited on 2010-12-29 20:50:54 by BrianKoontz [deprecated]
Additions:
<<
**[{color c="red" text="This page has been deprecated."}}
This page covers ""CakePHP"" 1.1 and is not applicable to later versions. Please visit the updated WikkaCase page for covereage of ""CakePHP"" 1.3.
**See also:**
Deletions:
<<**See also:**


Revision [21299]

The oldest known version of this page was created on 2010-12-29 20:48:56 by BrianKoontz [deprecated]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki