The Bakery Blog: SwiftMailer Component Tutorial
627504
On The Bakery (the CakePHP blog) today, there's a new tutorial covering the SwiftMailer Component:   I would still advise you read the Swift Mailer documentation here: http://www.swiftmailer.org/docs/ SwiftMailer Component isn't an attempt to hide the already excellent class written by Chris Corbyn. Rather, the component tries to integrate and extend it (read, Cake-ish!).   They walk through the installation and where to unpack the download to ensure it works with your installation of CakePHP. You'll need to add the component to the main controller, but other than that, you're ready to go. From there it's configuration issues:  connecting to the local MTA (like sendmail or a SMTP server) configuring the authentication for sending and, of course, creating a message to go out  They demonstrate the creation of this through a view in the application that can natively send both HTML and plain-text emails.
653298
In the last part of this series, you'll learn how to build a declarative component for an application with a list of customers which is populated from a server-side data handler using AJAX. By David Johnson, Alexei White, and Andre Charland. 0910
513649
Since he didn't come across any issues or bug reports, Richard Heyes has officially released his SMTP class for PHP5 as "out of public beta" and ready for production use.   I've not added any new features to the class; I've simply updated it to be, well, better. Plus it uses PHP5's object model better. It's really just an update, ie if you're using the old version and it works, then you have no real reason to update it.   You can check out the source here and an example of it in action here.
238103
In his latest post, Greg Beaver gets excited about some of the recent advancements in PEAR including: more traffic on the mailing lists, improvements to the acceptance policies and documentation for packages, and fun things like the download statistics and a Google Map of developers.    His real excitement comes with the latest offering the PEAR group is creating to pull more of the PHP community into the project and make them feel a part - a new election interface to vote on packages and the future of PEAR.   Most of the important decisions I mentioned will be decided by a general election, meaning that the users of PEAR, not just the developers, will have a voice in the direction PEAR decides to take.   PEAR developers out there are already registered to vote, but if you'd like to get in on the action, head over to the signup form and get involved today.
475410
On the SitePoint PHP Blog today Troels Knak-Nielsen asks th3e question "what's so bad about the singleton?" For all of its advantages, is there a darker side of the design pattern when it pertains to global variables.   As I have often taken this stance myself, I found it reasonable that I should be able to argue for it, so I'll try to give an explanation. This is also in part a follow-up on my post from last week, in which I present a way to avoid global symbols, without spending much time on why.   He talks about what they are and how they're commonly used - sometimes with some unpleasant side effects because of their use of globals.
284802
Fast, intelligent, automatic spam detector using Paul Graham style Bayesian analysis of word counts in spam and non-spam emails. Filtering adapts to personal tastes automatically. No manual rule creation required. This release adds the final missing pieces to the new parser code.  MBX files and Content-Length headers are now supported.  Database cleanup when signals are caught has also been improved.  I would like to move 1.1 into the stable branch fairly soon so if folks would test out this release and report any problems it would be a big help!   The latest release can be found here: https://sourceforge.net/project/showfiles.php?group_id=61201&package_id=73566
306412
Here comes the second release candidate for the 1.0 version of Ristretto. New and noteworthy features are: implementation of the IMAP Namespace extension (RFC 2342), asynchronous download of messages from POP3, license changed to tri-license MPL/LGPL/GPL and more JavaDocs added.   Ristretto is the mail api that is used by Columba. Available as a stand-alone API Ristretto provides a well tested, slim and fast Java implementation of all relevant mail protocols.  The main features are * full IMAP, POP3 and SMTP support * full SSL support * low-level implementation of the RFCs * fast and stable parsers using regular expressions  For an overview and the download links please visit http://columba.sourceforge.net/index.php?page=subprojects_ristretto
272507
On our sister site, AjaxDeveloper.org, today, there's a new post that mentions the latest blog post from Joshua Eichorn - a look at Javascript behaviors in his PEAR package, HTML_AJAX.    Welcome to part two of the series "Sending email with AJAX." In three parts, this series goes through the making of a simple web-based email application. It uses AJAX as the driving technology for fetching the files responsible for sending email from the server, as well as for adding and updating contacts.    This part covers the development of a "email sender" module, a "contact listing" module, the "contact insertion" module, and, finally, starting things up with the initializeEmailClient function.
84402
The Bakery has five new items they've recently posted - a few new articles, helper information and tutorials. Here's the list:   CSV Helper - I was recently outputting some comma-delimited data and thought I would benefit from a simple csv helper p28n, the top to bottom persistent internationalization tutorial - For some developers, allowing a website to support multiple languages is essential. Luckily cakePHP 1.2 has the foundations available to make this possible. Tracking navigation history of a user - Many times it can be very useful to track the navigation history of a user. [...] With this HistoryComponent, it's extremely easy to handle such actions. Habtm hacks to menage columns in both models - I had a habtm relationship between two models and when i did a "findall" in a model i couldn't filter the rows with a clause from the the other model. SecureGet Component - I am not pretending this can replace ACL or more complex implementation, it's just a small component, inspired a bit from the Security component.   If you're a CakePHP developer, you'd do well to check out The Bakery for these and more great Cake-related articles, tutorials and information.
654789
Padraic Brady has posted today about a subclass of the Zend_Loader package (in the Zend Framework) he had written up to handle Dependency Injections - it was submitted but ended up being replaced with a Zend_Di component instead.   I realised someone had proposed a novel new component called Zend_Di, and that small change was since accepted by Federico into his DI buster. This is a quick overview with very simple use cases - read the full proposal for even more gory details about your object innards using DI.   He talks about what DI (dependency injection) is and what it can be used for and includes a simple example set around a controller in the framework that uses the Zend_Di component to make a "mock Zend_Mail" that can be used in testing too. Examples of these sorts of tests (with PHPSpec) are included too.
257791
Felix GeisendÃ¶rfer has officially released the latest version of his Containable Behavior for the CakePHP framework:   Sorry I've taken so long to get a new version of my Containable Behavior released, but believe me I've not been slacking this time. [...] In fact I'm releasing the new version as a BETA right now since I'm still not 100% satisfied with the result and not all features have made it in yet, but I felt the need for iterating. However, the new version should be a big step up from this initial one and I hopefully bug free.   The post includes both the code for the new version of the behavior but also several examples on its use. Improvements in this new version include better performance, new function (containments), support for dynamic field containments and different field containments.
246241
In a quick post to his blog, Lukas Smith notes his support of the recent announcement of the PEAR elections.   I am confident that both of the proposals will help in improving collaboration in PEAR, mainly because they basically provide the same organization we used to have for all of PEAR (which worked great in the beginning), now for categories of related packages.   He reasons that, since PEAR is such a huge project, it needs this kind of approach - a method to the madness - to help keep the project on the right path.
416010
The IBM developerWorks site brings the community another great tutorial today, this time looking at the CakePHP framework and the creation of a simple application with it.    In "Cook up Web sites fast with CakePHP, Part 1: Adding related information and services", they build a sample application (Tor) from the ground up (installation guide and all) that will take in a username and password on a login page. Their goal is to show you how much time you could safe by using the framework over just the usual library-based (or procedural) programming methods.   You will need to be a bit familiar with PHP and the Model/View/Controller design pattern before you get started here, but if you have that down, you can just jump right in. You'll also either need to register with the site or log in with your account information to get to the good stuff.
360849
On the Zend Developer Zone today, there's this new tutorial that looks at making the move from PHP4's object-oriented programming up to the "more complete obejct model of PHP5" - specifically with the Decorator design pattern.   While working on a project I realized one particular solution was a pretty good way to demonstrate the decorator design pattern together with some of PHP5's features, including abstract classes, interfaces, type hinting, the final keyword and the visibility of properties and methods. This article is intended for those of you who, like myself, are moving from object-oriented programming, including some use of design patterns, in PHP4, to the more complete object model of PHP5.   He sets up a scenario about the development of an online pizza ordering system to show how to "decorate" a pizza with each of the toppings on a list (instead of having to list out every pizza in every possible topping combination). Of course, all of the code is included and explained so you understand exactly what's happening. Finally, there's a demonstration of its usage - a simple call that grabs the stock level/name/cost of each of the items in stock (pizza combinations).
108040
Felix Geisendorfer has a new post today showing off an example of his screencasting abilities. Specifically, the video looks at using vendor branching to keep your CakePHP installation up to date.   So here I go with my very first screencast to be published. The topic is how to use vendor branching with CakePHP which is one of many ways to keep your CakePHP version up to date.   The video is 15(ish) minutes long and covers, from start to finish, the process of grabbing the latest CakePHP build from the subversion repository and install it automatically to your system.   As a plus, Felix also includes links to the software he used to make the screencast for those that are curious.
489861
Felix Geisendorfer has posted a new blog entry he's been promising for a while now - a look at using Exceptions in a CakePHP application:   First of all. Why did I decide to experiment with exceptions in CakePHP? Well, Object::cakeError() does an ok job at providing me with a way to render some sort of internal error while I'm debug mode. However, I think that is what its really meant for, and its not the way to go for rendering errors to the user directly. [...] [All of] these things can be addressed by using PHP5s support for custom Exception classes quite elegantly.   He includes an example of the exception handling in action - an AppError controller that extends the ErrorHandler and an AppException class that extends the normal Exception class for some customized methods. Example usage is also included, showing how to check things like the Subversion version of a file and checking properties of objects.
193310
Here's what was popular in the PHP community one year ago today:onPHP5.com: Clickable, Obfuscated Email AddressesJacob Santos' Blog: PHP BlackjackThe Bakery: RESTful Web Services With CakePHPDeveloper.com: Developing a Ajax-driven Shopping Cart with PHP and PrototypeGreg Beaver's Blog: Mac OS X ships with security hole-laden PEAR - how to upgrade immediatelyNexen.net: English Articles and a Single Distribution ResourceJob Posting: Red Ventures Seeks Several LAMP Developers (Charlotte, NC)The Bakery: Checking for duplicate records (unique record)DevShed: The Basics of Abstract Factory Classes in PHP 5NewsForge.com: A DIY calendar control in PHPDevGuide.net: Dynamic Bitmap Graphics with PHP and GDRichard Heyes' Blog: Browser DetectionInternational PHP Magazine: Poll Question: Which is the Most Important Feature of PHP 5?Builder.au: Dynamic XML document construction with the PHP DOMCommunity News: PEAR Version 1.5.0 Released