 | News Feed |
 | Jobs Feed |
Sections
|
Zend Developer Zone: Dynamically Generating PDF Files with PHP and Haru
by Chris Cornutt November 19, 2008 @ 17:47:40
New on the Zend Developer Zone there's a tutorial written up by Wil Sinclair looking at building dynamic PDF files in PHP with help from Haru.
This incredible versatility also applies to the topic of today's article: the PDF, or Portable Document Format. Not content with just one, PHP actually comes with two different extensions that allow developers to dynamically generate PDF documents: the PDFlib extension, and the libHaru extension. Over the next few pages, I'm going to take a quick look at the Haru extension, providing you with a brief overview of its functions and demonstrating how you can use it in your PHP development.
The tutorial walks you through the installation of the extension and several examples of it in use - everything from simple text input out to text transformations, drawing shapes and adding annotations.
voice your opinion now!
dynamic pdf generate haru extension pecl tutorial
Brandon Savage's Blog: Hosting Made for PHP Developers
by Chris Cornutt November 18, 2008 @ 16:28:54
After looking around for different hosting for some of his projects (one that was a bit more PHP-developer friendly), Brandon Savage looked into Slicehost, a virtual server option that gives a bit more control than the larger, more typical shared hosting environments. Here's his review of the move.
I'm not sure what I was expecting, but what I got was pretty amazing. Slicehost works by offering virtual servers for each account - that is, for each account they offer, you get your own box. [...] You're responsible for putting anything on it you want. And that's where the fun starts: you really can put anything you want on it.
The slices allow you to customize your PHP builds, add in MySQL, change up Apache - whatever you want. All you need to know is how to compile things and get them working together. Slicehost isn't a good option for someone that's not familiar with linux system administration, but if you know exactly what you want and how to put it there, their pricing is one of the best out there (plus they just got bought up by Rackspace so their future seems bright).
voice your opinion now!
hosting developer slicehost slice compile custom apache mysql
David Otton's Blog: php//memory, Unit Tests
by Chris Cornutt November 18, 2008 @ 15:42:01
In looking to test his fputscsv functionality, David Otton found a simple way to measure its performance by using streams.
Then I realised I could use PHP's (fairly) new IO streams to dump the function's output to a temporary buffer, and read it back in for comparison. Not perfect, but it removes concerns about file mutexes, permissions, unique filenames, etc. and speeds up the tests, as they never touch disc.
He uses a custom stream and points it to php://memory to store and read the data from. Code is included in the post as well as example usage. It runs an assert that the value pushed into another memory chunk is the same as the first one (ensuring that the results of his fputcsv calls are valid).
voice your opinion now!
memory stream test fputcsv unittest assert
Sameer's Blog: Creating a Figlet text in php
by Chris Cornutt November 18, 2008 @ 14:15:00
Sameer has posted an example of a new(ish) component of the Zend Framework - the Zend_Figlet component - and how you can use it to render the multi-line ASCII text figlet users are familiar with.
Zend_Text_Figlet is a Zend component which enables developers to create a FIGlet text. A Figlet is nothing but a technique of creating large letters using ordinary text. I don't know how to make a use of this in my daily matters, but its a nice recreation. A short history on Figlet can be found here. An example and the code to generate it is shown below.
He includes a few quick code examples to show it in action - including how to make it work with your own fonts and styles.
voice your opinion now!
figlet text zendframework component zendfiglet
Eran Galperin's Blog: OO PHP Templating
by Chris Cornutt November 18, 2008 @ 13:05:30
On the TechFounder blog, Eran Galperin has taken a look at object-oriented templating in PHP applications, comparing the older search and replace method with the inclusion of PHP-based templates.
PHP as a language can be considered a templating system, as in its root it was meant to modify HTML pages dynamically. The need for more structured templating systems arose as PHP applications have grown more and more complex, giving birth to much more specialized and focused solutions.
He illustrates with an object replacement example - parsing the template as a PHP script and replacing any objects found with the corresponding object property value.
voice your opinion now!
template project search replace include object
Smashing Magazine: 10 Advanced PHP Tips to Improve Your Programming
by Chris Cornutt November 18, 2008 @ 09:56:03
On the Smashing Magazine site Glen Stasberry has posted a few tips to help improve your PHP development practices.
Because of PHP's huge popularity, it has become almost impossible for Web developers not to have at least a working knowledge of PHP. This tutorial is aimed at people who are just past the beginning stages of learning PHP and are ready to roll up their sleeves and get their hands dirty with the language. Listed below are 10 excellent techniques that PHP developers should learn and use every time they program. These tips will speed up proficiency and make the code much more responsive, cleaner and more optimized for performance.
Suggestions include using a SQL injection cheat sheet, "shortcutting" the else in your conditionals, don't use regular expressions if you don't have to, using ternary operators and using memcached. You can see the full list here.
voice your opinion now!
improve programming advanced tips
|
Community Events
Don't see your event here? Let us know!
|