Exemplo n.º 1
0
 /**
  * @param int $id
  * @return $this|null
  */
 function set_current_ap($id)
 {
     if (isset($this->_ap_list[$id])) {
         $this->_current_ap_id = $id;
         $this->_current_ap = $this->_ap_list[$id];
     } else {
         $ap_info = Module_AccessPoint_Ap::get_ap($id);
         if ($ap_info['errno'] !== Const_Err_Base::ERR_OK) {
             Lib_Log::notice('Get ap faild! Result: %s', Lib_Helper::format_err_struct($ap_info));
             $this->_current_ap_id = null;
             $this->_current_ap = null;
             return null;
         }
         $ap_info = $ap_info['data'];
         $this->set_current_ap_info($id, $ap_info);
     }
     return $this;
 }
Exemplo n.º 2
0
#!/usr/bin/env php
<?php 
require_once dirname(dirname(dirname(__FILE__))) . '/app/init.php';
$options = getopt('a:t:m:');
if (!isset($options['a']) || !isset($options['t']) || !isset($options['m'])) {
    p('use as xxx -a ap_id -t task_id -m module_id');
    exit;
}
$ap_id = $options['a'];
//'16723523721449231476';
$task_id = $options['t'];
// 123
$module_id = $options['m'];
//'9691047284819742687'
$control_options = [Const_DataAccess::RUN_OPTION_FLOW_INFO => [Module_FlowManager_Main::RUN_MODE => Module_FlowManager_Main::RUN_MODE_SINGLE_MODULE, Module_FlowManager_Main::RUN_OPTION_SINGLE_MODULE_ID => $module_id]];
$ap_info = Module_AccessPoint_Ap::get_ap($ap_id);
if ($ap_info['errno'] !== Const_Err_Base::ERR_OK) {
    p('Get ap faild! Result:' . Lib_Helper::format_err_struct($ap_info));
    exit;
}
$ap_info = $ap_info['data'];
$flow_id = $ap_info[Module_FlowManager_Main::KEY_FLOW_ID];
unset($ap_info[Module_FlowManager_Main::KEY_FLOW_ID]);
$control_options[Const_DataAccess::RUN_OPTION_ACCESS_POINT_INFO] = $ap_info;
$data = Module_ControlCentre_Main::run($flow_id, $control_options, $task_id);
p($data);
exit;