2014-06-20 2 views
0

sphinxapi.php를 변경해야합니다. (usr/local/sphinx/lib/sphinxapi.php)에서 sphinxapi.php를 변경했는데 새 기능을 사용하려면 어떻게해야합니까? ?sphinxapi.php를 변경하고 스핑크스를 다시 시작하십시오.

내 PHP :

<?php 

      $sphinx = new SphinxClient(); 
      $sphinx->SetServer($this->config->sphinx->host, $this->config->sphinx->port); 
      $sphinx->SetMatchMode(SPH_MATCH_ALL); 
      $sphinx->SetLimits(0, 1,1); 

..filters... 

      $sphinx->RemoveFilter($color['id']); 

나의 새로운 기능 :

function RemoveFilter ($attribute) 
    { 
     assert (is_string($attribute)); 

     foreach($this->_filters AS $key => $filter){ 
     if($filter['attr'] == $attribute){ 
      unset($this->_filters[$key]); 
      break; 
     } 
     } 
    } 

오류 : 추측에서

Fatal error: Call to undefined method SphinxClient::RemoveFilter() in 

답변

1

, 당신은 스핑크스와 함께 제공되는 하나를 수정했지만 응용 프로그램 자체는 다른 'sphinxapi.php'와 같은 을 사용하고 있습니다. 높이 올랐다.

심지어는 스핑크스 확장이 설치되어 있으므로 SphinxClient이 아닌 'sphinxapi.php'가 제공되므로 확장을 제거하십시오.