more cleanup

This commit is contained in:
John Bintz 2008-10-16 22:46:17 -04:00
parent 748b8f4f89
commit 3494bd7d4a
6 changed files with 48 additions and 8 deletions

22
README
View File

@ -1,16 +1,28 @@
Harmonious Code's internals are currently a complete mess. You have been warned.
(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.
* Copy/symlink the phpdoc/phpbook/phpbook-xsl/version.xml file from the
PHP documentation into the data directory as version.xml.
* Run build/test.sh. This will take a while as functions_tokens_cache.hxd is
* 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.
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.

View File

@ -1,6 +1,6 @@
<html>
<head>
<title>Harmonious Code: Will my PHP code and Web hosting work together?</title>
<title>Harmonious Code: The PHP Static Code Version Checker</title>
<meta name="keywords" content="php, static code analysis, web hosting, functions, constants, language features" />
<link rel="stylesheet" href="style.css" type="text/css" />
<!--use thest HTML comments to dynamically insert your own content
@ -14,6 +14,7 @@
</head>
<body>
<h1>Harmonious Code</h1>
<h2>The PHP Static Code Version Checker</h2>
<!--page_header-->
<div id="loading">
Loading...
@ -22,7 +23,7 @@
<div id="form-holder">
<form action="" method="post" onsubmit="return false;">
<textarea name="source" id="source"></textarea><br />
<input id="analyze-code-button" type="button" value="Analyze Code" onclick="JavaScriptTarget.do_analysis(this.form.elements.source)" />
<input id="analyze-code-button" type="button" value="Analyze Code (this may take a while)" onclick="JavaScriptTarget.do_analysis(this.form.elements.source)" />
</form>
</div>
<div id="processing"></div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -7,7 +7,7 @@ body, td, div, li, p, span {
font-size: 12px;
}
h1 {
h1, h2 {
text-align: center
}
@ -71,6 +71,7 @@ th.is-filtering {
textarea#source {
width: 750px;
height: 250px;
background: white url(php_goes_here-crushed.png) center center no-repeat;
}
div#footer {

View File

@ -27,6 +27,15 @@ class JavaScriptTarget {
loading_div.style.display = "none";
form_div.style.display = "";
var source = js.Lib.document.getElementById("source");
untyped {
if (source.value != "") {
source.style.backgroundImage = "none";
} else {
source.onclick = function(e) { source.style.backgroundImage = "none"; }
}
}
#end
}

View File

@ -0,0 +1,17 @@
import CommandLineInterface;
class TestCommandLineInterface extends haxe.unit.TestCase {
function testOptionParsing() {
var options = [
[ [ "meow.php" ], "{file => meow.php}" ],
[ [ "--file", "meow.php" ], "{file => meow.php}" ],
[ [ "--php-version", "5.2.0", "meow.php" ], "{php-version => 5.2.0, file => meow.php}" ]
];
for (option in options) {
var arguments : Array<String> = option[0];
var expected_result : String = option[1];
assertEquals(expected_result.length, CommandLineInterface.parse_arguments(arguments).toString().length);
}
}
}