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 Fault::compilePath() method as shown in the below example:

$current_path = Fault::compilePath();

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

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

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

Note

Fault::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 InvalidCompilePathException will be thrown

Warning

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

Autoload Compiled Exceptions

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