- 2. Installation
2.1. Standard installation - 2. Installation
« Previous - 2.2. PHAR installation
Next »
2.1. Standard installation
Create a single directory for the OPL libraries code called "installation directory". Each OPL package contains an /lib folder whose must be copied to the installation directory.
In order to use OPL libraries in your project, you need to load the core file and register an autoloader:
require('../../lib/Opl/Base.php'); Opl_Loader::setDirectory('../../lib/'); Opl_Loader::register(); // use the libraries now
OPL uses exceptions to report problems and errors. It is recommended to capture them. The basic exception class used by the libraries is Opl_Exception, but each of the libraries provides also its own class. OPL contains also the default exception handler:
require('../../lib/Opl/Base.php'); Opl_Loader::setDirectory('../../lib/'); Opl_Loader::register(); try { // your code } catch(Opl_Exception $exception) { Opl_Error_Handler($exception); }
- 2.1. Standard installation
2. Installation - « Previous
2. Installation - Next »
2.2. PHAR installation