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

Acquia Blog:
PHP Under the Hood, Running the Web
December 10, 2014 @ 12:08:01

The Acquia blog (of the Drupal community) has posted another in their series of guest posts with members of the wider PHP community. In this latest post well known PHP speaker and developer Michelangelo van Dam talks about PHP as a language that's "Under the Hood, Running the Web".

Most non-technical people out on the Web haven't heard of PHP before. They might not have even heard of many of the products that were built with this technology like Drupal, Magento, or WordPress. And together with other products built with PHP, these run about 83% of all internet web applications. The technology of PHP is very important to an enormous number of businesses, governments, and organisations around the world, so even though people might not be familiar with the language itself, there's a very good chance they've used it online today.

He talks about the recent movements in the PHP community to be more standards-driven and focusing on better performance overall (both in applications and the language itself). He points to the work the Drupal community has done adopting Symfony components and the gains it gives them. He also mentions the huge impact things like Composer and the PHP Framework Interoperability Group have had on the PHP community and ecosystem.

Yes, the future of PHP looks very promising and the community is on a roll. [...] With strong communities working hard on each technological level and better able to cooperate than ever before, PHP will prevail where other technologies have failed. And let's have fun while we're at it!
0 comments voice your opinion now!
acquia blog michelangelovandam underthehood improvement standards interoperability

Link: https://www.acquia.com/blog/php-under-hood-running-web

Phil Sturgeon:
Send PSR-0 to the Standards Farm in the Sky
July 21, 2014 @ 09:09:26

In his latest post Phil Sturgeon makes a request of the PHP community - to "send PSR-0 to to Standards Farm in the Sky". Or, to put it another way, deprecate it in favor of the more recent autoloader handling of PSR-4.

This article attempts to convince you that deprecating the PSR-0 auto-loading standard in favor of the PSR-4 auto-loading standard is not only a good idea, but a problemless wonderland of happy benefits, in the hope that when I try to get this done on the FIG mailing list, people will be happy about it instead of sad or rage-mode. [...] I believe it was talked about as an alternative at the time because we knew that the PHP community would drop their collective bricks if we tried to pull PSR-0 out from under them, right as they were just slowly getting used to using it.

He covers a few different topics and his opinions on each including the "hate" for PSR-0 (for wanting to get rid of it) and why it should even be considered for deprecation in the first place. He also reminds readers that he's advocating the deprecation of PSR-0, not the removal of it as a standard. It can still exist and be used but it will no longer be the "moving forward" method of autoloading (in favor of PSR-4). He also comments on the large user base out there on PHP <=5.2 that wouldn't be able to make the update to PSR-4 and a suggestion to projects wanting to encourage the migration.

0 comments voice your opinion now!
deprecate psr0 standards psr4 autoload

Link: http://philsturgeon.uk/blog/2014/07/deprecate-psr0

Codacy.com:
Review of PHP Static Analysis Tools
May 09, 2014 @ 11:35:15

The Codacy.com blog has posted a review of various static analysis tools for PHP-based applications. These tools can help provided quality and consistency in your code in a more automated way.

Maintaining code quality over time is a hard challenge. It becomes even harder in large projects developed by many programmers. Each person has different code styles and different ways to approach problems. Over time, this may result in confusing and unmaintainable code. Static analysis tools can help developers solve this problem, they enforce coding standards, detect common errors and cleanup code blocks.

Tools mentioned in the post include: PHP_CodeSniffer, the PHP Mess Detector and the PHP Copy & Paste Detector. Each comes with an example of the command to execute it and some sample results. They also talk briefly about where and how these tools could fit into your current workflow, either during development or as a part of a full deployment process.

0 comments voice your opinion now!
static analysis tool list review standards quality integration

Link: http://blog.codacy.com/2014/05/06/php-static-analysis-tools/

Zumba Engineering Blog:
Enforce code standards with composer, git hooks, and phpcs
April 15, 2014 @ 09:13:48

The Zumba Engineering blog has a new post looking at a way you can control code quality and standards with the help of Composer, git hooks and the PHP Code Sniffer (phpcs) tools.

Maintaining code quality on projects where there are many developers contributing is a tough assignment. How many times have you tried to contribute to an open-source project only to find the maintainer rejecting your pull request on the grounds of some invisible coding standard? [...] Luckily there are tools that can assist maintainers. In this post, I'll be going over how to use composer, git hooks, and phpcs to enforce code quality rules.

These three technologies are combined together to make a more seamless experience for the developer while keeping the code quality high. Their method makes use of the "scripts" (post-install-cmd) feature of Composer to, after the installation of all packages, set up a git hook script that will run the phpcs checks on pre-commit. It's a pretty simple shell script that kicks back any errors it might find before the user can commit their changes.

0 comments voice your opinion now!
code standards composer git hook phpcs codesniffer install precommit

Link: http://engineering.zumba.com/2014/04/14/control-code-quality

SitePoint PHP Blog:
Git Hooks for Fun and Profit
September 25, 2013 @ 12:45:21

If you're a git user (you do use git, right?), there's a powerful feature that can help perform some automatic actions in your repositories - git hooks. In this new post to the SitePoint PHP blog, Timothy Boronczyk introduces you to them and how to set them up.

When certain commands are run, Git searches the .git/hooks directory for suitable hook scripts which are then executed if found. You'll find a small set of example scripts there (you can activate them by renaming them to remove the .sample prefix and setting their executable bit), and a complete list of hooks can be found in the githooks(5) man page. This article suggests a handful of hooks which can streamline development and help improve your efficiency.

He gives four different examples of checks based on the state of the commit (like pre-commit or post-commit):

  • Lint Checks
  • Spell-Check Commit Messages
  • Checking Standards
  • Automatically Run Composer

Each comes with the example code needed to implement them and some description about what they're doing.

0 comments voice your opinion now!
git hooks introduction example lint spelling standards composer

Link: http://www.sitepoint.com/git-hooks-fun-profit

Federico Cargnelutti:
API Development Tips
July 17, 2013 @ 13:50:45

Federico Cargnelutti has a quick post to his site today sharing some general API tips you could follow when creating your backend application.

Organizations who are paying attention already know they need to have an open web API, and many already have under development or in the wild. Make sure you haven't been caught by the pitfalls of many early API releases.

He briefly mentions the idea of having multiple points of failure and includes five more general tips based on information from this video:

  • Test it all
  • Plan for future versions
  • Embrace standards
  • Monitor everything & be honest
  • Fail well
0 comments voice your opinion now!
api development tips list video test version standards monitoring fail

Link: http://blog.fedecarg.com/2013/07/17/api-development-tips

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

Chris Hartjes:
Standards, Soapboxes, and Shamans
January 21, 2013 @ 13:16:47

In this latest post to his site Chris Hartjes shares some of his thoughts about the recently approved PSR-3 standard (for logging) and some of the reception that the other PSRs (PSR-0, 1 & 2) have gotten from the PHP community.

For those who pay attention to the workings of the PHP community you might have heard about the "PHP Standards Recommendations" that have been coming out of the PHP Framwork Interop Group. [...] More recently this group has been working on a standard for logging interfaces called PSR-3. I spoke about this on Twitter, and I will repeat it here: I think PHP programmers should get behind PSR-0 and efforts like PSR-3. I feel that PSR-1 and PSR-2 are solutions looking for a problem and seem, to me anyway, to me out of place with the solutions offered by PSR-0 and PSR-3.

He likens the PHP PSRs to the Python enhancement proposals (PEPs) and, more specifically, to the PEP-8 - their own version of "coding standards" that was highly championed by Guido van Rossum and put into wide practice.

Any programming language community that does not work as hard as possible to make it easier to integrate other's libraries of code together [by standardizing their formatting] is asking for irrelevancy.
0 comments voice your opinion now!
standards psr0 psr1 psr2 psr3 community feedback python pep


Matthew Weier O'Phinney:
On php-fig and Shared Interfaces
December 21, 2012 @ 11:45:37

In his most recent post Matthew Weier O'Phinney (lead on the Zend Framework project) takes a look at the PHP Interoperability Group (php-fig) and some recent discussions that have come up about shared interfaces for things like logging and caching.

A little over a year ago, there was a new push by a number of folks wanting to do more. Paul Jones did a remarkable job of spearheading the next two standards, which centered around coding style. [...] And this is when we started seeing proposals surface for shared interfaces, first around caching, and now around logging (though the latter is the first up for vote).

He talks a bit about shared interfaces - what they are and what kind of problem they aim to solve - and how he's not sure he "buys into them". He notes that "sharing is good, developing solutions is better" and stresses making it easier to operate with each other and not worry so much about standardized interfaces.

He's found a few problems with the concepts behind them like the Not Invented Here (NIH) idea they promote and that there's not really just a single solution to these kinds of problems ("space for multiple implementations"). He suggests an alternative to the idea of these shared interfaces - bridges/adapters. He illustrates this idea with some code showing the implementation of a "CacheInterface" and a "FrameworkACache" adapter that wraps the functionality of a "CacheItem" class that might be internal to your application already.

0 comments voice your opinion now!
phpfig framework interoperability standards interface shared


Richard Rodger:
Why I Have Given Up on Coding Standards
December 05, 2012 @ 13:17:48

In a recent (controversial) post Richard Roger talks about why he's given up on coding standards and includes a few of the reasons that might make you think about your own proceses.

Every developer knows you should have a one, exact, coding standard in your company. Every developer also knows you have to fight to get your rules into the company standard. Every developer secretly despairs when starting a new job, afraid of the crazy coding standard some power-mad architect has dictated. It's better to throw coding standards out and allow free expression. The small win you get from increased conformity does not move the needle. Coding standards are technical ass-covering.

He walks through the evolution of the average developer, the trip from their infancy of "just writing code" to the point of understanding that there needs to be standards to make code easier to read and understand. He includes a list of five "sins of control" that might make coding standards more desirable.

There are worse sins than these. You only need one of them to end up with a coding standard. The truly evil thing about coding standards is what they do to your heart, your team's heart. They are a little message that you are not good enough. You cannot quite be trusted. Without adult supervision, you'll mess up.

As you'd expect, there's plenty of comments on the post, so enjoy reading and maybe contribute some of your own.

0 comments voice your opinion now!
coding standards opinion hurt control freedom



Community Events





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


introduction list voicesoftheelephpant conference community framework opinion library symfony laravel podcast release interview security version composer artisanfiles series tool language

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