..." [" . $doc->percent() . "%]\n"; echo $doc->message . "\n"; } } catch (XSException $e) { echo $e; // 直接输出异常描述 if (defined('DEBUG')) // 如果是 DEBUG 模式,则输出堆栈情况 echo "\n" . $e->getTraceAsString() . "\n"; } ~~~ $Id$
... $ret[$body] = $doc->f($type); } $this->restoreDb(); } catch (XSException $e) { if ($e->getCode() != XS_CMD_ERR_XAPIAN) { throw $e; } } $this->xs->restoreScheme(); return $ret;} 获取热门搜索词列表
... echo '200'; } } catch(XSException $e) { echo '500'; } 更新 try { $xs = new XS('projectname'); $index =...
...ode("\n", XS::convert($res->buf, $this->_charset, 'UTF-8')); } } catch (XSException $e) { if ($e->getCode() != XS_CMD_ERR_XAPIAN) { throw $e; } } return $ret;} 获取修正后的搜索词列表 通常当某次检索结果数量偏少时, 可以用该函...
...(count($ret) == $limit) { break; } } } catch (XSException $e) { if ($e->getCode() != XS_CMD_ERR_XAPIAN) { throw $e; } } $this->restoreDb(); $this->xs->restoreScheme(); $this->_defaultOp = $op; return $ret;} 获取相关...
...}'; throw new XSException($msg); } } } catch (XSException $e) { if ($e->getCode() != XS_CMD_ERR_XAPIAN) { throw $e; } } return $ret;} 获取展开的搜索词列表
... $this->obj = new SQLite3($param['path'], SQLITE3_OPEN_READONLY); } catch (Exception $e) { throw new XSException($e->getMessage()); }} 打开数据库 query() 方法 public mixed query(string $sql) $sql string 要执行的 SQL 语句 {return} mixed ...
...ass'] : ''; try { $this->obj = new PDO($dsn, $user, $pass); } catch (PDOException $e) { throw new XSException($e->getMessage()); }} 连接数据库 具体的每个类必须实现 makeDsn 来将参数转换为 dsn 参见 makeDsn makeDsn() 方法 abstract prot...
..._rebuild === true) { try { $this->endRebuild(); } catch (Exception $e) { } } foreach (self::$_adds as $srv) { $srv->close(); } self::$_adds = array(); parent::__destruct();} 析构函数 在此自动关闭开启的 rebuild add(...
...ode("\n", XS::convert($res->buf, $this->_charset, 'UTF-8')); } } catch (XSException $e) { if ($e->getCode() != XS_CMD_ERR_XAPIAN) { throw $e; } } return $ret;} 获取修正后的搜索词列表 通常当某次检索结果数量偏少时, 可以用该函...