예제 #1
0
파일: Search.php 프로젝트: m3uzz/onionfw
 public function createRLikeTerm()
 {
     if ($this->_sSearchType == "expression") {
         $this->_sQuery = String::clearSignals($this->_sExpression);
     } elseif ($this->_sSearchType == "specific") {
         if (is_array($this->_aWithWords)) {
             foreach ($this->_aWithWords as $lsWord) {
                 $lsWord = String::clearSignals($lsWord);
                 $this->_sQuery .= "({$lsWord})+";
             }
         }
         if (is_array($this->_aWithoutWords)) {
             foreach ($this->_aWithoutWords as $lsWord) {
                 $lsWord = String::clearSignals($lsWord);
                 $this->_sQuery .= "({$lsWord})";
             }
         }
     } elseif ($this->_sSearchType == "boolean") {
         $lsOr = "";
         if (is_array($this->_aAndWords)) {
             foreach ($this->_aAndWords as $lsWord) {
                 $lsWord = String::clearSignals($lsWord);
                 $this->_sQuery .= "({$lsWord})+.*";
                 $lsOr = "|";
             }
         }
         if (is_array($this->_aOrWords)) {
             foreach ($this->_aOrWords as $lsWord) {
                 $lsWord = String::clearSignals($lsWord);
                 $this->_sQuery .= "{$lsOr}({$lsWord}.*)";
                 $lsOr = "|";
             }
         }
     }
 }