1
Mamba
Improving XOOPS Code: PHP CodeSniffer
  • 2009/8/31 6:23

  • Mamba

  • Moderator

  • Posts: 11251

  • Since: 2004/4/23


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/computer/other/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"

http://phpundercontrol.org/about.html

has anybody any experience with it?

2
sailjapan
Re: Improving XOOPS Code: PHP CodeSniffer

this should be a news article...

3
Mamba
Re: Improving XOOPS Code: PHP CodeSniffer
  • 2009/8/31 20:02

  • Mamba

  • Moderator

  • Posts: 11251

  • Since: 2004/4/23


OK, will do...

4
JulioNC
Re: Improving XOOPS Code: PHP CodeSniffer
  • 2009/9/1 1:46

  • JulioNC

  • Quite a regular

  • Posts: 239

  • Since: 2004/10/8


Thank You Mamba!
Don't forget CodeSniffer Netbeans Plugin

Well, for the moment only the version of CodeSniffer [1] is available in github and works in Linux Only :P

[1] http://www.whitewashing.de/blog/articles/119

5
Mazarin
Re: Improving XOOPS Code: PHP CodeSniffer
  • 2009/11/26 6:29

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


New version of Codesniffer plugin for NetBeans is available.
http://www.whitewashing.de/blog/articles/122

Compatibility greatly increased. Now works with Windows and version 6.7.1 (and apparently 6.8 beta too) of NetBeans.

6
Mamba
Re: Improving XOOPS Code: PHP CodeSniffer
  • 2009/11/26 7:52

  • Mamba

  • Moderator

  • Posts: 11251

  • Since: 2004/4/23


Great! Thanks for sharing!!!

Login

Who's Online

45 user(s) are online (21 user(s) are browsing Support Forums)


Members: 1


Guests: 44


heyula,

more...

Donat-O-Meter

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

Latest GitHub Commits