Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Muqsit/f601257fd20c36b05a875a63939a8c38 to your computer and use it in GitHub Desktop.
Save Muqsit/f601257fd20c36b05a875a63939a8c38 to your computer and use it in GitHub Desktop.
loadEveryClassToCheckForErrorsBecauseICannotAffordGoodIDEs
private function loadEveryClassToCheckForErrorsBecauseICannotAffordGoodIDEs($directory = "/root/pmmp/plugins/CosmicCore-master/src/CosmicCore")
{
if(is_dir($directory)) {
$scan = scandir($directory);
unset($scan[0], $scan[1]); //unset . and ..
foreach($scan as $file) {
if(is_dir($directory."/".$file)) {
$this->loadEveryClassToCheckForErrorsBecauseICannotAffordGoodIDEs($directory."/".$file);
} else {
if(strpos($file, '.php') !== false) {
require_once($directory."/".$file);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment