The Apprunner is the core of Mamuph framework because it provides some basic features like the autoloader, initialization routines and some basic methods. Some useful methods provided by Apprunner are:
It finds a file and return their path.
Parameters
Returns
Example
// Search the path of the version.php file
Apprunner::find_file('version', 'config', 'php');
Load and execute an action defined into a Controller. By default the "action_main" is called. This method it helps to call different controllers in an easy way.
Parameters
Returns
Example
// It calls the method "action_main" from the file src/App/Controllers/Foo.php
Apprunner::execute('Foo');
// It calls the method "bar" from the file src/App/Controllers/Foo.php
Apprunner::execute('Foo', 'bar');
Terminate the program execution and return an exit code.
Parameters
Example
// Terminate the program return the success code (0)
Apprunner::terminate(Apprunner::EXIT_SUCCESS);
// Terminate the program and return the general failure code (1)
Apprunner::terminate(Apprunner::EXIT_FAILURE);
// Terminate the program and return the permission denied code (77)
Apprunner::terminate(Apprunner::EXIT_NOPERM);
// Terminate the program and return the custom exit code 33
Apprunner::terminate(33);