*/
class ThirdPartyLoader extends Loader
{
public function commit()
{
$dirContent = scandir(THIRD_PARTY_DIR);
foreach ($dirContent as $dirEntry)
{
if (($dirEntry == ".") || ($dirEntry == "..")) continue;
if (is_dir(THIRD_PARTY_DIR . DS . $dirEntry))
{
$bootFileName = THIRD_PARTY_DIR . DS . $dirEntry . DS . $dirEntry . BOOTSTRAPER_SUFFIX . '.php';
if (file_exists($bootFileName))
{
require_once $bootFileName;
//the boot file must contain class named [SubdirectoryName]Boot
$bootstraperClass = $dirEntry . BOOTSTRAPER_SUFFIX;
if (!class_exists($bootstraperClass))
die("Invalid boot file in dependecy " . $dirEntry);
//the class must be descendant of BootStrapper
$bootstrapper = new $bootstraperClass();
if (!is_a($bootstrapper, "Phem\ClassLoading\Bootstrapping\Bootstrapper"))
die("Bootstraper of component " . $dirEntry . " must be inherited from Bootstraper");
$bootstrapper->init();
}
else
{
die("Bootstraper file for component " . $dirEntry. " not found");
}
}
}
}
}
WebSVN
- freenet-router
- Blame
- Rev 2
- /trunk/freenet-router/var/www/freenet-router/Framework/ClassLoading/ThirdPartyLoader.php
freenet-router |
Subversion Repositories: |
[/] [trunk/] [freenet-router/] [var/] [www/] [freenet-router/] [Framework/] [ClassLoading/] [ThirdPartyLoader.php] - Blame information for rev 2
Powered by WebSVN 2.2.1