Fork me on GitHub

Configuration


The behavior of the Jaxon library can be changed using its configuration options.

The $jaxon->setOption($name, $value) function allows to set the value of a configuration option, while the $jaxon->getOption($name) function allows to read its value.

Configuration files

It is also possible to read the library configuration to a file, which can be in JSON, YAML, or PHP formats.

$jaxon->readPhpConfigFile($yamlFilePath);   // Read configuration in a PHP file.
                                            // The file contains PHP code that returns an array.
$jaxon->readYamlConfigFile($jsonFilePath);  // Read configuration in a YAML file.
$jaxon->readJsonConfigFile($phpFilePath);   // Read configuration in a JSON file.
$jaxon->readConfigFile($phpFilePath);       // Read configuration in a file based on its extension.

If the file contains other data than the Jaxon library configuration, each of these functions can take a second parameter to read the configuration only in a section of the file.

The configuration option list

These options are those of the Jaxon library. The Jaxon plugins can require additional options.

Name Type Description
core.version string The version number of the library
core.language string The language of the library
core.encoding string The character encoding to use
core.decode_utf8 boolean Whether to decode UTF8 Jaxon function parameters
core.prefix.function string The prefix to add to the names of exported javascript functions
core.prefix.class string The prefix to add to the names of the exported javascript classes
core.prefix.event string The prefix to add to the name of the exported javascript events
core.request.uri string The URL where all Jaxon requests are sent
core.request.mode string The query mode. Can be "asynchronous" or "synchronous"
core.request.method string The query method. Can be "POST" or "GET"
core.request.csrf_meta string The name of the HTML meta header for the CSRF token
core.process.clean boolean Whether to clean the buffer after the processing of a request
core.process.exit boolean Whether to call the exit() function after the processing of a request
core.process.timeout integer
core.error.handle boolean Whether to handle error
core.error.log_file string The path of the error log file
core.debug.on boolean Whether to enable debug mode
core.debug.verbose boolean Whether to enable verbose debug mode
core.debug.output_id string The id of the javascript debug output
core.template.cache string The path of the template cache directory
js.lib.uri string The link to the Jaxon javascript libraries
js.lib.queue_size integer The max number of commands in a single answer
js.lib.show_cursor boolean Whether to display a cursor
js.lib.show_status boolean Whether to display the status of the request
js.app.uri string The link to the javascript files generated by Jaxon
js.app.dir string The directory that contains the javascript files generated by Jaxon
js.app.extern boolean Whether to create a javascript file containing the code generated by Jaxon
js.app.minify boolean Whether to minify the code generated by Jaxon
js.app.options string The options to add to the javascript tag in the generated HTML code