
On PHPFreaks.com there's a new tutorial posted today looking at combining the Zend Framework with the LiveDocx libraries to create PDF/DOCX/DOC/RTF documents based on simple templates.
Generating print-ready well-formatted PDF documents with PHP is not an easy task. Traditionally, there are two main approaches to PDF generation with PHP. Given sufficient time and patience, both partially get the job done, but still leave a lot to be desired. [...] In this article, the author presents an entirely new, third approach. It relies on templates being created in a WYSIWYG environment, such as Microsoft Word or Open Office, and then being populated with data in PHP. The resulting document can be saved not only to PDF, but also DOCX, DOC and RTF.
They include both an overview of the LiveDocx tool and some code samples to use a template made in Microsoft Word to generate a PDF file with dynamic values. They also include a bit about how to create dynamic images.
On the Millwood Online blog there's a quick step-by-step about getting multiple Drupal sites up and running on one code installation.
One of the great things about Drupal is that you can run more that one site off one installation. This saves disk space and load on your server, it also saves maintenance time. With only one installation to manage and update the time spent administering your site drops greatly.
The process is pretty simple - install Drupal normally and set it up for the main domain, then change the directory name for the settings and add another for the new domain name. Go update your Apache virtual host configuration file to point to the new location and restart the web server. Both of your domains should be set and ready.
In his latest post Brandon Savage suggests that every developer should do one thing before they start working with PHP frameworks - write their own.
So for those of you wanting to write your own frameworks, feel free. But don't even think about putting it in production until you've read this blog post. Lots of times new developers are shot down from writing their own frameworks by bosses or community members who insist that "NIH" (not invented here) has no place in their organization or language. [...] To me, that doesn't make a whole lot of sense.
He points to a comment from Elizabeth Smith that reinforces his ideas and supports the creation of a framework. Using it in production, however, is a whole different story. They both agree that writing your own framework is good for learning how it all works, but that you should stick with the larger frameworks for real development.
John Lim has updated his Optimizing PHP article with some new tips on caching data:
In this chapter, we explain why optimizing PHP involves many factors which are not code related, and why tuning PHP requires an understanding of how PHP performs in relation to all the other subsystems on your server, and then identifying bottlenecks caused by these subsystems and fixing them. We also cover how to tune and optimize your PHP scripts so they run even faster.
The article talks about true high performance, some of the bottlenecks that can keep you from it, tuning your Apache/IIS web server, tips on caching and some ways you can benchmark your application to figure out the best configuration for you.
On NETTUTS.com today there's a new review of the Packt book "Zend Framework 1.8 Web Application Development" (Keith Pope) from Fred Wu.
The flow of this book is heavily inspired by the famous Ruby on Rails book, Agile Web Development with Rails, where the author invites you to join the process of building a demo application, which in both cases is a shopping cart system.
He mentions how "short" the book is (at 350 pages), how much focus is put on MVC, the creation of the simple online store application and a bit of content on code optimization, caching and testing. Overall, he found it a good book for those that know PHP already and don't mind following along with a fast-paced read.