2013-08-30 39 views
0

我目前正在php中創建一個模塊。Class.autoload(監督它),並手動獲取類

下面是一個包含在我的主類文件中的函數。

... 
     $xmldebug = simplexml_load_file($response); 
     $xml = new SimpleXMLElement($response); 
      if (!$xml) 
       throw new Exception(_("Registry return malformed XML")); 

     $result_attributes = $xml->response->result->attributes(); 
     $response_code = (string)$result_attributes["code"]; 

      if ($response_code == RFC3730_RESULT_CODE::ERR_CMD_FAILED || 
       $response_code == RFC3730_RESULT_CODE::ERR_CMD_FAILED_END_SESSION) 
       throw new Exception(_("Registry error")); 


      if ($response_code == RFC3730_RESULT_CODE::ERR_CMD_FAILED_END_SESSION || 
       $response_code == RFC3730_RESULT_CODE::ERR_AUTH_END_SESSION || 
       $response_code == RFC3730_RESULT_CODE::OK_END_SESSION || 
       $response_code == RFC3730_RESULT_CODE::ERR_SESSION_LIMIT_EXCEEDED) 
       $this->IsConnected = false; 

      if ($response_code == RFC3730_RESULT_CODE::ERR_OBJECT_NOT_EXISTS) 
       throw new ObjectNotExistsException(); 
      if ($response_code == RFC3730_RESULT_CODE::ERR_OBJECT_STATUS_PROHIBITS_OP) 
       throw new ProhibitedTransformException(); 
      if ($response_code == RFC3730_RESULT_CODE::ERR_OBJECT_EXISTS) 
       throw new ObjectExistsException(); 
          echo $response_code; 

      $ok_codes = array( RFC3730_RESULT_CODE::OK, 
           RFC3730_RESULT_CODE::OK_ACK_DEQUEUE, 
           RFC3730_RESULT_CODE::OK_END_SESSION, 
           RFC3730_RESULT_CODE::OK_NO_MESSAGES, 
           RFC3730_RESULT_CODE::OK_PENDING 
          ); 

      $is_success = in_array($response_code, $ok_codes); 
... 

我在做一些測試「localy」我有enum.RFC3730_RESULT_CODE文件(其中包含RFC3730_RESULT_CODE類)與其他文件在同一目錄。 現在,我試圖讓我的平臺再次把文件在同一目錄作爲我的主類對這個模塊,但我得到下面的錯誤

Exception: Unable to load/locate class RFC3730_RESULT_CODE IN /xxxx/xxxx/xxxx/core/class.autoload.php(127) 

class.autoload.php文件進行加密,從而沒有任何我可以監督它並獲得使用RFC3730類嗎?

回答

0

我已經手動將文件包含在需要它的函數中。這已經解決了這個問題。