The Bakery: Components http://bakery.cakephp.org/ Recent Components Articles at The Bakery. en-us Sat, 05 Jul 2008 19:04:34 -0500 http://validator.w3.org/feed/docs/rss2.html CakePHP Bakery mariano@cricava.com (Mariano Iglesias) gwoo@cakephp.org (Garrett Woodworth) LogRotation Component http://bakery.cakephp.org/articles/view/logrotation-component My logs were getting big really fast. CakeLog does (at the time of writing) not have rotation built in so I put this little component together. Possibly someone else is logging as much as I am :) Mon, 23 Jun 2008 00:28:23 -0500 http://bakery.cakephp.org/articles/view/logrotation-component Improved Captcha Component http://bakery.cakephp.org/articles/view/improved-captcha-component I have created a very good and strong capture component for cakephp which has additional filters and various image format outputs and settings. I have used some code from an author named Pascal-Rehfeldt and have updated and modified it for use and easy implentation into cakephp Mon, 23 Jun 2008 00:22:00 -0500 http://bakery.cakephp.org/articles/view/improved-captcha-component GeoIp Component http://bakery.cakephp.org/articles/view/geoip-component If you need as much information as you can get about a client's region, then maybe you need to get into the game with Maxmind's GeoIP database and my GeoIpComponent! Fri, 13 Jun 2008 08:46:21 -0500 http://bakery.cakephp.org/articles/view/geoip-component Improved SwiftMailer Component http://bakery.cakephp.org/articles/view/improved-swiftmailer-component I've used the PHPMailer component previously, and it's useful for basic SMTP usage. However, I recently needed to make an SMTP connection requiring TLS authentication, which PHPMailer does not provide. To resolve this, I decided to switch to SwiftMailer. Unfortunately, I wasn't very satisfied with the ease of use of the existing SwiftMailer component I found on the Bakery. As such, I created my own component that is more similar to the original PHPMailer component I was using. It doesn't have attachments implemented, but it's handy for sending HTML/plaintext emails. Wed, 11 Jun 2008 08:41:22 -0500 http://bakery.cakephp.org/articles/view/improved-swiftmailer-component Protect your website against CSRF attacks http://bakery.cakephp.org/articles/view/protect-your-website-against-csrf-attacks CSRF attacks take advantage of the fact that if an authenticated client opens a page with a link <img src="http://website/action/param" />, the browser will treat it as a regular link (normal!) and send over the credentials to the website, thus allowing the action to be performed. This component's goal is to suppress that risk by protecting your links with a secret. Wed, 11 Jun 2008 08:35:51 -0500 http://bakery.cakephp.org/articles/view/protect-your-website-against-csrf-attacks DarkAuth v1.3 - an alternative Auth http://bakery.cakephp.org/articles/view/darkauth-v1-3-an-auth-component An update to the original DarkAuth component (http://bakery.cakephp.org/articles/view/darkauth-another-way), with increased efficiency and easier access control. It works exactly how I want to, so it might not be your first choice, but it's a solid alternative to the inbuilt AuthComponent. Main Features: - Per action / per controller / inline access control - Group support for HABTM and BelongsTo Group associations, or disable groups control completely. - A "super-user" functionality allowing one group automatic access granted - Optional tamper-proof Cookie support - Custom password hashing to suit your Model - Passes User Info and Access Matrix to view - Methods to access User Info / Access Matrix in Controller Wed, 11 Jun 2008 08:30:10 -0500 http://bakery.cakephp.org/articles/view/darkauth-v1-3-an-auth-component Cake DB Migrations v3.2 http://bakery.cakephp.org/articles/view/cake-db-migrations-v2-1 This article may be a little outdated. For the latest version and more info, please go to http://developingwithstyle.com Cake DB Migrations has now been updated to work with the very latest version of CakePHP 1.2 and the new (hopefully final) console/shells system. I have also added a few extra goodies to make life a little easier. The new features and changes are as follows: * You can now specify a column without the need to specify the column type. Type is set to string, which is simply a varchar(255) column. * Ability to add user definable foreign keys by simply specifying the 'fkey' as a column name, followed by the name(s) of the foreign key(s). * You can now include PHP code within the YAML migration files Because the console system in Cake 1.2 has changed a bit, ou now have to place the below script in a slightly different place. Within your main 'vendors' directory above your app and cake core directories, paste the below code into a file called 'migrate.php' and place that file in a directory called 'shells'. Now just bring up your favourite command line tool and cd into your cake applications root directory and run the following: ./cake migrate And that is it! That will migrate to the lastest version. You can specify the version like this: ./cake migrate -v 3 As promised, I hope to create a screencast going through all aspects of migrations and how they can save your life. Wed, 11 Jun 2008 08:21:40 -0500 http://bakery.cakephp.org/articles/view/cake-db-migrations-v2-1 Twitter Component http://bakery.cakephp.org/articles/view/twitter-component After searching for a suitable php Twitter component for cakephp I found none. So here is my attemp at it. This component implenets all of the twitter api found on http://groups.google.com/group/twitter-development-talk/web/api-documentation Tue, 13 May 2008 04:27:58 -0500 http://bakery.cakephp.org/articles/view/twitter-component Encrypted Cookie Component http://bakery.cakephp.org/articles/view/encrypted-cookie-component A Cookie component for Cake PHP 1.1 (which should also work in 1.2 as well). The aim of this component was to make saved data as secure as possible. I have (hopefully) achieved this by utilizing mcrypt (for encrypting and decrypting the data) and checksuming the stored data. Update: SVN build 385 Cookie's now get stored with their expiration timestamp. When __unpacking() we can check to see if the user has tampered with the cookies expiration time and kill the cookie if they have. Update: SVN build 387 Fixed constructor and tidied up comments, please note that the use of __construct() relies upon PHP5, but this could easily be adapted for PHP4 if required. Sat, 03 May 2008 18:32:18 -0500 http://bakery.cakephp.org/articles/view/encrypted-cookie-component Image Resizer / Crop http://bakery.cakephp.org/articles/view/image-resizer-crop A handy-dandy resize, crop component to be used in controllers rather than view. Sat, 12 Apr 2008 04:57:07 -0500 http://bakery.cakephp.org/articles/view/image-resizer-crop LastRSS CakePHP Component http://bakery.cakephp.org/articles/view/lastrss-cakephp-component LastRSS is a PHP class for retrieval and parsing of RSS feeds. This is a wrapper to that class making it easy to use in the CakePHP framwork. Much of this component is taken from the work of Matt Curry (http://bakery.cakephp.org/articles/view/simplepie-cakephp-component) and Scott Sansoni (http://cakeforge.org/snippet/detail.php?type=snippet&id=53). Wed, 12 Mar 2008 07:48:21 -0500 http://bakery.cakephp.org/articles/view/lastrss-cakephp-component SMS Text Component http://bakery.cakephp.org/articles/view/sms-text-component Simple component for sending SMS text messages to mobile devices using the Clickatell API (They provide free test accounts). Wed, 12 Mar 2008 07:33:27 -0500 http://bakery.cakephp.org/articles/view/sms-text-component Authorize.net AIM Integration Component http://bakery.cakephp.org/articles/view/authorize-net-aim-integration-component A simple component meant to abstract payment processing for Authorize.net's AIM card processing method. Wed, 12 Mar 2008 07:31:39 -0500 http://bakery.cakephp.org/articles/view/authorize-net-aim-integration-component SimpleAcl component tutorial http://bakery.cakephp.org/articles/view/toniacl-component-tutorial This component follows the traditional way of acl only slightly modifying it. In example there's an inheritance feature, which will help tremendously the access controlling because you don't have to specify every action in aros_acos-table. Wed, 12 Mar 2008 07:27:38 -0500 http://bakery.cakephp.org/articles/view/toniacl-component-tutorial DarkAuth - another way... http://bakery.cakephp.org/articles/view/darkauth-another-way I wrote this initially for Cake 1.1 - basing it on ideas from "obAuth" by Steve Oliveira, but upgraded it to 1.2 rather than using the built in Auth component, mostly because this works how I want it to and, once setup, is really easy to use. Main Features: - Per action / per controller / inline access control - Optional Group support for HABTM and User BelongsTo Group associations - A "super-user" functionality allowing one group automatic access granted - Optional tamper-proof Cookie support - Custom password hashing to suit your Model Mon, 18 Feb 2008 06:39:44 -0600 http://bakery.cakephp.org/articles/view/darkauth-another-way