4.3. OPT Toolset

OPT Toolset is an application developed to manage OPT or OPT-related issues. Currently it consists of two tools:

  1. Configurator - this is a preprocessor, which allows you to remove unused features from the library code. OPT Compiler was a standalone tool in OPT 1.0.x.
  2. Compiler - an external template compiler. It may be useful, if you use the performance directive, which turns off the automated template compilation. If you fix something in a template, you run the compiler, compile it manually and send the compiled version to the server without disabling the directive for a moment.

To install the toolset, just copy it somewhere, where the webserver could find it. Copy also OPT library, because it is required by the application. Open common.php and set the OPT_DIR constant to the actual path to the library. Run the browser and open index.php. If you see the info page, the installation is over.

OPT Toolset contains a built-in help, so here we will describe only the basic things.

The configurator requires the original source code of OPT to work. You specify a path to it and the localization of the output, modified files. Next, you select the features you want to keep and untick those ones which are unnecessary.

The compiler tool: in the top you see three fields to specify paths:

  1. Template source directory
  2. Compiled template directory
  3. Plugin directory - if your templates use some plugins, OPT may load them in order to use in the compiled templates.

The tool has three functions:

  1. Remove all - removes all the compiled versions of the templates.
  2. Remove selected - you have to tick the templates, whose compiled versions must be removed.
  3. Compile selected - compiles the selected templates, using their source files and loaded plugins.

Note: OPT Toolset remembers all the paths and options you have typed, so you do not have to specify them every time you want to use the toolset.