The PHP Static Code Version Checker
Go to file
John Bintz 6820bf4890 fix some small errors 2008-10-21 20:01:11 -04:00
build embed token data into command line tool 2008-10-21 06:29:45 -04:00
htdocs legal stuff 2008-10-16 23:26:01 -04:00
src fix some small errors 2008-10-21 20:01:11 -04:00
LICENSE initial commit, all seems to work 2008-10-08 19:54:28 -04:00
README add token module ignoring 2008-10-21 07:06:28 -04:00


(Harmonious Code's internals are currently a complete mess. You have been warned.)

Harmonious Code is a static code analyzer for PHP, primarily geared toward
ensuring that the code you're writing will work on a particular base level
PHP installation. It will double-check each function and constant (and soon,
language constructs) that you're using and provide you with the minimum
version of PHP requires, as well as any necessary PECL modules, to run the
code that you've written.

To build & use Harmonious Code on Unix-like operating systems:

* Make sure you're running haXe 2.
* Download the PHP documentation from CVS.
* Run the build/ script, passing either the relative or absolute
  path to your phpdoc CVS folder:

  cd build
  ./ /var/www/harmoniouscode/phpdoc
* Run build/ This will take a short while as all_tokens.hxd is
  built in the data directory. It will also ensure everything's working
* Run build/ The harmoniouscode.js file will be generated
  in htdocs. You'll also have a zip file with the entire Harmonious
  Code bundle to pass off to others.
* Open htdocs/index.html and try analyzing some PHP code.
* Run build/ and pass the path to a PHP file as the first
  parameter. A basic analysis should appear.

To automatically ignore certain tokens and modules, place lines like
the following in your code:

* To globally ignore a token (ex: json_decode()), place at the top of
  the file the following:

  //harmonious json_decode

* To ignore a token within a block of code, surround the code in the

  //harmonious json_decode
    ...your code...

* To ignore a particular module throughout the code (ex: maxdb), place
  at the top of the file the following:

  //harmonious @maxdb

* To ignore the version information for a particular module for a
  particular token (ex: the rename function of the zip module), place
  at the top of the file the following:

  //harmonious @zip:rename

No build instructions for Windows yet, but Cygwin + haXe for Windows should
be able to perform the build.

Patches and comments are welcomed - send them to

Visit Tell your friends.

Harmonious Code is Copyright 2008 John Bintz. Original PHP Documentation is
Copyright the PHP Documentation Group, is licensed under the Creative Commons
Attribution 3.0 License, and has been modified from its original form.