Developer News

Improving XOOPS Code: PHP CodeSniffer

Mamba  31-Aug-2009 20:04 6439 Reads  0
Obviously, everybody has a different coding styles, but in order to make it easier for everybody to read it, we need to follow certain "Coding Standards".

The current XOOPS Coding Standards are here

But how to make sure that everybody does it correctly, and there are no mistakes?

Here comes the PHP CodeSniffer, which we'll use going forward before each release.

We would also like every developer contributing code to XOOPS (be it to Core, or as individual modules) to check his/her work before submitting to SVN!

1) Install CodeSniffer:

If you're using WAMP, here are instructions to install PEAR, and then CodeSniffer:

http://www.webeks.net/programming/wamp-pear-installation.html

NOTE: there are currently problems with installing PEAR on PHP 5.3:

2) Set Zend as your default:

phpcs --config-set default_standard Zend


3) Run CodeSniffer

See:

http://pear.php.net/manual/en/package ... php-codesniffer.usage.php

I didn't compare the Zend standard with ours, but since our is based on Zend, then they should be very similar. If there are differences, we'll create our own customized standard file, based on our "XOOPS Coding Standards", as described here:

http://clockwerx.blogspot.com/2008/06 ... omise-phpcodesniffer.html

As we are moving forward it's important that we start using more and more tools that will help us with improving our code and our development process.

As next, I am looking at "PHP Under Control"

Has anybody any experience with it?

To discuss this topic, please visit this thread

Rating 0/5
Rating: 0/5 (0 votes)
Votes are disable!
Print article


Login

Username:
Password:

Lost Password? Register now!

Who's Online

52 user(s) are online (1 user(s) are browsing Publisher)


Members: 0


Guests: 52


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits

Categories