@@ -13,10 +13,11 @@ |
||
13 | 13 | * @param $upToken 上传凭证 |
14 | 14 | * @param $key 上传文件名 |
15 | 15 | * @param $data 上传二进制流 |
16 | - * @param $config 上传配置 |
|
16 | + * @param \Qiniu\Config $config 上传配置 |
|
17 | 17 | * @param $params 自定义变量,规格参考 |
18 | 18 | * http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar |
19 | - * @param $mime 上传数据的mimeType |
|
19 | + * @param string $mime 上传数据的mimeType |
|
20 | + * @param boolean $checkCrc |
|
20 | 21 | * |
21 | 22 | * @return array 包含已上传文件的信息,类似: |
22 | 23 | * [ |
@@ -21,6 +21,10 @@ |
||
21 | 21 | public $iovipHost; |
22 | 22 | |
23 | 23 | //构造一个Region对象 |
24 | + |
|
25 | + /** |
|
26 | + * @param string $iovipHost |
|
27 | + */ |
|
24 | 28 | public function __construct( |
25 | 29 | $srcUpHosts = array(), |
26 | 30 | $cdnUpHosts = array(), |
@@ -775,42 +775,64 @@ discard block |
||
775 | 775 | return $scheme . Config::UC_HOST; |
776 | 776 | } |
777 | 777 | |
778 | + /** |
|
779 | + * @param string $body |
|
780 | + */ |
|
778 | 781 | private function rsPost($path, $body = null) |
779 | 782 | { |
780 | 783 | $url = $this->getRsHost() . $path; |
781 | 784 | return $this->post($url, $body); |
782 | 785 | } |
783 | 786 | |
787 | + /** |
|
788 | + * @param string $path |
|
789 | + */ |
|
784 | 790 | private function apiPost($path, $body = null) |
785 | 791 | { |
786 | 792 | $url = $this->getApiHost() . $path; |
787 | 793 | return $this->post($url, $body); |
788 | 794 | } |
789 | 795 | |
796 | + /** |
|
797 | + * @param string $path |
|
798 | + * @param string $body |
|
799 | + */ |
|
790 | 800 | private function ucPost($path, $body = null) |
791 | 801 | { |
792 | 802 | $url = $this->getUcHost() . $path; |
793 | 803 | return $this->post($url, $body); |
794 | 804 | } |
795 | 805 | |
806 | + /** |
|
807 | + * @param string $path |
|
808 | + */ |
|
796 | 809 | private function ucGet($path) |
797 | 810 | { |
798 | 811 | $url = $this->getUcHost() . $path; |
799 | 812 | return $this->get($url); |
800 | 813 | } |
801 | 814 | |
815 | + /** |
|
816 | + * @param string $path |
|
817 | + */ |
|
802 | 818 | private function apiGet($path) |
803 | 819 | { |
804 | 820 | $url = $this->getApiHost() . $path; |
805 | 821 | return $this->get($url); |
806 | 822 | } |
807 | 823 | |
824 | + /** |
|
825 | + * @param string $path |
|
826 | + */ |
|
808 | 827 | private function rsGet($path) |
809 | 828 | { |
810 | 829 | $url = $this->getRsHost() . $path; |
811 | 830 | return $this->get($url); |
812 | 831 | } |
813 | 832 | |
833 | + /** |
|
834 | + * @param string $url |
|
835 | + */ |
|
814 | 836 | private function get($url) |
815 | 837 | { |
816 | 838 | $headers = $this->auth->authorization($url); |
@@ -821,6 +843,9 @@ discard block |
||
821 | 843 | return array($ret->json(), null); |
822 | 844 | } |
823 | 845 | |
846 | + /** |
|
847 | + * @param string $url |
|
848 | + */ |
|
824 | 849 | private function post($url, $body) |
825 | 850 | { |
826 | 851 | $headers = $this->auth->authorization($url, $body, 'application/x-www-form-urlencoded'); |
@@ -832,11 +857,18 @@ discard block |
||
832 | 857 | return array($r, null); |
833 | 858 | } |
834 | 859 | |
860 | + /** |
|
861 | + * @param string $path |
|
862 | + * @param string $body |
|
863 | + */ |
|
835 | 864 | private function ucPostV2($path, $body){ |
836 | 865 | $url = $this->getUcHost() . $path; |
837 | 866 | return $this->postV2($url, $body); |
838 | 867 | } |
839 | 868 | |
869 | + /** |
|
870 | + * @param string $url |
|
871 | + */ |
|
840 | 872 | private function postV2($url, $body) |
841 | 873 | { |
842 | 874 | $headers = $this->auth->authorizationV2($url, 'POST', $body, 'application/json'); |
@@ -905,6 +937,9 @@ discard block |
||
905 | 937 | return $data; |
906 | 938 | } |
907 | 939 | |
940 | + /** |
|
941 | + * @param string $operation |
|
942 | + */ |
|
908 | 943 | private static function oneKeyBatch($operation, $bucket, $keys) |
909 | 944 | { |
910 | 945 | $data = array(); |
@@ -914,6 +949,9 @@ discard block |
||
914 | 949 | return $data; |
915 | 950 | } |
916 | 951 | |
952 | + /** |
|
953 | + * @param string $operation |
|
954 | + */ |
|
917 | 955 | private static function twoKeyBatch($operation, $source_bucket, $key_pairs, $target_bucket, $force) |
918 | 956 | { |
919 | 957 | if ($target_bucket === null) { |