(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/phpdoc_setup.sh script, passing either the relative or absolute
path to your phpdoc CVS folder:
cd build
./phpdoc_setup.sh /var/www/harmoniouscode/phpdoc
* Run build/test.sh. This will take a short while as all_tokens.hxd is
built in the data directory. It will also ensure everything's working
correctly.
* Run build/javascript.sh. 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/command_line.sh 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
following:
//harmonious json_decode
...your code...
//harmonious_end
* 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 john@coswellproductions.com.
Visit http://harmoniouscode.coswellproductions.com/. 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.