...t() 方法 public void connect($param) $param 源码: sdk/php/util/XSDataSource.class.php#L554 (显示) public function connect($param){ $dsn = "host={$param['host']} "; $dsn .= isset($param['port']) ? "port={$param['port']} " : ''; $dsn .= "dbname={$param['dbname']} u...
...的数据 $wdf int 需要记录的次数, 默认为 1 源码: sdk/php/lib/XSSearch.class.php#L831 (显示) public function addSearchLog($query, $wdf = 1){ $cmd = array('cmd' => XS_CMD_SEARCH_ADD_LOG, 'buf' => $query); if ($wdf > 1) { $cmd['buf1'] = pack('i', $wdf); } ...
... {return} bool 文本中是否包含指定词性的词汇 源码: sdk/php/lib/XSTokenizer.class.php#L382 (显示) public function hasWord($text, $xattr){ $text = $this->applySetting($text); $cmd = new XSCommand(XS_CMD_SEARCH_SCWS_GET, XS_CMD_SCWS_HAS_WORD, 0, $text, $xattr); $res ...
...m array 包含 host, port, dbname {return} string 源码: sdk/php/util/XSDataSource.class.php#L877 (显示) protected function makeDsn($param){ $dsn = 'mysql:host=' . (isset($param['host']) ? $param['host'] : 'localhost'); if (isset($param['port']) && $param['port'] !== 3306)...
...sql string 要执行的 SQL 语句 {return} mixed 源码: sdk/php/util/XSDataSource.class.php#L722 (显示) public function query($sql){ //echo "[DEBUG] SQL: $sql\n"; $res = sqlite_query($this->link, $sql); if ($res === false) { throw new XSException('SQLITE ERROR: ...
...urn} 查询结果首行, 失败或无数据则返回 false 源码: sdk/php/util/XSDataSource.class.php#L455 (显示) public function query1($sql){ $sql = preg_replace('/ limit\s+(\d+)(?:\s*,\s*(\d+)|\s+offset\s+(\d+))?\s*$/i', '', $sql); $sql .= ' LIMIT 1'; $res = $this->query($sql...
... {return} XSSearch 返回对象本身以支持串接操作 源码: sdk/php/lib/XSSearch.class.php#L317 (显示) public function setDocOrder($asc = false){ $type = XS_CMD_SORT_TYPE_DOCID | ($asc ? XS_CMD_SORT_FLAG_ASCENDING : 0); $cmd = new XSCommand(XS_CMD_SEARCH_SET_SORT, $type); ...
...用是否由于 IO 错误引起的, 以免发送 quit 指令 源码: sdk/php/lib/XSServer.class.php#L198 (显示) public function close($ioerr = false){ if ($this->_sock && !($this->_flag & self::BROKEN)) { if (!$ioerr && $this->_sendBuffer !== '') { $this->write($this->_se...
... static void copyDir($src, $dst) $src $dst 源码: sdk/php/util/XSUtil.class.php#L194 (显示) public static function copyDir($src, $dst){ if (!($dir = @dir($src)) || (!is_dir($dst) && !@mkdir($dst, 0755, true))) { return false; } while (($entry = $dir->read(...
-d为指定索引库 使用1.0.0自带sdk发现,如下情况 指定-d 索引库后,无法查询,直接报错 条件是,并没有使用默认索引库db,即data/项目/下面没有默认的db索引库 即指定了-d 索引库,也会去查找默认索引库db,并且返回结束...