예제 #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();
 }
예제 #2
0
파일: memmodule.php 프로젝트: h3len/Project
 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
0
파일: statlist.php 프로젝트: h3len/Project
 public function show()
 {
     $uniqueid = '';
     $data = $record = array();
     $app_uniqueid = urldecode($this->input['_id']);
     $module_uniqueid = urldecode($this->input['module_uniqueid']);
     $douser_id = urldecode($this->input['douser_id']);
     $stat_type = urldecode($this->input['stat_type']);
     $start_time = urldecode($this->input['start_time']);
     $end_time = urldecode($this->input['end_time']);
     $offset = $this->input['offset'] ? intval(urldecode($this->input['offset'])) : 0;
     $count = $this->input['count'] ? intval(urldecode($this->input['count'])) : 15;
     $app = $this->obj->get_apps($this->get_condition());
     if ($this->input['_id']) {
         include_once ROOT_PATH . 'lib/class/auth.class.php';
         $auth = new auth();
         $module = $auth->get_module('', urldecode($this->input['_id']));
     }
     $user = $this->obj->get_user();
     $record = $this->get_statlist($offset, $count, $app_uniqueid, $module_uniqueid, $douser_id, $stat_type, $start_time, $end_time);
     $data['app_uniqueid'] = $app_uniqueid;
     $data['module_uniqueid'] = $module_uniqueid;
     $data['douser_id'] = $douser_id;
     $data['stat_type'] = $stat_type;
     $data['app'] = $app;
     $data['user'] = $user;
     $data['start_time'] = $start_time;
     $data['end_time'] = $end_time;
     $data['record'] = $record;
     if ($record) {
         $numdata = $this->getcount();
         $data['num'] = $numdata['total'];
     }
     //print_r($data['app']);exit;
     $this->addItem($data);
     $this->output();
 }
예제 #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);
         }
     }
 }
예제 #5
0
파일: common.php 프로젝트: h3len/Project
 public function get_module($application_id)
 {
     include_once ROOT_PATH . 'lib/class/auth.class.php';
     $auth = new auth();
     return $auth->get_module($application_id);
 }