Running Codenizer

Running from within development environment

Using Codenizer requires just one extra step from doing things the old way -- after saving your file just invoke Codenizer from within your IDE and you will be presented with its analysis -- the environment can parse error messages and using its own built in features ease you correcting of spotted errors. You can see shot of using Codenizer within Eclipse -- results of Codenizer's analysis are displayed in the "Problems" view of Eclipse IDE (illustration on the left).

Codenizer can be easily integrated into many programming editors and IDEs so you can probably use it from within your favorite working environment. Here you can find instructions on how to integrate Codenizer with some popular editors. Most other editors or environments are able to parse Codenizer's messages without any extra support or programming. However, if your favorite editor is not supported or you can't figure out how to configure it, you can tell us about that using support center and we will try to find some solution for you.

Integrating Codenizer with editors and IDEs »

Running from command line

However if your can't integrate Codenizer into your favorite environment (or you just prefer to use command line), you can always run Codenizer from command line. First thing you need to make sure is that directory you installed Codenizer into is in your path (installation will not modify your path, you should do this on your own, if you have trouble doing this consult operating system help). After this you should be able to run Codenizer from command line using following syntax (> represents OS prompt):

> codenize.exe phpfile

codenize.exe expects single argument -- php script to check for errors. If Codenizer finds some errors in it (or in files included within it) it will display them on standard error (file descriptor 2), so if you want to redirect Codenizer's output to some file you should use command similar to this (again first ">" stands for OS prompt):

> codenize.exe phpfile > outputfile 2>&1

Format of Codenizer's messages is:

FILEPATH(LINE): MESSAGE

where FILEPATH is full path to the file in which error is detected, LINE is number of line in which error is detected, and MESSAGE is specific error message. In some cases Codenizer will display additional line in the format:

    FILEPATH(LINE): MESSAGE

This second type of line is exactly the same as first with distinction of added single TAB character at the beginning. Second type of message can not stand for itself but rather contains some additional information for the previous message. For example:

test.php(8): Error in number of parameters for 'calc_sum' (expected 2 passed 1)
    test.php(11): Declaration of 'calc_sum'

Performance

Performances can vary depending on size of input. On test machine with Pentium 4 on 1.6GHz it takes about 0.5 seconds and 10M of memory for script of 1000 lines, and about 10 seconds and 400M of memory for large project (around 10M of PHP code).

When using Codenizer from within some IDE or editor please note that some environments obviously have trouble with interprocess communication and error parsing, so if you experience very long time waiting for Codenizer to finish it would be good idea to try to run Codenizer from command line, just to be sure who should be blamed for long running time.

Return values

Codenizer will return value greater than 0 if there was some problem with its execution (if it couldn't initialize, or it couldn't open file to check); if it parsed your file and found no errors it will return 0; and if it parsed your file and found X errors it will return negative value -X. You can use this type of information if you run Codenizer from within some script (for example you could create some script for version control system you use to pass files programmer wants to commit to Codenizer first and then according to its return value to decide whether to allow commit or not).