 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Refulz.com: CakePHP evolves to 2.0
by Chris Cornutt February 08, 2012 @ 11:15:43
On the Refulz.com blog there's a new post looking at some of the new features in CakePHP 2.0 including its use of lazy loading, the CakeEmail library and the new class loader.
With CakePHP 2.0, they have dropped support for PHP 4 and have refactored the library code to make it strictly complaint with PHP 5.2+. Modeled on Ruby on Rails (RoR), CakePHP is a tough competition to Zend framework, Symfony and CodeIgniter.
Besides the topics mentioned above, he also goes into the details of the new CakeRequest and CakeResponse models (to access information about teh current request/response). Summaries of all of the new functionality are provided along with some sample code where needed to illustrate.
voice your opinion now!
cakephp version2 features lazyloading model email loader
PHPMaster.com: Understanding the Command Design Pattern
by Chris Cornutt January 03, 2012 @ 08:25:29
On PHPMaster.com today there's a new article introducing you to the Command design pattern and looking to help you understand its use a bit better.
The majority of [cell phone] users have opted to receive an email, but a significant number are now opting to receive the notifications via SMS. Here's the problem: How do you send a message via two different channels to both groups of users? The logical approach would be to split the users into 2 groups, email recipients and SMS recipients, which would involve running 2 different queries and sending the codeword to each group separately. Using the Command Pattern, which I will introduce you to in this article, you can send the message to both groups of users in a single process.
He uses the message queue he mentioned as an example - showing how you can can queue up different kinds of objects (actions) based on a common interface into the same process. He creates a "DailyAlertEmail" and "DailyAlertSMS" classes, both with a "send" method. The settings for these are then pulled from a database and the "execute" method on the "MessageQueue" class is called to loop through them, calling "send" to do that work.
voice your opinion now!
command designpattern tutorial message queue sms email
Henrik Bjørnskov's Blog: Stampie an in depth look
by Chris Cornutt December 15, 2011 @ 12:48:25
Henrik Bjørnskov has posted a bit of an in-depth look at Stampie, an abstraction library for sending emails from PHP applications via various service providers (like SendGrid and Mailchimp).
So what is Stampie. Stampie is a API wrapper for the most common email sending services. It provides a standard PHP Api to send emails. But mostly it is a project to test TDD and experiment with a couple of different things. Stampie is developed with Dependency Injection and therefore there is a lot of objects. At the start it can be quite cumbersome, but will make a lot of sense if you start to develop and add additional provider.
He includes a bit of sample code showing the sending of a message via the SendGrid API backend. Extending the system is simpler thanks to DI and the customizable MailerInterface object type. There's also an AdapterInterface object that can be used to redefine the HTTP connection interface the tool uses. He also points to the HBStampieBundle bundle for the Symfony2 framework that can make dropping it into your current SF2 application simpler.
voice your opinion now!
stampie email send tutorial dependencyinjection tool
php|architect: Transactional Emails for Fun and Profit
by Chris Cornutt November 22, 2011 @ 17:58:33
On the php|architect site there's a recent tutorial from Cal Evans about building a transactional email system with the help of a simple library and the SES system from Amazon.
I love APIs. A well-defined API can make short work of a complex problem. It's even more fun when you find a cool API with a great wrapper to make it simple to use. That's what I found when I started playing with Amazon's Simple Email Service; a tool that was easy to work with, solved a problem I needed solved, and had a simple to use PHP wrapper.
Based on the SES library by Dan Meyers, he includes the code to pull in a simple email template and populate it with the values you want, log in to the Amazon SES service and send the email via the remote service.
voice your opinion now!
transaction email amazon tutorial ses service api
PHPMaster.com: Sending Emails with PHP
by Chris Cornutt October 24, 2011 @ 20:08:52
In a new tutorial from PHPMaster.com Jason Pasnikowski takes a look at sending emails with PHP - an introduction to what the language offers and how it can be used to send an HTML version.
In most cases your installation of PHP will be capable of sending emails. If you are using a shared host, or if you installed PHP using a package management system like apt-get, more than likely you're all set. You'll really only need to worry about extra configuration if you're compiling PHP from source or if you're running it on Windows. In either case, there are plenty of resources available online to help you out. Because that's all beyond the scope of this article, I'll assume you're set. If not, Google will be your friend.
He starts with a simple example using the mail function but quickly moves on to sending a multi-part email with an attached zip file and HTML content. He includes the all code you'll need and explains each part in detail so you'll know exactly what's going on.
voice your opinion now!
send email tutorial html multipart zip file
PHPMaster.com: Creating a Mobile Photo Blog, Part 2
by Chris Cornutt October 13, 2011 @ 10:54:21
PHPMaster.com has posted the second part of their series helping you build a mobile photo blog powered by email attachments pulled over POP3. (Part one is here)
This is the second article in a two part series in which I show you how to create a photo blog that is updated from your mobile device. Part 1 laid out the plan for building the application, set up the database requirements, and introduced you to some user contributed functions from the PHP manual which make it easy to retrieve messages from a POP3 mail server. In this installment I show you how to bring everything together so you can start photo-blogging on the go.
In this new tutorial they include the code to authenticate against the database, insert the email details into the tables and inserting the formatted results into blog posts. It's finished off with the code to pull out the latest entries and display them along with their matching photos.
voice your opinion now!
tutorial photo blog pop3 email approval
PHPMaster.com: Creating a Mobile Photo Blog, Part 1
by Chris Cornutt October 06, 2011 @ 08:35:57
PHPMaster.com has started up a new series of tutorials today with part one of "Creating a Mobile Photo Blog". The set of tutorials will show you how to create a simple blogging tool that will upload images as submitted via an email address.
This is the first article in a two-part series in which I will show you how to create a photo blog as part of your personal website which you can update from your phone simply by sending an email. You'll write a script to check the inbox of an email account for new messages using POP3; the script will extract the messages' subject line, body text, and attachments and update a database accordingly. You can then pull the information from the database for display on your blog, in a sidebar, or however else you see fit.
The start with some of the security considerations you'll need to keep in mind when creating a script like this depending on how open you want it to be (like filtering based on the "From" email or sending an approval message before posting). Included in the post is the SQL to create their basic tables for posts, image details and the pending items. There's also a PHP class (POP3) that makes an IMAP connection to a remote server, authenticates as your account and fetches the latest messages along with their attachments. These are pulled with a quick script and displayed via a foreach.
Part two will get into more of the integration of the images and the approval technique prior to posting the images.
voice your opinion now!
tutorial photo blog imap email approval
PHPMaster.com: Regular Expressions
by Chris Cornutt September 27, 2011 @ 09:42:28
Regular expressions have always been something that have mystified developers, even those seasoned ones looking to match the most complicated data. If you're just venturing into the world of regex, PHPMaster.com has a good guide to help you wade through some of the basics.
It makes all the sense of ancient Egyptian hieroglyphics to you, although those little pictures at least look like they have meaning. But this… this looks like gibberish. What does it mean? [...] When you're looking to go beyond straight text matches, like finding "stud" in "Mustard" (which would fail btw), and you need a way to "explain" what you're looking for because each instance may be different, you've come to need Regular Expressions, affectionately called regex.
The include a (somewhat) complicated example regex string and break it down chunk by chunk - groupings, character sets, multiple matching, delimiters and more (the pattern matches valid email addresses). They show how to use it in PHP with preg_match, preg_replace and preg_match_all for different situations.
voice your opinion now!
regular expression introduction email match tutorial
Wojciech Sznapka's Blog: Loosening dependencies with closures in PHP
by Chris Cornutt September 27, 2011 @ 08:22:46
Wojciech Sznapka has a new tutorial posted to his blog today looking at removing some of the issues surrounding dependencies in PHP applications with the help of closures.
Today I ran into a little issue: how to pass generic logger object to method? I wanted to get some verbose output from method, which I call from Command, but onc time it should log with Symfony2 OutputInterface and other time it should use monolog logger. Of course I can make some wrapper class for both of them, but it would be kind of an overkill. The Closure from PHP 5.3 came with solution.
His alternative creates a closure for his Symfony2 application that defines the logger handling in an abstract way and injects that object into his job queue manager for handling. This way the manager doesn't have to worry about handing the mailing itself, it's just deferred to the mailing object. You can find out more about this technique, dependency injection, here.
voice your opinion now!
symfony2 dependency injection object email tutorial
|
Community Events
Don't see your event here? Let us know!
|