public static function CheckApacheVHostFiles() { $fileNames = array("/etc/apache2/sites-available/airtime", "/etc/apache2/sites-enabled/airtime"); $status = AirtimeCheck::CHECK_OK; foreach ($fileNames as $fn) { if (!file_exists($fn)) { $status = AirtimeCheck::CHECK_FAILED; self::$check_system_ok = false; } } //Since apache2 loads config files in alphabetical order //from the sites-enabled directory, we need to check if //airtime is lexically the first file in this directory. //get sorted array of files $arr = scandir("/etc/apache2/sites-enabled"); /* foreach ($arr as $a){ if ($a == "." || $a == ".."){ continue; } if ($a == "airtime"){ break; } else { echo "\t\t*Warning, the file \"$a\" is lexically ahead of the file \"airtime\" in".PHP_EOL; echo"\t\t /etc/apache2/sites-enabled and preventing airtime from being loaded".PHP_EOL; } } */ }