Ver código fonte

Update : update http client use namespace instead

Zhu Jinhui 6 anos atrás
pai
commit
32bd80188f
1 arquivos alterados com 9 adições e 12 exclusões
  1. 9 12
      src/Library/Http.php

+ 9 - 12
src/Library/Http.php

@@ -1,5 +1,5 @@
 <?php
- namespace Qii\Library;
+namespace Qii\Library;
 /**
  * A parallel HTTP client written in pure PHP
  *
@@ -9,20 +9,17 @@
  * @link http://hightman.cn
  * @copyright Copyright (c) 2015 Twomice Studio.
  */
-
-_require(array(
-		 __DIR__ . '/Third/hightman/ParseInterface.php',
-		__DIR__ . '/Third/hightman/HeaderTrait.php',
-		__DIR__ . '/Third/hightman/Client.php',
-		__DIR__ . '/Third/hightman/Connection.php',
-		__DIR__ . '/Third/hightman/Response.php',
-		__DIR__ . '/Third/hightman/Request.php',
-		__DIR__ . '/Third/hightman/Processor.php'
-	)
-);
+\Qii\Autoloader\Psr4::getInstance()
+    ->setUseNamespaces([
+        ['hightman\http', true],
+    ])
+    ->addNamespaces([
+        ['hightman\http', Qii_DIR . DS .'Library'. DS . 'Third'. DS .'hightman'],
+    ]);
 use hightman\http\Client;
 use hightman\http\Request;
 use hightman\http\Response;
+
 class Http extends Client
 {