protected function loadConfigFile($configName, array $configPaths): ConfigORM
    {
        // Cycle through all directories
        foreach ($configPaths as $directory) 
        {
            // If file exists, load it and break the loop
            $file = $directory . DS . 'config.'.$configName.'.php';
            if (file_exists($file))
            {
                // Load object
                return new ConfigORM($file);
                break;
            }
        }

        // Try fallback
        $file = Core::$coreDir . DS . 'Config' . DS . 'config.' . $configName . '.php';
        if (file_exists($file))
        {
            // Load object
            return new ConfigORM($file);
        }

        throw new ConfigException("Could not load config. File $configName not found", 1);
    }
protected function loadConfigFile($configName, array $configPaths): ConfigORM
    {
        // Cycle through all directories
        foreach ($configPaths as $directory) 
        {
            // If file exists, load it and break the loop
            $file = $directory . DS . 'config.'.$configName.'.php';
            if (file_exists($file))
            {
                // Load object
                return new ConfigORM($file);
                break;
            }
        }

        // Try fallback
        $file = Core::$coreDir . DS . 'Config' . DS . 'config.' . $configName . '.php';
        if (file_exists($file))
        {
            // Load object
            return new ConfigORM($file);
        }

        throw new ConfigException("Could not load config. File $configName not found", 1);
    }
protected function loadConfigFile ( $ configName , array $ configPaths ) : ConfigORM { // Cycle through all directories foreach ( $ configPaths as $ directory ) { // If file exists, load it and break the loop $ file = $ directory . DS . 'config.' . $ configName . '.php' ; if ( file_exists ( $ file ) ) { // Load object return new ConfigORM ( $ file ) ; break ; } } // Try fallback $ file = Core :: $ coreDir . DS . 'Config' . DS . 'config.' . $ configName . '.php' ; if ( file_exists ( $ file ) ) { // Load object return new ConfigORM ( $ file ) ; } throw new ConfigException ( "Could not load config. File $configName not found" , 1 ) ; }
Determine whether the file exists and, if so, load the ConfigORM

@param string $configName  Name of the config file. Eg. 'main'
@param array  $configPaths Required array of where to look for the config files
@return  ConfigORM of the config file. Allows for easy reading and editing of the file
@throws  ConfigException
Determine whether the file exists and if so load the ConfigORM