本文整理汇总了PHP中auth::get_app方法的典型用法代码示例。如果您正苦于以下问题:PHP auth::get_app方法的具体用法?PHP auth::get_app怎么用?PHP auth::get_app使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auth
的用法示例。
在下文中一共展示了auth::get_app方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: detail
public function detail()
{
$id = $this->input['id'];
if ($id) {
$info = $this->obj->get_db_first($id);
$db_relation = $this->obj->get_relation($id);
}
//获取支持全文检索的应用模块
include_once ROOT_PATH . 'lib/class/auth.class.php';
$auth = new auth();
$app = $auth->get_app('', '', '', 0, 1000, array('use_textsearch' => 1));
if ($app && is_array($app)) {
foreach ($app as $k => $v) {
$appid[] = $v['bundle'];
$module = $auth->get_module('', '', implode(',', $appid), '', 0, 1000);
}
}
$result['info'] = $info;
$result['app'] = $app;
$result['module'] = $module;
$result['db_relation'] = $db_relation;
// print_r($result);exit;
$this->addItem($result);
$this->output();
}
示例2: show
public function show()
{
$uniqueid = '';
$appname = $record = array();
$offset = $this->input['offset'] ? intval(urldecode($this->input['offset'])) : 0;
$count = $this->input['count'] ? intval(urldecode($this->input['count'])) : 1000;
include_once ROOT_PATH . 'lib/class/auth.class.php';
$auth = new auth();
$app = $auth->get_app('', '', '', 0, 1000, array('use_textsearch' => 1));
if ($app && is_array($app)) {
foreach ($app as $k => $v) {
$appid[] = $v['bundle'];
$module = $auth->get_module('', '', implode(',', $appid), '', 0, 1000);
}
}
if (is_array($module)) {
foreach ($module as $k => $v) {
$module_idarr[] = $v['mod_uniqueid'];
}
$all_relation = $this->obj->get_relation_by_m(implode("','", $module_idarr));
// print_r($all_relation);exit;
foreach ($module as $k => $v) {
$server_count[$v['app_uniqueid']][$v['mod_uniqueid']] = count($all_relation[$v['app_uniqueid']][$v['mod_uniqueid']]);
}
}
$result['app'] = $app;
$result['module'] = $module;
$result['server_count'] = $server_count;
$this->addItem($result);
$this->output();
}
示例3: show
public function show()
{
include_once ROOT_PATH . 'lib/class/auth.class.php';
$auth = new auth();
$apps = $auth->get_app($this->settings['stat_app']);
foreach ($apps as $k => $v) {
$m = array('id' => $v['bundle'], "name" => $v['name'], "fid" => $v['bundle'], "depth" => 1, 'is_last' => 1);
$this->addItem($m);
}
$this->output();
}
示例4: db_relation
public function db_relation($mo, $id, $index, $index_port, $search, $search_port)
{
foreach ($mo as $k => $v) {
$am = explode('/', $v);
$relation_data = array('bundle_id' => $am[0], 'module_id' => $am[1], 'db_id' => $id);
$bundle_id_arr[] = $am[0];
$module_id_arr[] = $am[1];
$this->obj->replace_relation('db_relation', $relation_data);
}
//获取支持全文检索的应用模块
include_once ROOT_PATH . 'lib/class/auth.class.php';
$auth = new auth();
$apps = $auth->get_app('', implode(',', $bundle_id_arr), '', 0, 1000, array('use_textsearch' => 1));
$modules = $auth->get_module('', '', '', '', 0, 1000, array('mod_uniqueid' => implode(',', $module_id_arr)));
foreach ($apps as $k => $v) {
$a[$v['bundle']] = $v;
}
foreach ($modules as $k => $v) {
$m[$v['mod_uniqueid']] = $v;
}
//获取各个系统配置文件
foreach ($bundle_id_arr as $k => $v) {
if ($m[$module_id_arr[$k]]['host']) {
//$m[$module_id_arr[$k]]['host'] = ltrim($m[$module_id_arr[$k]]['host'],'http://');
$m[$module_id_arr[$k]]['host'] = rtrim($m[$module_id_arr[$k]]['host'], '/');
$content = file_get_contents('http://' . $m[$module_id_arr[$k]]['host'] . '/' . $m[$module_id_arr[$k]]['dir'] . 'conf/' . $v . '_' . $module_id_arr[$k] . '.ini');
} else {
//$a[$module_id_arr[$k]]['host'] = ltrim($a[$module_id_arr[$k]]['host'],'http://');
$a[$module_id_arr[$k]]['host'] = rtrim($a[$module_id_arr[$k]]['host'], '/');
$content = file_get_contents('http://' . $a[$module_id_arr[$k]]['host'] . '/' . $a[$module_id_arr[$k]]['dir'] . 'conf/' . $v . '_' . $module_id_arr[$k] . '.ini');
}
//生成对应文件
if ($content) {
$this->mk_ini($v, $module_id_arr[$k], 'utf-8', $content, $index, $index_port, $search, $search_port);
}
}
}
示例5: getApp
/**
*
* 获取应用信息列表 ...
* @param string $app 需要获取的应用标识 可选
* @param unknown_type $field 需要获取的字段 可选
*/
public function getApp($app = '', $field = 'name,bundle')
{
$auth = new auth();
$appInfo = $auth->get_app($field, $app);
$reApp = array();
if (is_array($appInfo)) {
foreach ($appInfo as $v) {
$reApp[$v[bundle]] = array('appname' => $v[name]);
}
}
return $reApp;
}
示例6: get_app
public function get_app()
{
include_once ROOT_PATH . 'lib/class/auth.class.php';
$auth = new auth();
return $auth->get_app();
}