Macro Engine (ME) is an extension of the Jedox Web Core delivered in the form of an external library (.dll/.so), which gets loaded when Core loads. It is enabled by default but is not mandatory, meaning that Core will start even if this extension is disabled or if Core is unable to load it during the start procedure.
ME is called by the following entry in the file …\Jedox Suite\core\config.xml (Windows) or …/core-Linux-i686/etc/config.xml (Linux):
<extension name="macro_engine" config="macro_engine_config.xml" />
ME has different configuration options that are set in the file macro_engine_config.xml. These options are mainly various PHP statements, which are normally in the php.ini. Furthermore, included are the user-defined functions, which should be available server-wide.
The following is an example of a macro_engine_config.xml:
<?xml version="1.0" encoding="utf-8"?> <php_macro_engine_config xmlns="http://www.jedox.com/jedox/wss" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <php_extensions directory="php_extensions"> <extensions> <extension extension_file="php_curl.dll" /> <extension extension_file="php_jedox_palo_x64.dll" /> <extension extension_file="phpchartdir560.dll" /> </extensions> </php_extensions> <php_files directory="../httpd/app" temp_directory="tmp"> <include_paths> <include_path path="base" relative="true" /> <include_path path="lib" relative="true" /> </include_paths> </php_files> <ini_directives> memory_limit = 256M max_execution_time = 90 max_input_time = 90 date.timezone = "Europe/Berlin" open_basedir = "../httpd/app/base;../httpd/app/lib;tmp" zend_extension="../php_extensions/php_opcache.dll" opcache.enable=1 opcache.memory_consumption=64 opcache.use_cwd=1 opcache.validate_timestamps=1 </ini_directives> <general_settings> <console_echo>false</console_echo> <loglevel>error</loglevel> </general_settings> <functions> <function spreadsheet_function="RESOLVE" php_file="base/macro/fns/misc.php" php_function="RESOLVE" always_recalc="false" /> </functions> </php_macro_engine_config>
The sections of the macro are:
- php_extensions: used to define the path to PHP extensions used in ME; within this section you specify the files to be loaded when ME loads.
- php_files: used to specify relevant PHP directories, such as “temp” and “include”. You can specify more than one “include” directory path
- ini_directives: here you can specify general PHP settings. In standalone PHP, such settings are found in the file php.ini.
- functions: used to specify custom functions that will be available to every ME user. You have to specify the name of the function as it should be used in the spreadsheet, the path to the file that contains the definition for the function, and the internal name of the function.
The “always_recalc” flag controls whether the function should always be calculated (true), or only upon change in the value of arguments of the function (false).
See also Macro Engine.