58 lines
1.1 KiB
PHP
58 lines
1.1 KiB
PHP
<?php
|
|
|
|
if(!defined("OVERWATCH_ROOT"))
|
|
{
|
|
die("This library requires the Overwatch SDK.");
|
|
}
|
|
|
|
$module = ModuleLoader::startInst();
|
|
$modules = array();
|
|
function LoadAPIModules($path = OVERWATCH_MODULES)
|
|
{
|
|
global $module;
|
|
global $modules;
|
|
$modulesArray = scandir($path);
|
|
foreach($modulesArray as $modulename)
|
|
{
|
|
if(is_dir($path."$modulename"))
|
|
{
|
|
$modules[$modulename] = $module->loadModule($modulename);
|
|
if(is_object($modules[$modulename]) && $modules[$modulename]->module_loaded())
|
|
{
|
|
// We're good here
|
|
if(defined("DEBUG"))
|
|
{
|
|
LogEcho("API Module Loaded: $modulename", "OV3RW4TCH-API");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function LoadAPIModule($sql)
|
|
{
|
|
// Force Module Loader to load a specified API Module when sent
|
|
}
|
|
|
|
function UnloadAPIModule($sql) {}
|
|
|
|
apiql::register('!load/!API[json]','LoadAPIModule');
|
|
apiql::register('!unload/!API[json]','UnloadAPIModule');
|
|
|
|
abstract class API_Definition {
|
|
|
|
abstract protected function API_Definition_Register();
|
|
|
|
public static function loadInst() {
|
|
static $inst = null;
|
|
API_Definition_Register();
|
|
if($inst === null) {
|
|
$inst = new self;
|
|
}
|
|
return $inst;
|
|
}
|
|
}
|
|
|
|
|
|
?>
|