/** * Constructor Gets the current module name from the return value of the debug_backtrace function * It also sets the protocol * @access private * Class cannot be instantiated using the `new` keyword */ private function __construct() { $current_module_name = dirname(debug_backtrace()[2]["file"]); $current_module = explode("\\", $current_module_name); if (false !== in_array("modules", $current_module)) { $location = array_search("modules", $current_module); $module = $current_module[$location + 1]; $this->current_module_name = $module; View::setProtocol(); } return; /** * @todo instead of ending execution, shouldn't we be throwing an exception? */ }