Exemple #1
0
 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();
 }
Exemple #2
0
 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();
 }
Exemple #3
0
 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();
 }
Exemple #4
0
 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);
         }
     }
 }
Exemple #5
0
 /**
  *
  * 获取应用信息列表 ...
  * @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;
 }
Exemple #6
0
 public function get_app()
 {
     include_once ROOT_PATH . 'lib/class/auth.class.php';
     $auth = new auth();
     return $auth->get_app();
 }