Posted by Jon on May 14, 2010 in Development, General | 0 comments
Well besides today being a Friday (TGIF!!), JetBrains have announced the pricing for the upcoming WebStorm and PhpStorm. I’ve personally been waiting for this as I’m willing to actually pay for this IDE because it’s just that damn good and it’s only in Early Access right now.
read more
Posted by Jon on May 7, 2010 in Development, General | 0 comments
What is fakemail?
From the fakemail homepage:
fakemail is a fake mail server that captures emails as files for acceptance testing. This avoids the excessive configuration of setting up a real mail server and trying to extract mail queue content.
If you have had to test applications that send e-mails, for example as part of a web sign up process, you will know what an involved and tricky exercise that can be. Usually you have to sign up with a special e-mail address, have the mail go to the mail server and then read it back into the test with a POP/IMAP client. There are several downsides to this approach; you need to install extra software to interact with the POP server, you suffer from spurious failures due to reliance on external infrastructure, and it is very very slow.
Fakemail works by intercepting the mail before it leaves the machine by replacing your Mail Transfer Agent (MTA). It’s a simple script run from the command line that you can launch from within your test framework.
Why Should I Use fakemail?
The real question is why aren’t you using fakemail. I didn’t know of fakemail before I started at SugarCRM, but now I’m glad that I do. At Sugar we use fakemail on all of our test and development instances. By using fakemail it provides a way to test all of our scripts that send emails but not actually send the emails out. What it does in turn is send the email (headers and all) to a folder specified in the config of the fakemail setup. We happend to send ours to /tmp/<instance name>/ since we have multiple instances running on the same machine.
How do I Setup fakemail
fakemail comes in two flavors: Python and Perl. They both work the same but what this allows you to do is pick your poison on which language you are more comfortable with.
Once you install fakemail to start it up just issue the following command (PERL version)
fakemail --host=localhost --port=10025 --path=/tmp
Now it’s running. To test it out just run telnet into localhost port 10025
telnet localhost 10025
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 uno.home SMTP Net::Server::Mail (Perl) Service ready
To test it use the following commands
HELO mailer
250 Requested mail action okay, completed
MAIL From: me@here
250 sender me@here OK
RCPT To: you@there
250 recipient you@there OK
DATA
354 Start mail input; end with .
A-header: Sample header
Hello
.
250 message queued
QUIT
221 uno.home Service closing transmission channel
After this sequence we can stop the fakemail terminal with a Control-C to interrupt the process. Because we set the fakemail path to the local directory, we should see a file labelled “you@there.1″. Here is the contents of that file…
A-header: Sample header
Hello
You should now be ready to use fakemail to make your testing easier.
Don’t forget to check the fakemail page for more information.
read more
Posted by Jon on Mar 12, 2010 in Development, General | 3 comments
I’ve found myself asking that question over the past month or so. For as long as I could remember I used Zend Studio, but recently I switch to PHPStorm from JetBrains and I’m not looking back.
read more
Posted by Jon on Dec 23, 2009 in Development, PHP | 0 comments
So today in playing with doctrine in one of my projects I decided to enable query caching to help speed up things a bit. My current host does not run APC or MemCache so I had to use sqlite memory table which they do allow. I followed the directions as stated in the manual for 1.2, but it didn’t work. It gave me a Table name option not set.
read more
Posted by Jon on Dec 9, 2009 in Development, PHP, Zend Framework | 4 comments
My friend Rob Allen recently posted a quick how-to on how to access your configuration data in application.ini file while in a controller or action helper. The one part Rob didn’t touch on was how to get resources back.
read more
Posted by Jon on Dec 9, 2009 in Development, PHP, Zend Framework | 7 comments
If your like me and have people who like to write stuff in MS Office first and then post it to the web you get the silly quotes and such that word uses. The quotes and such are not valid UFT-8 and that’s how I like to store my data in my database so it usually dumps out with an error.
I’ve come up with the following Zend_Filer_Interface so that way you can plug it into anything that has the ability to use Zend_Filter.
Read More for the source code.
read more