Пример #1
0
 /**
  * @param                $method
  * @param                $path
  * @param RequestOptions $options
  *
  * @return Response|string
  * @throws \Phalcon\Exception
  */
 public static function getResponse($method, $path, RequestOptions $options = null)
 {
     $instance = static::getInstance();
     if ($options) {
         // Get via HTTP
         if (isset($instance->url) && $options->isHttp()) {
             return $instance->getHTTPResponse($method, $path, $options);
         }
     }
     // Get from the internal call if available
     if (isset($instance->app)) {
         return $instance->getRawResponse($method, $path, $options);
     }
     // todo better exception message with link
     throw new Exception('No app configured for internal calls,
       and no URL supplied for HTTP based calls');
 }