0

我目前正在用 php 创建一个模块。

下面是我的主类文件中包含的一个函数。

...
        $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 类?

4

1 回答 1

0

我已经手动将文件包含在需要它的函数中。这解决了这个问题。

于 2013-09-03T07:51:43.623 回答