News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Stephan Hochdörfer:
Defining Phing Tasks in PSR-0 style
January 23, 2015 @ 10:42:49

In his latest post Stephan Hochdörfer shows you how to define Phing tasks according to the PSR-0 autoloading format. Phing is a PHP-based automation tool that uses an XML configuration to execute a series of tasks.

Before anybody complains: I know that "as of 2014-10-21 PSR-0 has been marked as deprecated. PSR-4 is now recommended as an alternative." - Anyway I still think this little gem makes sense to be shared because a lot of people are probably not aware of it. I recently found out by accident that it is possible pass a task name in PSR-0 style to the "taskdef" task. In the old days you had to use the Java-like dot-style notation like this and also define the classpath to make sure the class could be loaded correct! This is ok if the task resides in the same project. If the task is located in a dependent package loaded via Composer this can get ugly.

The post is quick but provides two very handy code examples, one showing the old "dot notation" version and the other showing how to make use of the autoloader. The trick is in the classname value and using the full namespace/class name rather than the dot notation.

0 comments voice your opinion now!
phing build task psr0 classname path autoload

Link: http://blog.bitexpert.de/blog/defining-phing-tasks-in-psr-0-style/

Zend Developer Zone:
ACRONYM or MixedCasing in Zend Framework 2? You decide!
July 12, 2010 @ 13:54:57

On the Zend Developer Zone there's a new post from Matthew Weier O'Phinney asking a question of all of the Zend Framework users out there - which do you prefer - ACRONYM or MixedCasing for how acronyms are presented in class names.

As an example, many suggest that "Zend_PDF" is more semantically correct and easier to remember than "Zend_Pdf". On the other side of the coin, many developers feel that our MixedCasing or Titlecasing of acronyms is a simple, easily learned rule that makes typing easier. For ZF2, we started converting code to use each acronym's proper casing. However, we're not done yet, and there are good arguments on both sides of the debate.

They've set up a survey on the topic and encourage as many people as have opinions to go and cast their vote. The survey will close in about a week, so be sure and make your thoughts heard on the matter before then!

0 comments voice your opinion now!
acronym mixedcase classname zendframework



Community Events

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


laravel5 unittest extension php7 version podcast opinion interview language voicesoftheelephpant laravel community introduction release example library framework list api series

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