News Feed
Jobs Feed
Sections



Recent Jobs

News Archive
Marcus Bointon's Blog:
Compiling wkhtmltopdf on Mac OS X 10.7 Lion
May 16, 2012 @ 11:55:26

Marcus Bointon has written up the process he took to get the PHP extension for Wkhtmltopdf (a conversion tool for HTML to PDF generation) up and working on a Mac OSX machine - not as easy a task as it sounds.

Wkhtmltopdf is extremely cool. I've used qtwebkit for generating server-side page images before using python-webkit2png, and that's fine (unlike using Firefox running in xvfb!), but I need to produce PDFs. So, I looked around and found several neat, simple PHP wrappers for calling wkhtmltopdf, and even a PHP extension. "Great", I thought, "I'll just install that and spend time working on the layouts since the code looks really simple". I spoke too soon.

He goes through each step of the process - installing the needed wkhtmltox and libwkhtmltox support, having to manually compile wkhtmltopdf and some of the small changes you'll need to make to the Makefile to get things to cooperate. He shows where to put the resulting application files and the name of the extension to enable in your php.ini.

0 comments voice your opinion now!
compile osx wkhtmltopdf problem manual



Chris Hartjes' Blog:
Have a 'Strategy'
May 16, 2012 @ 10:42:29

In response to this suggestion from Alessandro Nadalin about using the "Strategy" design pattern to replace a switchChris Hartjes has this new post sharing his opinion of "the right way" do it it.

Once I realized what he was doing, I realized that the Strategy pattern was applicable in this case…but his chosen example was dumb and one that I wouldn't have used to demonstrate things. As expected, he told me to supply a sample of a better way. I did, telling him that the sample would be better if he didn't mash the logging level together with the message.

Included in the post is sample code, first showing the initial version of the logging class, complete with accompanying tests. Following that, he shows how to refactor it into something using the Strategy pattern, replacing the logging type switch statement with protected methods for each logging message type (critical, notice, etc).

0 comments voice your opinion now!
strategy designpattern refactor logging unittest


Symfony Blog:
Symfony Community Survey 2012
May 16, 2012 @ 09:05:21

The Symfony Project is running a community survey for developers using the framework. It asks some generic questions including "how long have you been working with Symfony?" and "how did you get to know Symfony?"

Symfony 2.0 has been released for quite a long time now, and so we would like to conduct a quick survey to get a better understanding of the Symfony community. I'm going to use some of the aggregated results for my Symfony Live keynote, and all the aggregated results will be published on this blog after the conference.

If you're a SenseioLabs Connect user, you can also get a badge for participating and will be included in a giveaway for tshirts and hats.

0 comments voice your opinion now!
community survey symfony project


Community News:
AtlantaPHP June Meetup - Introduction to Laravel
May 16, 2012 @ 08:25:42

The Atlanta PHP User Group has announced their latest meeting for June 2012 - an introduction to the Larvel framework from Ben Edmunds.

Are you ashamed to admit you're a PHP developer? Have you been using the same old, boring PHP framework for years? Tired of your PHP applications turning into enormous beasts? Maybe you've heard about Laravel but haven't made the effort to dive into it? In this presentation, we'll walk through what makes Laravel an elegant, fun, and exciting framework to make PHP applications that you'll be proud of.

The meeting is happening June 7th at 7pm at the Strongbox West on Defoor Place. Food will be provided and there'll be giveaways of AtlantaPHP and Laravel swag!

Have a user group meeting coming up you'd like posted? send it over and we'll get it posted!

0 comments voice your opinion now!
atlantaphp usergroup meeting june laravel framework



PHPMaster.com:
Using SPL Iterators, Part 1
May 15, 2012 @ 12:26:59

On PHPMaster.com today there's a new tutorial posted, the first part of a series, looking at the use of the Standard PHP Library (SPL) in PHP. In this first part of the series, Stefan Froelich looks specifically at two of the more common uses for iterators - working with arrays and directories.

When I first came across the term iteration and saw the overwhelming list of classes related to it in the SPL, I was taken aback. It seemed maybe iteration was too complex for me to grasp. I soon realized it was just a fancy word for something we programmers do all the time. [...] In the first part of this two-part series I'll introduce you to iteration and how you can take advantage of some of the built-in classes from the Standard PHP Library (SPL).

Included in the tutorial is example code showing how to use the ArrayIterator to work with an array and the DirectoryIterator to process the contents of a directory. He also briefly touches on a few other iterators like "FileExtensionFilter", "RecursiveDirectoryIterator" and "RecursiveArrayIterator".

0 comments voice your opinion now!
spl iterators tutorial array directory file recursive


MaltBlue.com:
Zend Form Mastery with Zend_Config - Part 2, Core Form Configuration
May 15, 2012 @ 11:04:01

In his previous post to the MaltBlue.com blog Matt introduced the concept of configuration-driven Zend_Form instances. He's back with a second part to the series, enhancing his original examples by covering some of the base-level form configuration settings.

Ok, this should have been part one, but irrespective, here's the second installment in zend form mastery with zend config - core form configuration. As the W3c Form spec says, there are 8 attributes applicable to forms.

These attributes, including "action", "name" and "onsubmit", can all be set easily in the XML-based configuration file. He includes an example of the full XML file to show how they all fit together (updated from part 1). You can see an example of the output here and can grab the source for the example from github.

0 comments voice your opinion now!
zendframework zendconfig zendform generation xml tutorial


Sean Coates' Blog:
PHP as a templating language
May 15, 2012 @ 10:58:37

In this new post to his blog Sean Coates talks about PHP as a templating language and why he (and Gimmebar) have decided to go another, more frontend-based direction.

For many years, I was a supporter of using PHP as a templating language to render HTML. However, I really don't buy into the idea of adding an additional abstraction layer on top of PHP, such as Smarty (and many others). In the past year or so, I've come to the realization that even PHP itself is no longer ideally suited to function as the templating engine of current web applications - at least not as the primary templating engine for such apps.

His reasoning is pretty simple - more and more web applications are becoming less and less server-driven. When building applications (and APIs) you don't know how the data will be consumed, so your frontend has to be agnostic. So, what's his current alternative of choice? The Mustache templating framework provides a simple way to create reusable templates (along with the compatible Handlebars Javascript library).

0 comments voice your opinion now!
templating language smarty mustache handlebars javascript api


Fabien Potencier's Blog:
Sami Yet another PHP API documentation generator
May 15, 2012 @ 09:18:49

Fabien Potencier has released a new tool to the open source community today - a documentation generation tool called Sami.

Nowadays, phpDocumentor version 2 is probably the best option out there as it has a good architecture, it works fine, it is extensible, and quite a few big PHP projects is already using it. And that's fine. I don't want to compete with it, I don't want to replace it, I'm just open sourcing some code used by Symfony, Twig, and Silex because I'm not comfortable with closed-source software. And to be totally honest and transparent, I have not released the code before because it was not "good enough".

He gives an example of how to install and use Sami - configuring the directories to parse and setting up a custom theme for the resulting generated documentation (using regular CSS and HTML definitions).

0 comments voice your opinion now!
sami generate documentation tool opensource


Voices of the ElePHPant Podcast:
Interview with Derick Rethans
May 15, 2012 @ 08:22:31

The Voices of the ElePHPant podcast has released their latest episode - an interview with Derick Rethans of 10gen and XDebug fame.

Cal's "three questions" for Derick involve

  • How did you come up with the idea and how did the project get started?
  • What's been the most fun and interesting part about building the community around XDebug?
  • What's the hardest lesson you've learned about running a project like XDebug?

You can listen to this latest episode either via the in-page player or by downloading the mp3 directly. You can also subscribe to their feed to get the latest as they're released.

0 comments voice your opinion now!
voicesoftheelephpant podcast interview community derickrethans



Community Events





Don't see your event here?
Let us know!


framework opinion language code zendframework2 introduction phpunit release unittest injection interview conference symfony2 voicesoftheelephpant dependency community application database podcast testing

All content copyright, 2012 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework