本文整理汇总了PHP中Build::inBuild方法的典型用法代码示例。如果您正苦于以下问题:PHP Build::inBuild方法的具体用法?PHP Build::inBuild怎么用?PHP Build::inBuild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Build
的用法示例。
在下文中一共展示了Build::inBuild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$this->tpl_name = 'acp_mods';
$this->page_title = 'ACP_MODS';
$this->tryBuild();
if (
is_dir(
BUILDS_DIR . DIRECTORY_SEPARATOR .
$this->build->getHash() . DIRECTORY_SEPARATOR . 'install'
)
) {
trigger_error(
'Remove install dir('.
BUILDS_DIR . DIRECTORY_SEPARATOR .
$this->build->getHash() . DIRECTORY_SEPARATOR . 'install'
.') and refresh this page',
E_USER_WARNING
);
}
try {
if (
!empty($_REQUEST['action'])
&&
in_array(
$_REQUEST['action'],
array('installMods', 'installModsAndStyle')
)
) {
DirUtils::clear($cache->cache_dir);
if (!isset($_REQUEST['mod']) || !is_array($_REQUEST['mod']))
$_REQUEST['mod'] = array();
if ($_REQUEST['action'] == 'installModsAndStyle'){
$this->installStyle($_REQUEST['styleName']);
}
$res = $this->installMods($_REQUEST['mod']);
if ($res instanceof Build) {
$template->assign_var('WARNING', true);
foreach ($_REQUEST['mod'] as $name)
$template->assign_block_vars(
'mods',
array('NAME'=>$name)
);
foreach ($res->getDependences('style') as $name)
$template->assign_block_vars(
'dependence',
array('NAME'=>$name)
);
} elseif ($res instanceof self) {
$template->assign_var('SUCCESS', true);
} else
$template->assign_var('WARNING2', true);
}
} catch (Exception $e) {
$template->assign_var('WARNING', true);
foreach ($_REQUEST['mod'] as $name)
$template->assign_block_vars(
'mods',
array('NAME'=>$name)
);
if ($res)
foreach ($res->getDependences('style') as $name)
$template->assign_block_vars(
'dependence',
array('NAME'=>$name)
);
}
$this->tryBuild();
// error_reporting(E_ALL);
foreach (Mod::getList() as $mod) {
$template->assign_block_vars(
'result',
array(
'NAME' => $mod->getName(),
'DESC' => $mod->getInfo(),
'CHECKED' =>
$this->build->inBuild($mod)
? ' checked'
: ''
)
);
}
return array();
}