Commit 6b0e87a4 authored by chenchuanwen's avatar chenchuanwen

bridgeReload

parent 19f44ae2
...@@ -6,6 +6,29 @@ ...@@ -6,6 +6,29 @@
* Time: 下午 2:29 * Time: 下午 2:29
*/ */
require APPLICATION_PATH . '/scripts/crontab/common.php'; require APPLICATION_PATH . '/scripts/crontab/common.php';
error_reporting(E_ALL ^ E_NOTICE);
function callback($instance,$channelName,$message){
try{
$message=json_decode($message,true);
$callInstance=$message['className']::getInstance(\Our\DbNameConst::masterDBConnectName);
echo json_encode($message)."\r\n";
if(empty($message['params'])){
$res=call_user_func_array(array($callInstance,$message['method']),array());
}else{
$res=call_user_func_array(array($callInstance,$message['method']),$message['params']);
}
$res=(isset($res)&&!empty($res))?$res:false;
if($res!==false){
echo 'success'."\r\n";
}else{
echo 'fail1'."\r\n";
}
unset($callInstance);
\Mysql\LinkMySQLModel::unsetDbConecet();
}catch(Exception $ex){
echo $ex->getMessage();
}
}
$conf = \Yaf\Registry::get('config')->get('redis.database.params'); $conf = \Yaf\Registry::get('config')->get('redis.database.params');
$redisPublishName=\Yaf\Registry::get('config')->get('redis.redisPublishName'); $redisPublishName=\Yaf\Registry::get('config')->get('redis.redisPublishName');
$redis=new Redis(); $redis=new Redis();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment