...示) protected function connect(){ // connect to server $conn = $this->_conn; if (is_int($conn) || is_numeric($conn)) { $host = 'localhost'; $port = intval($conn); } elseif (!strncmp($conn, 'file://', 7)) { // write-only for saving index exchangable data to file ...
setMultiSort() 方法 (自版本 v1.1.0 起可用) public XSSearch setMultiSort(array $fields, bool $reverse=false, bool $relevance_first=false) $fields array 排序依据的字段数组, 以字段名称为键, true/false 为值表示正序或逆序 $reverse bool 是否为倒...
...getRelPath($file){ $from = getcwd(); $file = realpath($file); if (is_dir($file)) { $pos = false; $to = $file; } else { $pos = strrpos($file, '/'); $to = substr($file, 0, $pos); } for ($rel = '';; $rel .= '../') { if ($from === $to) { br...
...n addTerm($field, $term, $weight = 1){ $field = strval($field); if (!is_array($this->_terms)) { $this->_terms = array(); } if (!isset($this->_terms[$field])) { $this->_terms[$field] = array($term => $weight); } elseif (!isset($this->_terms[$field][$term])) { $this...
getDataList() 方法 protected void getDataList() 源码: sdk/php/util/XSDataSource.class.php#L392 (显示) protected function getDataList(){ if (($item = fgetcsv($this->fd, 0, $this->delim)) === false) { if ($this->inCli) { echo "INFO: reach end of file or error occ...
...blic static function copyDir($src, $dst){ if (!($dir = @dir($src)) || (!is_dir($dst) && !@mkdir($dst, 0755, true))) { return false; } while (($entry = $dir->read()) !== false) { if ($entry === '.' || $entry === '..') { continue; } $psrc = $src . DIRECT...
...\s+offset\s+(\d+))?\s*$/i', '', $sql); $sql .= ' LIMIT 1'; $res = $this->query($sql); return (is_array($res) && isset($res[0])) ? $res[0] : false;} 查询数据库首行
...ion __construct($cmd, $arg1 = 0, $arg2 = 0, $buf = '', $buf1 = ''){ if (is_array($cmd)) { foreach ($cmd as $key => $value) { if ($key === 'arg' || property_exists($this, $key)) { $this->$key = $value; } } } else { $this->cmd = $cmd; ...
...) public function __toString(){ $string = '[' . __CLASS__ . '] ' . $this->getRelPath($this->getFile()) . '(' . $this->getLine() . '): '; $string .= $this->getMessage() . ($this->getCode() > 0 ? '(S#' . $this->getCode() . ')' : ''); return $string;} 将类对象转换成字符串 get...
...口, 以支持 foreach 遍历访问字段列表 XSDocument offsetExists() ArrayAccess 接口, 判断字段是否存在, 勿直接调用 XSDocument offsetGet() ArrayAccess 接口, 取得字段值, 勿直接调用 XSDocument offsetSet() ArrayAccess 接口, 设置字段值, 勿...