Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Latest commit

 

History

History
49 lines (29 loc) · 1.62 KB

compiler.rst

File metadata and controls

49 lines (29 loc) · 1.62 KB

FaultManagerdoc

Compiler

Not many things to do here since everything is done already by the component, but is strongly recommended to set your own compile folder on the root of your project rather than use the default path which in relation to the root of your project is ./vendor/panosru/fault-manager/_compiled/.

Compile Path

To get your current compile path you can use :phpFault::compilePath() method as shown in the below example:

php

$current_path = Fault::compilePath();

To set your compile path to another path you can use :phpFault::setCompilePath(string $path) method:

php

Fault::setCompilePath('/my/other/abosule/path/');

$current_path = Fault::compilePath(); // will now show "/my/other/absolute/path/"

Note

:phpFault::setCompilePath(string $path) will check if the path you provided exists if is a directory and if is writable, in case any of the above do not meet the requirements then an :phpInvalidCompilePathException will be thrown

Warning

Any :phpFault::throw() or :phpFault::exception() used before the call of :phpFault::setCompilePath(string $path), will use the default path instead.

Autoload Compiled Exceptions

To enable autoloading of your generated exception classes you can call :phpFault::autoloadCompiledExceptions method. Otherwise your generated Exception will be accessed only via :phpFault class.