class CronNotifyPushCommand extends CConsoleCommand{ public $keys=array(); public function init(){ parent::init(); } public function actionIndex(){ echo 'start CronNotifyPushCommand '.chr(10); if(!Yii::app()->params['push']['push_status']){ echo 'push status disabled';die(); } $rkey='message_notify_list'; $waitTotals=Fredis::model()->redis->lsize($rkey); echo 'wait totals:'.$waitTotals.chr(10); $waitResult=true; $i=0; while($waitResult) {$i++; echo $i.'https://www.jb51.net/'.$waitTotals.' wait to do'.chr(10); $waitResult=Fredis::model()->redis->rpop($rkey); if(!$waitResult) { continue; } $db_data=unserialize($waitResult);var_dump($db_data); $message_content=$db_data['message_content']; $uid=$db_data['uid']; $alias=$uid; if($uid==0){ NotifyPush::pushAll($message_content, $message_content); }else { NotifyPush::pushAlias($alias, $message_content, $message_content); } } echo 'end'.chr(10); } }
总结
以上所述是小编给大家介绍的Yii1.1框架实现PHP极光推送消息通知,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!
您可能感兴趣的文章: