本文整理汇总了PHP中owa_coreAPI::moduleClassFactory方法的典型用法代码示例。如果您正苦于以下问题:PHP owa_coreAPI::moduleClassFactory方法的具体用法?PHP owa_coreAPI::moduleClassFactory怎么用?PHP owa_coreAPI::moduleClassFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类owa_coreAPI
的用法示例。
在下文中一共展示了owa_coreAPI::moduleClassFactory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action
function action()
{
$path = OWA_BASE_CLASSES_DIR . 'modules/';
$dirs = array();
if ($handle = opendir($path)) {
while (($file = readdir($handle)) !== false) {
// test for '.' in dir name
if (strpos($file, '.') === false) {
// test for whether file is a dir
if (is_dir($path . $file)) {
$mod = owa_coreAPI::moduleClassFactory($file);
$dirs[$file]['name'] = $mod->name;
$dirs[$file]['display_name'] = $mod->display_name;
$dirs[$file]['author'] = $mod->author;
$dirs[$file]['group'] = $mod->group;
$dirs[$file]['version'] = $mod->version;
$dirs[$file]['description'] = $mod->description;
$dirs[$file]['config_required'] = $mod->config_required;
$dirs[$file]['current_schema_version'] = $mod->getSchemaVersion();
$dirs[$file]['required_schema_version'] = $mod->getRequiredSchemaVersion();
$dirs[$file]['schema_uptodate'] = $mod->isSchemaCurrent();
//$dirs['stats'] = lstat($path.$file);
}
}
}
}
closedir($handle);
ksort($dirs);
// remove base module so it can't be deactivated
// unset($dirs['base']);
$active_modules = owa_coreAPI::getActiveModules();
foreach ($active_modules as $module) {
if (!empty($dirs[$module])) {
$dirs[$module]['status'] = 'active';
}
}
// add data to container
$this->setView('base.options');
$this->setSubview('base.optionsModules');
$this->set('modules', $dirs);
return;
}
示例2: _loadModules
function _loadModules()
{
$am = owa_coreAPI::getActiveModules();
foreach ($am as $k => $v) {
$m = owa_coreAPI::moduleClassFactory($v);
$this->addModule($m);
// check for schema updates
$check = $m->isSchemaCurrent();
if ($check != true) {
$this->markModuleAsNeedingUpdate($m->name);
}
}
// set schema update flag
if (!empty($this->modules_needing_updates)) {
$this->setUpdateRequired();
}
return;
}
示例3: installModule
public static function installModule($module_name)
{
if ($module_name) {
$m = owa_coreAPI::moduleClassFactory($module_name);
$status = $m->install();
return $status;
}
}