コード例 #1
0
ファイル: mail.php プロジェクト: houzhenggang/zmail
 public function send()
 {
     $to = $this->getString('to');
     $title = $this->getString('title');
     $content = $this->getString('content');
     $taskId = $this->getString('taskId');
     common\loadClass::getService('Mail')->send($to, $title, $content, $taskId);
     return null;
 }
コード例 #2
0
ファイル: main.php プロジェクト: ymnl007/zphpdemo
 public function online()
 {
     $olUids = common\Utils::online();
     $idsArr = \array_keys($olUids);
     $where = "id in (" . implode(',', $idsArr) . ")";
     $userInfo = common\loadClass::getService('User')->fetchWhere($where);
     $result = array();
     foreach ($userInfo as $user) {
         $result[$user->id] = $user->hash();
     }
     return $result;
 }
コード例 #3
0
ファイル: main.php プロジェクト: jxw7733/zphpdemo
 public function savereg()
 {
     $username = $this->getString($this->params, 'username');
     $password = $this->getString($this->params, 'password');
     $icon = $this->getString($this->params, 'icon', 'noface.jpg');
     $service = common\loadClass::getService('User');
     $result = $service->addUser($username, $password, $icon);
     if ($result) {
         return common\Utils::jump("main", "main", array("msg" => "注册成功"));
     }
     return common\Utils::showMsg("注册失败");
 }
コード例 #4
0
ファイル: Chat.php プロジェクト: haitao1880/zphpdemo
 public function getOnlineList()
 {
     $olUids = common\Utils::online();
     if (empty($olUids)) {
         return array();
     }
     $idsArr = \array_keys($olUids);
     $where = "id in (" . implode(',', $idsArr) . ")";
     $userInfo = common\loadClass::getService('User')->fetchWhere($where);
     $result = array();
     foreach ($userInfo as $user) {
         $result[$user->id] = $user->hash();
     }
     $this->sendOne(Request::getFd(), common\Cmd::OLLIST, $result);
 }
コード例 #5
0
ファイル: base.php プロジェクト: google2013/swoole_flash_game
 private function initUsedModel()
 {
     $pattern = "/(Model)\$/si";
     $vars = get_class_vars(get_class($this));
     $models = common\Utils::preg_grep_keys($pattern, $vars);
     if (!empty($models)) {
         foreach ($models as $model) {
             $this->{$model} = common\loadClass::getModel($model);
         }
     }
     //add Service
     $servicePattern = "/(Service)\$/si";
     $services = common\Utils::preg_grep_keys($servicePattern, $vars);
     if (!empty($services)) {
         foreach ($services as $service) {
             $this->{$service} = common\loadClass::getService($service);
         }
     }
 }
コード例 #6
0
ファイル: chat.php プロジェクト: haitao1880/zphpdemo
 public function offline()
 {
     common\loadClass::getService('Chat')->offline();
 }