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

Peter Petermann:
Composer & Virtual Packages
September 30, 2014 @ 13:27:36

Peter Petermann has an interesting post he's added to his site describing a lesser known feature of the Composer package manager: virtual package support.

A few days ago i stumbled over a "virtual package" on packagist - and found it to be a feature that i was actually missing in composer. Turns out, composer can do it, its just not so well documented. So what is this about? Virtual packages allow you to have a more loose dependency. Rather than depending on a specific package, you depend on a virtual one, which can be fulfilled by all packages that provide the virtual one.

He includes a few examples to help illustrate the point of using virtual packages. The first describes an application that wants to use the PSR-4 logger structure but depends on "log-implementation" (a virtual package) rather than the "psr/log" package. The key is in using the "provide" keyword in the Composer configuration. His other two examples expand on this a bit, one showing the use of the "provide" keyword to define the relationship and the other of an actual application making use of this package.

0 comments voice your opinion now!
composer virtual package provide library tutorial psr log

Link: http://devedge.wordpress.com/2014/09/27/composer-and-virtual-packages/

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/

PHPBuilder.com:
What is PHP-FIG and What are They Doing?
January 22, 2014 @ 12:42:43

You may of heard about the PHP-FIG group but aren't quite sure what they're about or what they've produced so far. In this new post on PHPBuilder.com, they get into some of the details of the group, including descriptions of the currently released PSRs.

If you have been watching the development of PHP over the last few years, you will know all about the problems with the language. The standard story is that PHP is a fragmented language, it is a language for hacks, there is no real specification, and so on and so forth. The reality is that PHP has grown up a lot recently. PHP 5.4 brings the language closer to a complete object model, and supplies a lot of new functionality. So far, so good. But what about frameworks? [...] PHP-FIG is the short name for the PHP Framework Interop Group (am I the only one who finds the naming of PHP groups and libraries after fruits amusing?) and their mission is simple: to find a way to get the PHP frameworks to work together.

They cover some of the members of the group (well, the projects represented) and look at each of the PSRs in detail:

  • PSR-0 - Autoloading Standard
  • PSR-1 - Basic Coding Standard
  • PSR-2 - Coding Style Guide
  • PSR-3 - Logger Interface
  • PSR-4 - Improved Autoloading
0 comments voice your opinion now!
phpfig psr introduction framework interoperability group

Link: http://www.phpbuilder.com/articles/application-architecture/optimization/what-is-php-fig-and-what-are-they-doing.html

Brandon Savage:
You don't need a framework
January 09, 2014 @ 09:56:51

In the most recent post to his site Brandon Savage suggests that choosing and using a framework for you application isn't even needed.

Looking through the list of PHP frameworks can be daunting. Zend Framework. Laravel. Cake. Symfony. Picking one and learning it can seem like the most important design decision you'll make. And yet, picking a framework is actually one of the least important decisions you face. In fact, you don't need a framework at all.

He starts with a brief history of (PHP) frameworks and talks about their evolution from a set of common libraries out to the full stack versions we have today. He moves on to the "PSR and Composer era" where the lines started to blur a bit. With the renewed emphasis on packages in an easy to install method, frameworks started to become less important.

Now, instead of having a bunch of siloed frameworks that can't work together, there are (supposedly) standards for how they can integrate. An added bonus is that library creators can follow the same standards, making their libraries compatible with all the frameworks that implement the PSR standards.

You can read a rebuttal to this post from Anna Filina on her site.

0 comments voice your opinion now!
framework need library package composer psr opinion

Link: http://www.brandonsavage.net/you-dont-need-a-framework

Lorna Mitchell:
PSR-What?
July 16, 2013 @ 11:19:10

For those out there that might have heard comments made about the PSRs (PHP Standards Recommendations) but aren't quite sure what they're about, Lorna Mitchell has posted an introduction to the three currently approved standards.

There's been some cool things happening in the PHP world over the last few years, but with the least helpful names ever ... yes, those PSR-somethings which all do totally different things (apart from two of them which are the same). They're actually all superb things, and done for a good reason, so I thought I'd try to translate them into normal speak.

She goes through each of the three, explaining what they are and how they could affect your applications:

  • PSR-0 is for autoloading
  • PSR-1 and PSR-2 are for Coding Standards
  • PSR-3 is for Logging

There's no code included in the post showing how they'd be implemented but there are links back to the standards themselves.

0 comments voice your opinion now!
psr standards recommendation autoloading codestandard logging

Link: http://www.lornajane.net/posts/2013/psr-what

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

NetTuts.com:
PSR-Duh!
April 12, 2013 @ 10:46:26

On NetTuts.com today there's a post that talks about applying the PSR formatting to your application's code. If you haven't already read their introduction to the PSRs, it's highly suggested.

In a previous lesson here on Nettuts+, you learn about PSR; however, that article didn't detail the process of integrating that coding style into your projects. Let's fix that!

They briefly recap the main two PSRs (PSR-1 and PSR-2, but no mention of PSR-3 the logging interface) and show code examples of them being applied. They also point to the PHP_CodeSniffer tool that you can use to keep your code in the correct structure. Instructions are included to install it specifically for the Sublime Text 2 editor via package control. It's just a command-line tool, though, so it could be integrated with just about any other editor/IDE out there too.

0 comments voice your opinion now!
psr psr1 psr2 apply autoload formatting phpcodesniffer

Link: http://net.tutsplus.com/tutorials/tools-and-tips/psr-duh

Phil Bennett:
Do We Need a Framework For That? Or Hurry Up PHP-FIG
April 10, 2013 @ 13:38:48

In this recent post to his site, Phil Bennett shares some thoughts about the PHP-FIG, the standards they're proposing and how the shares interfaces might help reduce dependencies in framework-based applications.

[Frameworks] come in several different flavours that all have huge advantages, but also a few disadvantages. Over engineered (because their popularity demands that they be), updated too often, not updated enough. If you decide for example to update your application from using Zend Framework 1 to using Zend Framework 2, this will more than likely require, at least in part, a re-write of your code. This makes scalability difficult.

He talks some about the PSRs that the PHP-FIG group has proposed including the PSR-3 logging interface structure. He points out that, by having this same structure, it makes injecting dependencies easy while still leaving the actual functionality open to interpretation. He also suggests that maybe a framework isn't the right choice for all applications and that possibly using a collection of libraries, tied together by the PSR standards, could be a better answer.

0 comments voice your opinion now!
phpfig psr framework interface shared standard

Link: http://happyaccidents.me/blog/do-we-need-a-framework-for-that

Riding an Elefant:
PHP-FIG's challenges, efficacy and attitude
March 01, 2013 @ 11:02:34

On the "Riding an Elefant" blog (for the Elefant CMS) there's a new post that looks at some of the "challenges, efficacy and attitude" of the PHP-FIG (Framework Interoperability Group) surrounding their PSRs and general direction.

First, I should state that I'm not a member of PHP-FIG. I applied to be a member representing the Elefant project, but saw projects with similarly-sized communities rejected, so I wasn't surprised at the lack of response to my application. However, I do agree with the general goals of the project and think it has a lot of potential if steered well.

He then spends a good bit of the post talking about the three PSRs (autoloading with PSR-0 and coding standards with PSR-1 & PSR-2) and how he thinks the PHP-FIG has some "public relations" issues they need to overcome as it relates to their reactions.

PHP-FIG has grown rapidly since its inception, and with that comes the need to reevaluate and adapt. The PHP community is huge, and a group hoping to represent even a substantial minority of it will have to practice diplomacy and clearly state its intentions if it doesn't want to be misunderstood or cause alienation amongst the wider community.

There's also some good comments on the post so be sure to check those out too.

0 comments voice your opinion now!
phpfig challenges efficacy attitude psr opinion standard



Community Events





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


api install unittest opinion voicesoftheelephpant deployment bugfix community release interview symfony library zendserver introduction language laravel package series framework podcast

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