| api_model_http::getData | | 48 |
| 75 | $status = (isset($info['http_code'])) ? $info['http_code'] : 0;
| | 76 | if (empty($data)) {
| | 77 | throw new api_exception_Backend(
| | 78 | api_exception::THROW_FATAL,
| | 79 | array('url' => $this->url),
| | 80 | 0,
| | 81 | "Empty response returned.");
| | 82 | } else if ($status != 200) {
| | 83 | throw new api_exception_Backend(
| | 84 | api_exception::THROW_FATAL,
| | 85 | array('url' => $this->url),
| | 86 | 0,
| | 87 | "Got a bad HTTP status: " . $status);
| | 88 | }
| | 89 |
| | 90 | return $data;
|
|
| api_model_http::getDOM | | 117 |
| 46 | public function getDOM() {
| | 47 | $xmls = $this->getData();
| | 48 |
| | 49 | $dom = new DOMDocument();
| | 50 | if ($dom->loadXML($xmls) === false) {
| | 51 | throw new api_exception_XmlParseError(api_exception::THROW_FATAL, $this->url);
| | 52 | }
| | 53 |
| | 54 | return $dom;
|
|
| api_model_backend_get::getDOM | localinc/api/command/searchroute.php | 168 |
| 115 | public function getDOM() {
| | 116 | $dom = parent::getDOM();
| | 117 |
| | 118 | // Add some attributes on the root node
| | 119 | $doc = $dom->documentElement;
| | 120 | $doc->setAttribute('server', $this->serverName);
| | 121 | $doc->setAttribute('command', $this->commandName);
| | 122 | foreach ($this->nodeAttributes as $key => $value) {
| | 123 | $doc->setAttribute($key, $value);
|
|
| api_command_searchroute::doRoute | localinc/api/command/searchroute.php | 44 |
| 159 | $addressNormNormFrom = $this->getNormalizedAddress($model->getDOM());
| | 160 | }
| | 161 |
| | 162 | }
| | 163 |
| | 164 | if (!empty($addressTo)) {
| | 165 | $addressTo = api_helpers_string::ensureUtf8($addressTo);
| | 166 | $model = $this->getAddressModel($addressTo, 'pointTo');
| | 167 | $addressNormTo = $this->getNormalizedAddress($model->getDOM());
| | 168 | array_push($this->data, $model);
| | 169 |
| | 170 | if (!empty($addressNormTo)) {
| | 171 | $model = $this->getAddressModel($addressTo, 'pointTo');
| | 172 | $addressNormNormTo = $this->getNormalizedAddress($model->getDOM());
| | 173 | }
| | 174 | }
|
|
| api_command_searchroute::__construct | | 170 |
| 35 | $routeStart = $addressFrom;
| | 36 | $routeEnd = $addressTo;
| | 37 |
| | 38 | $this->doRoute($routeStart, $routeEnd);
| | 39 | return;
| | 40 | }
| | 41 |
| | 42 | if ($addressWhere === '' && $addressPath === '' && $FROM_OR_TO) {
| | 43 | $this->doRoute($addressFrom, $addressTo);
| | 44 | return;
| | 45 | }
| | 46 |
| | 47 | if ($addressPath !== '' && (! is_null($addressFrom))) {
| | 48 | $this->doRoute($addressFrom, $addressPath);
| | 49 | return;
| | 50 | }
|
|
| api_controller::loadCommand | | 113 |
| 161 | } else {
| | 162 | // Inform that both classes could not be found
| | 163 | throw new api_exception_NoCommandFound("Command $cmd or $cmd_old not found.");
| | 164 | }
| | 165 | }
| | 166 |
| | 167 | $config = api_config::getInstance();
| | 168 | $config->load($route['command']);
| | 169 | $this->command = new $cmd($route);
| | 170 | $this->route = &$route;
| | 171 | }
|
|
| api_controller::process | index.php | 6 |
| 110 | public function process() {
| | 111 | try {
| | 112 | $this->loadCommand();
| | 113 | $this->processCommand();
| | 114 | $this->prepareAndDispatch();
| | 115 | } catch(Exception $e) {
| | 116 | $this->catchFinalException($e);
| | 117 | }
| | 118 |
| | 119 | return true;
|
|