2008-10-17 02:46:17 +00: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.
|
2008-10-08 23:54:28 +00:00
|
|
|
|
2008-10-09 00:03:08 +00:00
|
|
|
To build & use Harmonious Code on Unix-like operating systems:
|
|
|
|
|
|
|
|
* Make sure you're running haXe 2.
|
|
|
|
* Download the PHP documentation from CVS.
|
2008-10-17 02:46:17 +00:00
|
|
|
* 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
|
2008-10-09 00:03:08 +00:00
|
|
|
built in the data directory. It will also ensure everything's working
|
|
|
|
correctly.
|
|
|
|
* Run build/javascript.sh. The harmoniouscode.js file will be generated
|
2008-10-17 02:46:17 +00:00
|
|
|
in htdocs. You'll also have a zip file with the entire Harmonious
|
|
|
|
Code bundle to pass off to others.
|
2008-10-09 00:03:08 +00:00
|
|
|
* 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.
|
|
|
|
|
2008-10-09 01:20:30 +00:00
|
|
|
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
|
|
|
|
|
2008-10-09 00:03:08 +00:00
|
|
|
No build instructions for Windows yet, but Cygwin + haXe for Windows should
|
|
|
|
be able to perform the build.
|
|
|
|
|
2008-10-09 00:05:34 +00:00
|
|
|
Patches and comments are welcomed - send them to john@coswellproductions.com.
|
2008-10-09 00:03:08 +00:00
|
|
|
|
|
|
|
Visit http://harmoniouscode.coswellproductions.com/. Tell your friends.
|
|
|
|
|
2008-10-17 03:26:01 +00:00
|
|
|
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.
|