Do not ignore filtered result in php_filter_validate_url
[hiphop-php.git] / hphp / doc / command.compiler
blobf8d32f426d510b8be17fac091e6be274aba31e00
1 <h2>Compiler Command Line Options</h2>
3 = --help
5 Displays the list of command line options with short descriptions.
7 = -t, --target=TARGET
9 This sets the mode of operation for hphp. TARGET is one of <b>lint</b>,
10 <b>analyze</b>, <b>php</b>, <b>cpp</b>, <b>filecache</b>, and <b>run</b>
11 (default).
13 lint: only parses the input files.
14 analyze: runs the analysis phases of hphp but does not generate output files.
15 php: runs analysis on the input files and generates php source files as output.
16 cpp: runs analysis on the input files, generates c++ source files as output and optionally builds the program. See format options for cpp.
17 run: is the same as cpp but also builds and executes the program.
18 filecache: only builds the static file cache.
20 = -f, --format=FORMAT
22 The possible values of FORMAT depends on the chosen target.
24 If the target is <b>lint</b> or <b>analyze</b>, the format option is unused.
26 If the target is <b>php</b>, FORMAT is a comma separated list of the following:
28 pickled: This outputs php code in a canonicalized format and stripped of comments.
29 trimmed: This is the same as pickled, but also does not output functions that are never used.
30 inlined: The same as pickled but generates a single file where all includes are inlined.
31 typeinfo: The same as pickled, but also runs type inference on the php code and outputs the inferred types in comments.
33 If the target is <b>cpp</b>, FORMAT is one of the following:
35 cluster: (default) The generated C++ code is divided up among a fixed number of files. The number is set by the cluster-count option.
36 file: There is one C++ source file generated for each input PHP file. The paths to generated C++ files mirror the paths to the PHP files.
37 sys: This is used to generate the C++ used for the system library.
38 exe: This is the same as cluster but also compiles the generated C++ into an executable.
39 lib: The same as cluster but compiles the generated C++ into a library.
41 If the target is <b>run</b>, FORMAT can be either cluster or file. These behave
42 the same as the corresponding formats for cpp. However, with run the generated
43 sources are always compiled into executables and run.
45 = --cluster-count=COUNT
47 COUNT is an integer and determines the number of output C++ files to generate
48 when using the cluster format for cpp or run targets.
50 = --input-dir=PATH
52 PATH is the path to the root directory of the PHP sources.
54 = --program=NAME
56 When using the exe format or run target, NAME will be the name of the compiled
57 executable.
59 = --args=ARGUMENTS
61 When using the run target, the executable will be run with arguments ARGUMENTS.
63 = -i, --inputs=FILE
65 FILE is added to the list of input PHP files.
67 = --input-list=FILE
69 FILE is the path to a file with a list of PHP sources to add to the input
70 list. The format is one path per line.
72 = --module=DIR
74 DIR is a path to a directory. All PHP sources in that directory, including
75 subdirectories, are added to the input list.
77 = --exclude-dir=DIR
79 DIR is the path to a directory. All PHP sources in that directory, including
80 subdirectories, are excluded from the input list with the exception of
81 forced inputs.
83 = --fmodule=DIR
85 --fmodule is the same as --module, except it will override any --exclude-dir
86 commands that would affect inclusion of the PHP files.
88 = --ffile=FILE
90 FILE is included, overriding exclusion commands.
92 = --exclude-file=FILE
94 FILE is excluded from the input list, except where overridden by --ffile.
96 = --cfile=FILE
98 FILE is included in the file cache. It is not affected by exclusion commands.
100 = --cmodule=DIR
102 All static resources in DIR, including subdirectories, are added to the file
103 cache. It is not affected by exclusion commands.
105 = --parse-on-demand=BOOL (default: true)
107 If BOOL is true, then include statements in PHP sources will add files to
108 the input list as they are encountered when the filename is statically
109 knowable.
111 = --branch=STRING
113 This specifies the SVN branch for logging purposes.
115 = --revision=NUMBER
117 This specifies the SVN revision for logging purposes.
119 = -o, --output-dir=DIR
121 The compiler will place the generated sources in DIR. If this parameter is
122 not specified, the compiler will use a new directory in /tmp.
124 = --sync-dir=DIR
126 If this parameter is set, the compiler will first output to DIR, and then
127 only copy over files that have changed to the output directory. This is to
128 preserve their timestamps so that a make will not recompile unchanged files.
130 = --optimize-level=INT (default: 1)
132 This sets the severity of optimizations performed on the PHP code before
133 being translated into C++. Currently, there are two levels of optimization.
134 0 performs no optimizations, and 1 performs some optimizations.
136 = --gen-stats=BOOL (default: false)
138 If BOOL is true, then detected errors in the code and code statistics will
139 be output to CodeError.js and Stats.js respectively in the output directory.
141 = --keep-tempdir=BOOL (default: false)
143 If no output directory is specified, the compiler will place generated sources
144 into a directory in /tmp. If BOOL is true, then this directory will not be
145 deleted after the program is compiled and, optionally, run.
147 = --static-method-autofix=BOOL (default: true)
149 If a method is found to be called statically but not declared static and BOOL
150 is true, then it will be treated as a static method.
152 = --db-stats=STRING
154 If this parameter is given, and --gen-stats also set, the dependency graph
155 and code errors will be stored in the database specified by STRING.
156 The format is <username>:<password>@<host>:<port>/<db>.
158 = --no-type-inference=BOOL (default: false)
160 If BOOL is true, then no type inference will be performed before outputting
161 the translated sources.
163 = --no-min-include=BOOL (default: false)
165 If BOOL is true, then minimum include analysis will not be performed for an
166 analyze target.
168 = --no-meta-info=BOOL (default: false)
170 If BOOL is true, then generated C++ code will not include a class map, jump
171 tables, or use macros. This is intended to produce readable but non-functional
172 code.
174 = --config=FILE
176 This reads in a configuration file to set options. FILE should be in HDF
177 format.
179 = --db-config=STRING
181 This reads configuration from a database. STRING is of the format
182 <username>:<password>@<host>:<port>/<db>.
184 = --config-dir=DIR (default: --input-dir)
186 This sets the root directory for configuration purposes to be DIR. All
187 relative paths passed as options will be treated as relative from this
188 directory.
190 = -v, --config-value=STRING
192 This sets a configuration option on the command line. STRING should be
193 a line of HDF, e.g. Section.Name=Value. The options settable are the same
194 as those set by --config or --db-config.
196 = -l, --log=INT (default: -1)
198 This sets the level of logging output to standard out. The Levels are:
199 -1: If the target is run, then none, else the same as 3.
200 0: No logging
201 1: Only errors
202 2: The same as 1 plus warnings.
203 3: The same as 2 plus extra information.
204 4: All log messages.
206 = --force=BOOL (default: true)
208 Forces the compiler to generate output even if there are code errors
209 encountered.
211 = --filecache=FILE
213 If this argument is given, a static file cache will be created with path FILE.