Skip to content

Instantly share code, notes, and snippets.

@exu
Created March 9, 2011 10:00
Show Gist options
  • Save exu/861980 to your computer and use it in GitHub Desktop.
Save exu/861980 to your computer and use it in GitHub Desktop.
<?php
function deployer_autoload($name) {
$libDirs = array(
'./deployer/lib/deployer/',
'./lib/deployer/',
);
foreach ($libDirs as $libDir){
if(strpos($name, '_')>0) {
$filePath = $libDir . str_replace('_','/',$name).'.php';
if(file_exists($filePath)) {
include_once $filePath;
break;
}
} else {
$filePath = $libDir . $name .'.php';
if(file_exists($filePath)) {
include_once $filePath;
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment