1) { $namespace = $name_array[0]; $name = $name_array[1]; } if ($namespace == null && file_exists (__DIR__.'/php/classes/'.$name.'.class.php')) require_once __DIR__.'/php/classes/'.$name.'.class.php'; else if ($namespace == 'Plugins' && file_exists (__DIR__.'/php/plugins/'.$name.'.plugin.php')) require_once __DIR__.'/php/plugins/'.$name.'.plugin.php'; else if ($namespace == 'Executables' && file_exists (__DIR__.'/php/executables/'.$name.'.executable.php')) require_once __DIR__.'/php/executables/'.$name.'.executable.php'; else if ($namespace == 'Models' && file_exists (__DIR__.'/php/models/'.$name.'.model.php')) require_once __DIR__.'/php/models/'.$name.'.model.php'; else if ($namespace == 'Tasks' && file_exists (__DIR__.'/php/tasks/'.$name.'.task.php')) require_once __DIR__.'/php/tasks/'.$name.'.task.php'; }); //set shutdown-handler register_shutdown_function ([new HandlerShutdown (), 'handle_shutdown']); //set error-handler set_error_handler ([new HandlerError (), 'handle_error'], E_USER_ERROR|E_RECOVERABLE_ERROR); //exception-handler set_exception_handler ([new HandlerException (), 'handle_exception']); //plugin, php-exec, rest-api or index if (!empty ($_GET['plugin'])) new Plugin (); else if (!empty ($_GET['executable'])) new Executable (); else if (isset ($_GET['rest'])) new RestAPI (); else new Index ();