コード例 #1
0
 /**
  * FUNCTION: vlibSearchToSQL
  *
  * vlibSearchToSQL constructor.
  *
  * @param array $options see above
  * @return boolean true/false
  * @access private
  */
 function vlibSearchToSQL($options = null)
 {
     if (is_array(vlibIni::vlibSearchToSQL())) {
         foreach (vlibIni::vlibSearchToSQL() as $name => $val) {
             $this->OPTIONS[$name] = $val;
         }
     }
     if (is_array($options)) {
         foreach ($options as $key => $val) {
             if (strtoupper($key) == 'STOP_WORDS') {
                 $this->OPTIONS['STOP_WORDS'] .= ' ' . $val;
             } else {
                 $this->OPTIONS[strtoupper($key)] = $val;
             }
         }
     }
     $this->stop_words = str_replace(' ', '|', $this->OPTIONS['STOP_WORDS']);
     if (!$this->OPTIONS['allow_wildcards']) {
         $this->escapechars .= '%_';
     }
     return true;
 }