浏览代码

Fixed documentation for deprecated feature (Building XML from a remote URL)

As discussed here https://github.com/cakephp/cakephp/issues/6229, the support for remote files was removed for security reasons. 
I changed the comments for the API (http://api.cakephp.org/3.0/class-Cake.Utility.Xml.html) to use the Http Client class that comes bundled with CakePHP.
Maury M. Marques 11 年之前
父节点
当前提交
283bafed31
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/Utility/Xml.php

+ 6 - 2
src/Utility/Xml.php

@@ -49,10 +49,14 @@ class Xml
      * $xml = Xml::build('/path/to/an/xml/file.xml');
      * ```
      *
-     * Building from a remote URL:
+     * Building XML from a remote URL:
      *
      * ```
-     * $xml = Xml::build('http://example.com/example.xml');
+     * use Cake\Network\Http\Client;
+     *
+     * $http = new Client();
+     * $response = $http->get('http://example.com/example.xml');
+     * $xml = Xml::build($response->body());
      * ```
      *
      * Building from an array: