Example #1
0
 public function serverAction()
 {
     $server = new Jsonrpc_Server();
     $server->register('find', function ($keywords, $offset = 0, $limit = 12) {
         $segmenter = new Search_Segment();
         $matcher = new Search_Match('gamedb');
         $text = $segmenter->cutString('lol');
         $data = $matcher->call($text, 0, 12);
         foreach ($data['list'] as $k => $v) {
             $configer = new Search_Config($v->app);
             $data['list'][$k] = array('title' => $configer->formatTitle($v->table, $v, $text), 'detail' => $configer->formatDetail($v->table, $v, $text), 'url' => $configer->formatUrl($v->table, $v), 'image_url' => $configer->formatImage($v->table, $v));
         }
         $data['keyword'] = $text;
         return $data;
     });
     echo $server->execute();
 }
Example #2
0
 public function matchAction()
 {
     $matcher = new Search_Match("gamedb");
     $matcher->call("卡牌", 12, 12);
     return false;
 }