News Feed
Jobs Feed
Sections




News Archive
feed this:

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

Loosely Coupled Podcast:
Episode 2 My Code Is Perfect
April 16, 2014 @ 13:59:40

The Loosely Coupled podcast (with PHP community member hosts Jeff Carouth and Matt Frost) has released their latest episode, Episode #2: My Code is Perfect.

Writing clean code isn't something you pick up overnight, nor is it a brand new topic. In this episode Jeff and Matt discuss the characteristics and mechanics of creating clean code and how to approach your project from a clean code perspective. [...] In this episode, Jeff and Matt talk about code quality and beautiful code. Beautiful code follows a standard. If you don't have one, find one and adopt it.

There's some great notes in the post to accompany the recording with other suggestions, resources and links to other sources that can help you write cleaner, better code. You can listen to this latest episode either through the in-page player or by downloading the mp3 directly. You can also subscribe to their feed to get the latest episodes as they're released.

0 comments voice your opinion now!
looselycoupled podcast ep2 code perfect standard cleancode

Link: http://looselycoupled.info/blog/2014/04/14/episode-2-my-code-is-perfect/

Phil Sturgeon:
PHP-FIG Autoloaders, Amendments and The "15th Standard"
February 14, 2014 @ 09:04:47

Phil Sturgeon has a new post today looking at PHP-FIG and upcoming proposals the group currently has in progress. It also shares some of the problems with some of the current standards (including some amendments and replacements that need to happen).

I've managed to get myself involved in a lot of projects in and around the PHP community because I like to offer my advice, experience and time to trying to make things better. Recently, I've been putting in lots of time for bits around the PHP-FIG. Like it or not, tabs or spaces, PSR-2 or no, the PHP-FIG has had a huge impact on the PHP community and it's going to continue to do so. We have more PSR's in the works now that at any point before, and they're awesome ones.

He starts with a brief look at the next PSRs coming down the line: PSR-5 for PHPDocumentor standards, PSR-6 for a caching interface and PSR-7 with a standardized HTTP interface structure. He then gets into the problems around some of the current standards including the differences in autloading (PSR-0 vs PSR-4), the amendment process and a suggestion that PSR-2 (the coding standard) needs to be replaced.

0 comments voice your opinion now!
phpfig autoloader amendment psr5 psr6 psr7 psr2 standard

Link: http://philsturgeon.co.uk/blog/2014/02/phpfig-autoloaders-amendments-and-the-15th-standard

Pádraic Brady:
Coding Standards Humans Are Not Computers
February 11, 2014 @ 10:26:06

In his latest post Pádraic Brady shares some of his thoughts around coding standards and the existence of tools to be sure the code is exactly formatted correctly.

The problem with coding standards is not the notion of following conventions to ensure all programmer can quickly read and understand code (and other good stuff), but that someone created a tool to actually check compliance: PHP_CodeSniffer. This isn't a complaint about the operation of phpcs, but to complain about the mere fact of its existence. [...] Using the cover of such automated tools, we can make judgement calls about code quality, integrate style checks into Continuous Integration scoring schemes, complain about pull requests and patches, and generally impose a time penalty on writing code. There is a point at which common sense morphs into sheer nitpicking, and an automated tool is the perfect nitpicker.

In his opinion, coding standards should be "invisible and flexible" as well as easy to learn so the developers could learn and follow it quickly. He looks at these thoughts applied to the PSR standards and how adhering to them could quickly turn into something much more time consuming than it should. In his opinion a good coding standard is one that "limits the rules, eradicates ambiguity, formulates multiple use cases and avoids trivialities".

0 comments voice your opinion now!
coding standard psr phpcs codesniffer opinion

Link: http://blog.astrumfutura.com/2014/02/coding-standards-humans-are-not-computers/

Phil Sturgeon:
Composer now supports PSR-4
January 06, 2014 @ 09:59:36

As Phil Sturgeon notes in a recent post to his site, the Composer, the popular PHP package management tool, now supports the PSR-4 autoloading standard as defined by the PHP-FIG.

PSR-4 was voted in as an "accepted" PSR by the FIG in December. It took a little while to get done and went through a series of painful rewrites but when we have in the end is a document that reflects what this truly is: an improvement on PSR-0.

Today Jordi Boggiano merged a pull request by Andreas Hennings into master branch of Composer that contained support for PSR-4. Andreas was a massive help to the FIG while we were trying to shake the issues out of PSR-4 during Draft and Review stages, so he really outdone himself by providing the code too.

Phil makes a few suggestions about moving to PSR-4 including: not moving immediately, making a "psr4" branch to test it out and points to an example of how to do it. More information on PSR-4 and Composer can be found in the official documentation.

0 comments voice your opinion now!
composer psr4 autoload standard phpfig support

Link: http://philsturgeon.co.uk/blog/2014/01/composer-now-supports-psr4

The Nerdery:
Is my code compatible with PHP 5.4 or 5.5?
November 06, 2013 @ 11:15:40

On The Nerdery's blog today there's a new post that shows you a way to help test your code for PHP 5.4 and 5.5 - via PHP_CodeSniffer - as well as mentioning some of the changes that came with these versions.

Do you want to know if your code is compatible with that latest version of PHP? Do you need to upgrade your existing PHP website to a newer version of PHP? Do you want to see if your legacy PHP code is using any features that have been removed or deprecated in later versions of PHP? [...] ou need to migrate your existing code to ensure nothing will break when the upgrade occurs. How can you accomplish that?

They start with the list of differences (and backward incompatible changes) in the newer versions and point to the migration pages for each. Then they get into the use of PHP_CodeSniffer and some additional rules provided by Win Godden for checking the compatibility. With these added in, you can call the "phpcs" checking tool with the "PHPCompatibility" standard and check out the results. An example of what you might see on an older application is included in the post.

0 comments voice your opinion now!
code compatible update versions phpcodesniffer standard phpcompatibility

Link: http://blog.nerdery.com/2013/11/code-compatible-php-5-4-5-5/

Qandidate Blog:
Running symfony standard edition on HHVM
October 23, 2013 @ 12:25:34

On the Qandidate.com blog they have a new post (the second in a series, actually) about getting a Symfony application running on HHVM, the virtual machine version of the HipHop engine originally developed by Facebook. In this second post they show how to install and configure Symfony in a newly installed HHVM instance.

In part one of this series we talked about "Getting started with HHVM" by getting a compiled version of HHVM running in a vagrant box. In this part we'll configure the HHVM webserver to run the symfony standard edition.

They include full instructions for getting the full Standard edition of Symfony, installing Composer and configuring the HHVM server to correctly point to the application's document root. There's also virtual host and static file configurations included too. There's a few changes that need to be made on the Symfony side as well around session storage and timezones. When the server is started up and all goes well, the default Symfony page should come up when you visit the right address.

0 comments voice your opinion now!
symfony standard hhvm configuration setup tutorial

Link: http://labs.qandidate.com/blog/2013/10/21/running-symfony-standard-on-hhvm/

Reddit.com:
PSR-6 Caching Interface and PSR-5 PHPDoc enter Draft status
August 28, 2013 @ 15:30:29

As is mentioned in this Reddit post, two new PSRs have officially entered "Draft" status - PSR-5 for PHPDocumentor standards and PSR-6 related to caching implementations.

PSR-4 got to draft status a week ago and the other day it went into Review status. I pushed it to Review quickly as its already been around for several months (before this new workflow existed) so there didn't seem like much point in waiting. In less than two weeks we can put that in for an acceptance vote and we will have a new autoloader! Excellent. More good news from the FIG is that PSR-5 and PSR-6 are officially coming onto the scene, both now in Draft status too!

PSR-5, the PHPDoc standard, is more of an inclusion (and update) of most of the current standards people use when writing their PHPDoc comments, just more formalized by the PHP-FIG. PSR-6 is newer and is more akin to the logging PSR, defining the basic interface for an interchangeable caching layer. You can read more about each of the proposals in the mailing list: PSR-5: PHPDoc and PSR-6: caching.

0 comments voice your opinion now!
phpfig psr5 psr6 caching phpdocumentor phpdoc standard interface

Link: http://www.reddit.com/r/PHP/comments/1la27y/psr5_caching_interface_and_psr6_phpdoc_enter/

Community News:
PHP-FIG Proposal - Resource Location
June 19, 2013 @ 10:55:29

A new proposal has been made to the PHP-FIG group that would provide resource locator functionality as a standard part of an application's structure.

This specification proposes to refer to files and directories through URIs. [...] These URIs can have different schemes ("classpath", "file" etc.), but only the scheme "file" is specified in this document. The resource locator is able to turn URIs into file paths which can be read or included by PHP code. The general goal of this PSR is to locate files (PHP, XML, YAML, INI, JPG, etc.) and directories in a generic way. For example, there should be a unified notation to refer to the file of a class ABCD and other files located in the same directory (or nested directories).

Code snippets are included showing a pseudo-code interface to this locator with five requirements:

  • Locate files relative to classes
  • Locate both directories and files
  • Short identifiers when the context is known
  • Locate resources independent from PHP classes
  • Support resource overriding

There's also some definition as to what is meant by a "resource location" and how the URIs should be structured and located.

0 comments voice your opinion now!
phpfig proposal resource location framework interoperability standard psr

Link: https://github.com/bschussek/fig-standards/blob/master/proposed/resource-location.md

PHP Town Hall Podcast:
Episode #6 - PSR-X and the Mexican Standoff
April 22, 2013 @ 09:56:57

The PHP Town Hall podcast has released the latest episode of their show - Episode #6, "PSR-X and the Mexican Standoff".

PHP-FIG member Paul M. Jones and PHP contributor Anthony Ferrera come on the podcast with Ben, Phil and regular guest Zack Kitzmiller to discuss the new Package Orientated Autoloader Proposal (a.k.a PSR-X), and wether or not PSR's should ever be amended.[...] Nobody wins, but the argument brings up a lot of interesting topics and points of view, and that is mostly what we are here for.

You can listen to this latest episode either through the in-page player by downloading the mp3 or by subscribing to their feed. The post also contains links to several of the groups and technologies mentioned in the episode.

0 comments voice your opinion now!
phptownhall podcast psr standard standoff anthonyferrara zackkitzmiller

Link: http://phptownhall.com/blog/2013/04/19/episode-6-psr-x-and-the-mexican-standoff

Tom Butler:
PHP PSR-0 Pretty Shortsighted, Really
April 16, 2013 @ 13:12:14

In a new post to his site Tom Butler gives some reasoning as to why he thinks PSR-0 is shortsighted and some examples of a possible better alternative.

A little background for those unaware of what PSR-0 is: There's a self-declared PHP "standards" group called PHP-FIG attempting to push several "standards" throughout the PHP community. [...] I have little interest in debating the politics behind pushing standards or whether small groups of developers trying to make decisions that affect the entire community is good or not, but I do object to the PSR-0 standard itself. My issues are purely practical, PSR-0 reduces flexibility and makes life more difficult for developers

While he likes the idea of a standard way to be able to include third-party libraries that can be reused in multiple systems, he suggests that it answers the wrong question. In his view, it should be up to the library/tool developers to ensure the structure of their code to work with a standard, not the other way around. He points out that a "standard" is something that should apply to all situations and some of the workarounds that are needed for PSR-0 negate this idea.

In his alternative method, he suggests an "Autloadable" interface that can be implemented by the library/tool that includes a "load" method to handle the actual class loading. Then this autoloader would be registered via a json configuration file for the package. This allows the developer to control the loading and place any exceptions they might need into their own logic instead of trying to work around possible issues with the PSR-0 loading scheme.

PSR-0 is a bad solution to a good problem. If you take anything from reading this post, remember this: If the standard defined how autoloaders could be extended, rather than how autoloaders worked, then each library or vendor could provide its own extension to the autoloader and everyone would be happy.
0 comments voice your opinion now!
psr0 autoload standard opinion shortsighted alternative

Link: http://r.je/php-psr-0-pretty-shortsighted-really.html


Community Events











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


podcast install language opinion framework unittest release security facebook application composer series code example introduction hhvm component package hack symfony2

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