When you spent half of your day integrating with external systems, you’ll get into a point where reading a xml message is an extremely tiring event.
By making the xml message with the right indentation your life will become 100x easy.
Just copy the xml message into your computer memory, and then run this command.
pbpaste | xmllint --format - > pretty-xml.xml
You’ll get a pretty and nice readable xml file on your destination file “pretty-xml.xml”.
PHP 5.4 was officially released as a stable version. There are some new features on this PHP version, but maybe the surprisingly one is: it comes with a built-in web server for development purposes.
What’s new on PHP 5.4 (Key Features) :
- Shortened Array Syntax
- Built-in web server for development purposes
Just been analyzing the “PHP and MongoDB Web Development ” book, by Packt Publishing.
The books introduces the audience to usage of MongoDB including:
- Brief introduction to NOSQL movement
- Installing MongoDB
- Creating databases on MongoDB and definition of Document and Collections.
While migrating all my repos to GIT i found myself discovering new ways of work with git, i’ll try to past them on this blog as own notes.
Need: A list of changed files on my <branch> comparing to master
git branch <your branch> // Switch to branch
git pull origin master // Sync master changes inside your branch
git diff --name-only master <branch> // List of the changed files
Probably there is a nicer way to achieve this, let me know if you find any other
Sending emails using Zend_Mail component from Zend Framework is an easy as it can get task. On a recent project, i needed to configure Zend_Mail to work with Google Smtp server.
Here is a quick how to:
$settings = array('ssl'=>'ssl',
'auth' => 'login',
'username' => 'firstname.lastname@example.org',
'password' => 'YOUR_PASSWORD');
$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $settings);
$email_from = "YOUR_EMAIL";
$name_from = "YOUR NAME";
$email_to = "TO_EMAIL";
$name_to = "TO NAME";
$mail = new Zend_Mail ();
$mail->setFrom ($email_from, $name_from);
$mail->addTo ($email_to, $name_to);
$mail->setSubject ('Testing email using google accounts and Zend_Mail');
$mail->setBodyText ("Email body");
Don’t even bother to add a different email to $email_from than your Google email, because Google will override your settings by you account email.
Update: Got a tip from Bruno Pedro, Google has smtp sending limits, you can only send up to 500 emails using a Google standard account. Read the Google answer on this limiting issue, for more info.
For a more detailed look, just check out Zend_Mail component page.