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

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/

Carl Vuorinen:
Installing SonarQube with Jenkins integration for a PHP project
September 04, 2013 @ 10:50:25

Carl Vuorinen has posted a tutorial about getting SonarQube to run on your codebase (with the help of Jenkins). SonarQube runs statics on your application including lines of code, number of classes, enforcement of coding standards and duplicated code.

n this second part of my Continous Integration setup I will detail the steps required to install SonarQube (previously called just Sonar, renamed to SonarQube with 3.6 release just a few days ago) and integrate it with the Jenkins server from the previous post so SonarQube will run a daily analysis of our PHP project. In the previous post I covered the installation of Jenkins on a CentOS server and integrated it with GitHub, so if you do not have Jenkins set up you might want to start there.

He talks a bit about what SonarQube can do for you and the features it includes as well as links to a screencast and live demo. From there he gets into the setup and configuration, broken down into steps:

  • Installing SonarQube (with yum)
  • Creating the MySQL database it needs
  • Installing SonarQube Runner
  • Installing PHP environment for SonarQube
  • Integrating SonarQube with Jenkins

There's a quick note at the end about some things that can be done to optimize and clean up the installation too.

0 comments voice your opinion now!
sonarqube jenkins code analysis project tutorial install configure

Link: http://cvuorinen.net/2013/07/installing-sonarqube-with-jenkins-integration-for-a-php-project/

Phil Sturgeon:
PHP Static Analysis in Sublime Text
August 21, 2013 @ 09:49:59

Phil Sturgeon has put together a new post for his site showing you how to set up static analysis of PHP code in the Sublime Text editor using various tools.

Coding Standards have been around for the longest time and recently they're starting to become more widespread in PHP. While learning Python I really enjoyed how Sublime Text 2 would shout at me for using too many empty lines, using tabs instead of spaces and even things like declaring unused local variables, importing modules that were never used, etc. This was pretty cool, and I was soon writing beautiful Python code without any concern over which way things should be done. I've been doing this with PHP for the last year, but trying to get a new-hire going with this stuff was hard. We smashed through it taking notes so now I've written it up for you guys.

He's broken it down into a few different steps (three of them) to get things like the right version of PHP, PHPMD and PHP_CodeSniffer installed and configured. There's a few config settings you'll need to change in Sublime to get things working correctly, but it's a relatively painless setup.

0 comments voice your opinion now!
static code analysis phpmd phpcs sublimetext install configure

Link: http://philsturgeon.co.uk/blog/2013/08/php-static-analysis-in-sublime-text

Christopher Martinez:
Static code analysis tools for PHP
May 08, 2013 @ 12:38:22

Christopher Martinez has a recent post to his site that covers some of the static analysis tools available for PHP including the PHP Mess Detector, PHP CodeSniffer and the PHP Analyzer.

I believe in writing code that is easy to understand, easy to test, and easy to refactor. Yes, I realize that the statement above is pretty general and open to interpretation. Not everyone needs external tools to ensure quality in their code...but, I work on things from time to time that have absolutely no tests. [...] For whatever reason, this happens a lot more frequently in the PHP world. I'm guilty of not writing tests and checking how I write code, sometimes, too. Things are bright, though, for the PHP community - for quite some time now, we've had fantastic tools that assist us in writing better code.

He covers each of the tools, talks some about what they're good for and gives examples of their use, including output. He also talks some about the Pfff set of tools created by Facebook. He also talks some about how these tools fit into his daily work as a part of his pre-commit hooks in git.

0 comments voice your opinion now!
static code analysis tools description example

Link: http://chrsm.org/2013/05/05/code-analysis-tools-for-php

Project:
PHPHint.org - Online PHP Code Analysis
August 08, 2012 @ 10:18:59

Klaus Silveira has submitted a project he's come up with to help PHP developers detect problems in their code via a web-based application - PHPHint.org.

PHPHint is a community-driven, quick and easy to use, online tool that analyzes your PHP code and looks for potential errors, lack of best practices and code smell. It also allows you to clean your code automagically.

It was created to spread the work about the PSR standards and the PHP-FIG group, the importance of getting rid of code smell and applying to standards.

Since it is an open source project, you can help contribute if you'd like to see improvements to the service. It's great that it takes the relatively new PSR standards (PSR-1 & PSR-2) into account when analyzing the code too.

0 comments voice your opinion now!
phphintorg code analysis online psr1 psr2


Lorna Mitchell's Blog:
PHP Static Analysis Tool Usage
August 03, 2011 @ 10:50:22

In an informal poll Lorna Mitchell recently asked fellow developers to weigh in on what static analysis tool they used on their code. She's posted the results to her blog today with one of the tools being a clear winner.

My interest was mostly because I'm working on a book chapter which includes some static analysis content, and there are a couple of these tools that I include in my own builds, but I don't do much with the output of them. However I didn't want to drop anything from the chapter if it was actually a valuable tool and I was just missing the point - pretty much all the tools got a good number of votes though, so I'll be covering all of the [options].

According to her results, the most used tool by developers is the PHP_CodeSniffer with the PHP Mess Detector and PHP Copy & Paste Detector tied for second place.

0 comments voice your opinion now!
poll results static analysis tool codesniffer phpmd phpcopypaste


Gonzalo Ayuso's Blog:
Performance analysis fetching data with PDO and PHP.
March 28, 2011 @ 08:12:20

Gonzalo Ayuso has a new post to his blog today with the results of some performance analysis he ran when fetching data with PHP and PDO.

Fetching data from databases is a common operation in our work as developers. There are many drivers (normally I use PDO), but the usage of all of them are similar and switch from one to another is not difficult (they almost share the same interface). In this post I will focus on fetching data.

He includes his sample scripts - one using just fetch() and the other using fetchAll() - that include some timing and memory checking logic and includes the results of his "limit 10000" queries from his tables. Not surprisingly, the fetchAll required more memory than the fetch call. Event changing it to a loop of fetch() methods results in about the same amount of memory as a fetchAll.

0 comments voice your opinion now!
performance analysis benchmark pdo fetch fetchall memory


Gonzalo Ayuso's Blog:
Performance analysis using bind parameters with PDO and PHP
October 06, 2010 @ 08:57:02

Gonzalo Ayuso has posted the results of some performance testing he did with bind parameters in a PDO-based request for his application.

Some months ago a work mate asked me for the differences between using bind variables versus executing the SQL statement directly as a string throughout a PDO connection. Basically the work-flow of almost all database drivers is the same: Prepare statement, execute and fetch results. [...] What's the best one? Both method work properly. The difference is how databases manage the operation internally.

He gives two code examples, one with the bind parameters and one without, and the benchmark code he used to generate his statistics. It uses a PDO connection to execute several statements in a row both with bind parameters and without, measuring the time (with microtime) and outputting the results. His results show that while the simple update is faster, the bind parameter method has the added benefit of reusability for multiple queries.

0 comments voice your opinion now!
performance bind parameters pdo analysis benchmark


Etienne Kneuss' Blog:
Dataflow Type Analysis for PHP
January 14, 2010 @ 11:32:55

Etienne Kneuss has posted about a dataflow type analysis tools he's created that models code as control flow graphs.

It will assign types and let them flow through control structures. When reaching stability, it will check that the operations done of the values are sound type-wise. It will also do some structural checks.

There's some more technical details here and a presentation here but if you want to get at the code, you can grab it off of the project's github page.

0 comments voice your opinion now!
dataflow type analysis controlflow graph


Blue Parabola Blog:
Magento Feature Analysis Series
December 15, 2009 @ 09:56:56

In case you missed the whole series of posts that Matthew Turland did on the Magento e-Commerce platform, he's summed them all up in a new post to the Blue Parabola blog.

The new kid on the PHP e-commerce block, Magento, has gotten a good amount of attention leading up to and since its initial release. Earlier this year, I was entasked with doing an analysis of its features and thought it might make for an interesting series of blog posts. What you see here is the result. Comments are welcome, thanks in advance for your contribution.

Topics in the series covered the catalog browsing, customer service, shipping and SEO features the popular software has to offer.

0 comments voice your opinion now!
magento feature analysis series ecommerce



Community Events





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


deployment framework podcast release api list tips development code introduction threedevsandamaybe language series zendserver community laravel application developer symfony interview

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