Sfoglia il codice sorgente

compare and handle files which merged from car_dev branch

stanley-king 6 anni fa
parent
commit
e7815db268
100 ha cambiato i file con 9961 aggiunte e 1093 eliminazioni
  1. 0 47
      admin/control/car_import.php
  2. 0 97
      admin/control/goods_plus.php
  3. 0 82
      admin/control/spec.php
  4. 20 245
      admin/control/store.php
  5. 0 2
      admin/include/menu.php
  6. 0 7
      admin/templates/default/cache.clear.php
  7. 0 32
      admin/templates/default/car_import.index.php
  8. 0 102
      admin/templates/default/goods_plus.add.php
  9. 0 126
      admin/templates/default/goods_plus.index.php
  10. 1 0
      admin/templates/default/mb_special_item.module_home5.php
  11. 0 100
      admin/templates/default/sp_value.add.php
  12. 0 18
      admin/templates/default/spec.add.php
  13. 0 1
      admin/templates/default/spec.edit.php
  14. 8 15
      admin/templates/default/spec.index.php
  15. 0 21
      admin/templates/default/store.edit.php
  16. 0 9
      admin/templates/default/store.index.php
  17. 2 4
      admin/templates/default/store_import.php
  18. 0 11
      admin/templates/default/store_joinin.detail.php
  19. 0 9
      admin/templates/default/store_joinin.php
  20. 1 1
      admin/templates/default/web_brand.list.php
  21. 1 1
      admin/templates/default/web_code.edit.php
  22. 0 129
      car/testSubmit.html
  23. 37 0
      core/framework/function/core.php
  24. 58 1
      core/framework/function/http.php
  25. 300 0
      core/framework/libraries/geohash.php
  26. 14 0
      core/framework/libraries/log.php
  27. 23 1
      core/framework/libraries/pinyin.php
  28. 0 31
      crontab/control/command.php
  29. 7 1
      crontab/crawl/upload_control.php
  30. 2 0
      data/api/aliyun-oss-php-sdk-2.3.0/.coveralls.yml
  31. 8 0
      data/api/aliyun-oss-php-sdk-2.3.0/.gitignore
  32. 21 0
      data/api/aliyun-oss-php-sdk-2.3.0/.travis.yml
  33. 92 0
      data/api/aliyun-oss-php-sdk-2.3.0/CHANGELOG.md
  34. 21 0
      data/api/aliyun-oss-php-sdk-2.3.0/LICENSE.md
  35. 149 0
      data/api/aliyun-oss-php-sdk-2.3.0/README-CN.md
  36. 150 0
      data/api/aliyun-oss-php-sdk-2.3.0/README.md
  37. 11 0
      data/api/aliyun-oss-php-sdk-2.3.0/autoload.php
  38. 13 0
      data/api/aliyun-oss-php-sdk-2.3.0/build-phar.sh
  39. 24 0
      data/api/aliyun-oss-php-sdk-2.3.0/composer.json
  40. BIN
      data/api/aliyun-oss-php-sdk-2.3.0/example.jpg
  41. 3 0
      data/api/aliyun-oss-php-sdk-2.3.0/index.php
  42. 19 0
      data/api/aliyun-oss-php-sdk-2.3.0/phpunit.xml
  43. 167 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/Bucket.php
  44. 108 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/BucketCors.php
  45. 109 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/BucketLifecycle.php
  46. 95 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/BucketLogging.php
  47. 101 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/BucketReferer.php
  48. 92 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/BucketWebsite.php
  49. 83 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/Callback.php
  50. 84 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/Common.php
  51. 15 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/Config.php
  52. 87 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/Image.php
  53. 125 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/LiveChannel.php
  54. 182 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/MultipartUpload.php
  55. 517 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/Object.php
  56. 13 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/RunAll.php
  57. 143 0
      data/api/aliyun-oss-php-sdk-2.3.0/samples/Signature.php
  58. 262 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Core/MimeTypes.php
  59. 54 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Core/OssException.php
  60. 461 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Core/OssUtil.php
  61. 25 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Http/LICENSE
  62. 896 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Http/RequestCore.php
  63. 8 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Http/RequestCore_Exception.php
  64. 56 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Http/ResponseCore.php
  65. 78 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/BucketInfo.php
  66. 39 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/BucketListInfo.php
  67. 99 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/CnameConfig.php
  68. 113 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/CorsConfig.php
  69. 150 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/CorsRule.php
  70. 34 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/GetLiveChannelHistory.php
  71. 68 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/GetLiveChannelInfo.php
  72. 107 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/GetLiveChannelStatus.php
  73. 88 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LifecycleAction.php
  74. 107 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LifecycleConfig.php
  75. 126 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LifecycleRule.php
  76. 134 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/ListMultipartUploadInfo.php
  77. 97 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/ListPartsInfo.php
  78. 121 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LiveChannelConfig.php
  79. 59 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LiveChannelHistory.php
  80. 107 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LiveChannelInfo.php
  81. 107 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LiveChannelListInfo.php
  82. 86 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LoggingConfig.php
  83. 93 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/ObjectInfo.php
  84. 126 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/ObjectListInfo.php
  85. 63 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/PartInfo.php
  86. 36 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/PrefixInfo.php
  87. 93 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/RefererConfig.php
  88. 74 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/StorageCapacityConfig.php
  89. 55 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/UploadInfo.php
  90. 76 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/WebsiteConfig.php
  91. 27 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/XmlConfig.php
  92. 2739 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/OssClient.php
  93. 32 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/AclResult.php
  94. 27 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/AppendResult.php
  95. 19 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/BodyResult.php
  96. 21 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/CallbackResult.php
  97. 30 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/CopyObjectResult.php
  98. 27 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/DeleteObjectsResult.php
  99. 35 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/ExistResult.php
  100. 0 0
      data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetCnameResult.php

+ 0 - 47
admin/control/car_import.php

@@ -1,47 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: lionared
- * Date: 2018/3/15
- * Time: 上午11:18
- */
-
-defined('InShopNC') or exit('Access Invalid!');
-require_once(BASE_ROOT_PATH . '/helper/car/importer.php');
-
-class car_importControl extends SystemControl {
-
-    public function __construct(){
-        parent::__construct();
-    }
-
-    public function indexOp()
-    {
-        if(isset($_POST['import'])) {
-            $file = $_FILES['csv_cars'];
-            $file_type = substr(strstr($file['name'], '.'), 1);
-
-            //上传文件存在判断
-            if(empty($file['name'])){
-                showMessage('请选择要上传csv的文件!','','html','error');
-            }
-
-            // 检查文件格式
-            if ($file_type != 'csv') {
-                showMessage('文件格式不对,请重新上传!','','html','error');
-                exit;
-            }
-
-            $delimiter = trim($_POST['delimiter']);
-
-            $importer = new car\importer($delimiter);
-            //暂时屏蔽车型数据导入
-            //$importer->run($file['tmp_name']);
-
-            showMessage('操作完成,暂未开放' , urlAdmin('car_import', 'index'));
-            return;
-        }
-
-        Tpl::showpage('car_import.index');
-    }
-}

+ 0 - 97
admin/control/goods_plus.php

@@ -1,97 +0,0 @@
-<?php
-/**
- * 商品附加条款管理
- * User: lionared
- * Date: 2018/3/1
- * Time: 下午2:47
- */
-
-defined('InShopNC') or exit('Access Invalid!');
-class goods_plusControl extends SystemControl {
-
-    public function __construct(){
-        parent::__construct();
-        //Language::read('');
-    }
-
-    public function indexOp()
-    {
-        $lang	= Language::getLangContent();
-
-        $page	= new Page();
-        $page->setEachNum(10);
-        $page->setStyle('admin');
-
-        $plus_list = Model('goods_plus')->goodsPlusList();
-
-        Tpl::output('page',$page->show());
-        Tpl::output('plus_list', $plus_list);
-        Tpl::showpage('goods_plus.index');
-    }
-
-    public function addOp()
-    {
-        $lang	= Language::getLangContent();
-
-        if (chksubmit()) {
-            $obj_validate = new Validator();
-            $obj_validate->validateparam = array(
-                array("input" => $_POST['gp_name'], "require" => "true", "message" => '购车附加条款内容不能为空')
-            );
-            $error = $obj_validate->validate();
-            if ($error != ''){
-                showMessage($error);
-            }else {
-                //处理提交数据
-                $goods_plus = [];
-                $goods_plus['gp_name'] = trim($_POST['gp_name']);
-                $goods_plus['gp_type'] = intval($_POST['gp_type']);
-                $goods_plus['gp_sort'] = intval($_POST['gp_sort']);
-
-                $add_result = Model('goods_plus')->addGoodsPlus($goods_plus);
-                if($add_result) {
-                    $url = array(
-                        array(
-                            'url'=>'index.php?act=goods_plus&op=add',
-                            'msg'=> '继续添加购车附加条款'
-                        ),
-                        array(
-                            'url'=>'index.php?act=goods_plus&op=index',
-                            'msg'=> '返回购车附加条款管理首页'
-                        )
-                    );
-                    $this->log('添加购车附加条款'.'['.$_POST['gp_name'].']',1);
-                    showMessage($lang['nc_common_save_succ'], $url);
-                }else {
-                    $this->log('添加购车附加条款'.'['.$_POST['gp_name'].']',0);
-                    showMessage($lang['nc_common_save_fail']);
-                }
-            }
-        }
-
-        Tpl::showpage('goods_plus.add');
-    }
-
-    public function ajax_editOp()
-    {
-        $where = [
-            'gp_id' => intval($_GET['gp_id'])
-        ];
-        $update = [
-            'gp_name' => trim($_GET['gp_name']),
-            //'gp_type' => intval($_GET['gp_type']),
-            'gp_sort' => intval($_GET['gp_sort']),
-        ];
-        $result = Model('goods_plus')->editGoodsPlus($update, $where);
-        echo json_encode(['done'=>$result]);exit();
-    }
-
-    public function ajax_deleteOp()
-    {
-        $where = [
-            'gp_id' => intval($_GET['gp_id'])
-        ];
-        $result = Model('goods_plus')->delGoodsPlus($where);
-        echo json_encode(['done'=>$result]);exit();
-    }
-}

+ 0 - 82
admin/control/spec.php

@@ -49,7 +49,6 @@ class specControl extends SystemControl {
 			}else {
 				$spec = array();
 				$spec['sp_name']		= $_POST['s_name'];
-				$spec['sp_type']        = intval($_POST['sp_type']);
 				$spec['sp_sort']		= intval($_POST['s_sort']);
 				$spec['class_id']		= $_POST['class_id'];
 				$spec['class_name']		= $_POST['class_name'];
@@ -81,53 +80,6 @@ class specControl extends SystemControl {
 		Tpl::showpage('spec.add');
 	}
 
-	public function spec_value_addOp()
-    {
-        $lang	= Language::getLangContent();
-        $model_spec = Model('spec');
-        if(chksubmit()) {
-            $obj_validate = new Validator();
-            $obj_validate->validateparam = array(
-                array("input"=>$_POST["sp_value"], "require"=>"true", "message"=>$lang['spec_add_name_no_null'])
-            );
-            $error = $obj_validate->validate();
-            if ($error != ''){
-                showMessage($error);
-            }else {
-                $sp_value = [];
-                $sp_value['sp_value_name']  = $_POST["sp_value"];
-                $sp_value['sp_value_sort']	= intval($_POST['s_sort']);
-                $sp_value['sp_id']          = intval($_POST['sp_id']);
-                $sp_value['gc_id']          = $model_spec->spec_gc_id($sp_value['sp_id']);
-
-                $add_new = $model_spec->addSpecValue($sp_value);
-                if($add_new) {
-                    $url = array(
-                        array(
-                            'url'=>'index.php?act=spec&op=spec_value_add',
-                            'msg'=>"继续添加规格值"
-                        ),
-                        array(
-                            'url'=>'index.php?act=spec&op=spec',
-                            'msg'=>$lang['spec_index_return_type_list']
-                        )
-                    );
-                    $this->log(L('nc_add,spec_index_spec_name').'['.$_POST['s_name'].']',1);
-                    showMessage($lang['nc_common_save_succ'], $url);
-                } else {
-                    $this->log(L('nc_add,spec_index_spec_name').'['.$_POST['s_name'].']',0);
-                    showMessage($lang['nc_common_save_fail']);
-                }
-            }
-        }
-
-        // 获取平台通用规格
-        $sp_list = $model_spec->specPlatformList();
-        Tpl::output('sp_list', $sp_list);
-
-        Tpl::showpage('sp_value.add');
-    }
-
 	/**
 	 * 编辑规格
 	 */
@@ -263,40 +215,6 @@ class specControl extends SystemControl {
 		}
 	}
 
-	public function ajax_spec_valuesOp()
-    {
-        $sp_id = intval($_GET['sp_id']);
-        $mod_spec = Model('spec');
-        $spec_values = $mod_spec->getSpecValueList(['sp_id'=>$sp_id]);
-        if(!empty($spec_values)) {
-            echo json_encode($spec_values);exit;
-        } else {
-            echo '';exit;
-        }
-    }
-
-    public function ajax_edit_spec_valueOp()
-    {
-        $sp_value_id = intval($_GET['sp_value_id']);
-        $mod_spec = Model('spec');
-        $sp_id = $mod_spec->spec_value_belong_to($sp_value_id);
-        $where = ['sp_value_id'=>$sp_value_id];
-        $update = [
-            'sp_id'         => $sp_id,
-            'sp_value_name' => $_GET['sp_value_name'],
-            'sp_value_sort' => intval($_GET['sp_value_sort']),
-        ];
-        $update = $mod_spec->editSpecValue($update, $where);
-        echo json_encode($update);exit;
-    }
-
-    public function ajax_del_spec_valueOp()
-    {
-        $sp_value_id = intval($_GET['sp_value_id']);
-        $del = Model('spec')->delSpecValue(['sp_value_id'=>$sp_value_id]);
-        echo json_encode($del);exit;
-    }
-
 	/**
 	 * 规格导出
 	 */

+ 20 - 245
admin/control/store.php

@@ -3,7 +3,7 @@
  * 店铺管理界面
  *
  **by 好商城V3 www.33hao.com 运营版*/
-ini_set('auto_detect_line_endings', 1);
+
 defined('InShopNC') or exit('Access Invalid!');
 
 class storeControl extends SystemControl{
@@ -120,7 +120,6 @@ class storeControl extends SystemControl{
 			$update_array['store_xiaoxie'] = trim($_POST['store_xiaoxie']);//保障服务-消协
 			$update_array['store_huodaofk'] = trim($_POST['store_huodaofk']);//保障服务-货到付款
 			$update_array['store_shiti'] = trim($_POST['store_shiti']);//保障服务-实体店铺
-            $update_array['store_type']     = intval($_POST['store_type']);//商家类型
 			if ($update_array['store_state'] == 0){
 				//根据店铺状态修改该店铺所有商品状态
 				$model_goods = Model('goods');
@@ -184,15 +183,7 @@ class storeControl extends SystemControl{
             }
             $param = array();
             $param['company_name'] = $_POST['company_name'];
-            $province_id    = intval($_POST['province_id']);
-            $city_id        = intval($_POST['city_id']);
-            if($province_id > 0) {
-                $param['company_province_id'] = $province_id;
-            }
-            if($city_id > 0) {
-                $param['company_city_id'] = $city_id;
-            }
-
+            $param['company_province_id'] = intval($_POST['province_id']);
             $param['company_address'] = $_POST['company_address'];
             $param['company_address_detail'] = $_POST['company_address_detail'];
             $param['company_phone'] = $_POST['company_phone'];
@@ -236,28 +227,22 @@ class storeControl extends SystemControl{
             }
             $result = Model('store_joinin')->editStoreJoinin(array('member_id' => $member_id), $param);
             if ($result) {
-                //好商城V3-B11 更新店铺信息
-                $store_update = array();
-                $store_update['store_company_name']=$param['company_name'];
-                $store_update['area_info']=$param['company_address'];
-                $store_update['store_address']=$param['company_address_detail'];
-                if(isset($param['company_province_id'])) {
-                    $store_update['province_id']    = $param['company_province_id'];
-                }
-                if(isset($param['company_city_id'])) {
-                    $store_update['city_id']    = $param['company_city_id'];
-                }
-                $model_store = Model('store');
-                $store_info = $model_store->getStoreInfo(array('member_id'=>$member_id));
-                if(!empty($store_info)) {
-                    $r=$model_store->editStore($store_update, array('member_id'=>$member_id));
+		//好商城V3-B11 更新店铺信息
+	    	$store_update = array();
+		$store_update['store_company_name']=$param['company_name'];
+		$store_update['area_info']=$param['company_address'];
+		$store_update['store_address']=$param['company_address_detail'];
+		$model_store = Model('store');
+		$store_info = $model_store->getStoreInfo(array('member_id'=>$member_id));
+		if(!empty($store_info)) {						
+                $r=$model_store->editStore($store_update, array('member_id'=>$member_id));
 
-                    $this->log('编辑店铺信息' . '[ID:' . $r. ']', 1);
-                }
-                    showMessage(L('nc_common_op_succ'), 'index.php?act=store&op=store');
-                } else {
-                    showMessage(L('nc_common_op_fail'));
-                }
+		$this->log('编辑店铺信息' . '[ID:' . $r. ']', 1);
+		}
+                showMessage(L('nc_common_op_succ'), 'index.php?act=store&op=store');
+            } else {
+                showMessage(L('nc_common_op_fail'));
+            }
         }
     }
     
@@ -701,7 +686,6 @@ class storeControl extends SystemControl{
 			$shop_array['sc_id']		= $joinin_detail['sc_id'];
             $shop_array['store_company_name'] = $joinin_detail['company_name'];
 			$shop_array['province_id']	= $joinin_detail['company_province_id'];
-            $shop_array['city_id']	    = $joinin_detail['company_city_id'];
 			$shop_array['area_info']	= $joinin_detail['company_address'];
 			$shop_array['store_address']= $joinin_detail['company_address_detail'];
 			$shop_array['store_zip']	= '';
@@ -709,10 +693,7 @@ class storeControl extends SystemControl{
 			$shop_array['store_state']	= 1;
             $shop_array['store_time']	= time();
             $shop_array['store_end_time'] = strtotime(date('Y-m-d 23:59:59', strtotime('+1 day'))." +".intval($joinin_detail['joinin_year'])." year");
-            $shop_array['bind_all_gc']  = 1;
-
             $store_id = $model_store->addStore($shop_array);
-            QueueClient::push('UpdateSotreLocation',['store_id' => $store_id]);
 
             if($store_id) {
                 //写入卖家账号
@@ -862,8 +843,6 @@ class storeControl extends SystemControl{
             $saveArray['is_own_shop'] = 0;
 
             $storeId = $storeModel->addStore($saveArray);
-            QueueClient::push('UpdateSotreLocation',['store_id' => $storeId]);
-
 
             model('seller')->addSeller(array(
                 'seller_name' => $_POST['seller_name'],
@@ -997,185 +976,8 @@ class storeControl extends SystemControl{
     public function store_importOp(){
 		Tpl::showpage('store_import');    
     }
-
-    public function store_import_csv_xOp()
-    {
-        if (isset($_POST['import']))
-        {
-            $file = $_FILES['csv_stores'];
-            $file_type = substr(strstr($file['name'], '.'), 1);
-
-            //上传文件存在判断
-            if(empty($file['name'])){
-                showMessage('请选择要上传csv的文件!','','html','error');
-            }
-
-            // 检查文件格式
-            if ($file_type != 'csv') {
-                showMessage('文件格式不对,请重新上传!','','html','error');
-                exit;
-            }
-
-            $delimiter = ";";
-            if(isset($_POST['delimiter'])) $delimiter=trim(strval($_POST['delimiter']));
-
-            $handle = @fopen($file['tmp_name'], "r");
-            $encoding = $this->get_str_encoding(file_get_contents($file['tmp_name']));
-            $result = $this->read_csv($handle, $encoding, $delimiter);
-            $rows = count($result);
-            if($rows == 0){
-                showMessage('没有任何数据!','','html','error');
-                exit;
-            }
-
-            $scounter = 0;
-
-            for ($i = 0; $i < $rows; $i++) {
-                //循环获取各字段值
-                $store_name = $result[$i][0];
-                $member_name = $result[$i][1];
-                $seller_name = $result[$i][2];
-                $password = $result[$i][3];
-                $store_company_name = $result[$i][4];
-                $store_area = $result[$i][5];
-                $store_address = $result[$i][6];
-                $store_phone = $result[$i][7];
-                $store_type = intval($result[$i][8]);
-
-                if(!$this->ckeckStoreName($store_name))
-                {
-                    showMessage("店铺名称 {$member_name} 已存在", '', 'html', 'error');
-                    return;
-                }
-                if(!$this->checkMemberName($member_name))
-                {
-                    showMessage("店主账号 {$member_name} 已存在", '', 'html', 'error');
-                    return;
-                }
-                if(!$this->checkSellerName($seller_name))
-                {
-                    showMessage("卖家账号 {$member_name} 已存在", '', 'html', 'error');
-                    return;
-                }
-                //批量导入数据的所在省份/城市校验
-                $pattern = '/(\S+)[\s]*(\S+)*/u';
-                $result = preg_match_all($pattern, $store_area, $matches);
-                if(!$result) {
-                    showMessage("{$store_company_name}所在省份/城市无法识别!",'','html','error');
-                    exit;
-                }
-                if(count($matches) !== 3) {
-                    showMessage("{$store_company_name}所在省份/城市识别错误!",'','html','error');
-                    exit;
-                }
-
-                if(empty($match[2][0])) {
-                    $city_name = $matches[1][0];
-                }
-                else {
-                    $city_name = $matches[2][0];
-                }
-
-                if($city_name == '北京' || $city_name == '上海' || $city_name == '天津' || $city_name == '重庆') {
-                    $city_name = $city_name. "市";
-                }
-
-                $mod_area = Model('area');
-                $info = $mod_area->getAreaInfo(['area_name' => $city_name]);
-                if(empty($info)) {
-                    showMessage("{$store_company_name}所在省份/城市无法识别!",'','html','error');
-                    exit;
-                }
-                $city_id        = intval($info['area_id']);
-                $province_id    = intval($info['area_parent_id']);
-
-                try
-                {
-                    $memberId = model('member')->addMember(array(
-                        'member_name' => $member_name,
-                        'member_passwd' => $password,
-                        'member_email' => '',
-                    ));
-                }
-                catch (Exception $ex)
-                {
-                    showMessage("店主账号{$member_name}新增失败", '', 'html', 'error');
-                    return;
-                }
-
-                $storeModel = model('store');
-                $saveArray = array();
-                $saveArray['store_name'] = $store_name;
-                $saveArray['grade_id'] = 1;
-                $saveArray['member_id'] = $memberId;
-                $saveArray['member_name'] = $member_name;
-                $saveArray['seller_name'] = $seller_name;
-                $saveArray['bind_all_gc'] = 1;
-                $saveArray['store_state'] = 1;
-                $saveArray['store_time']    = time();
-                $saveArray['store_company_name'] = $store_company_name;
-                $saveArray['province_id']   = $province_id;
-                $saveArray['city_id']       = $city_id;
-                $saveArray['area_info']     = $store_area;
-                $saveArray['store_address'] = $store_address;
-                $saveArray['store_type']    = $store_type;
-
-                $storeId = $storeModel->addStore($saveArray);
-                QueueClient::push('UpdateSotreLocation',['store_id' => $storeId]);
-
-                model('seller')->addSeller(array(
-                    'seller_name' => $seller_name,
-                    'member_id' => $memberId,
-                    'store_id' => $storeId,
-                    'seller_group_id' => 0,
-                    'is_admin' => 1,
-                ));
-
-                $store_joinModel = model('store_joinin');
-                $save_joinArray = array();
-                $save_joinArray['member_id']    = $memberId;
-                $save_joinArray['member_name']  = $member_name;
-                $save_joinArray['seller_name']  = $seller_name;
-                $save_joinArray['store_name']   = $store_name;
-                $save_joinArray['company_name'] = $store_company_name;
-                $save_joinArray['company_address']          = $store_address;
-                $save_joinArray['company_address_detail']   = $store_address;
-                $save_joinArray['company_phone']= $store_phone;
-                $save_joinArray['store_type']   = $store_type;
-
-                $save_joinArray['joinin_state'] = 40;
-                $save_joinArray['company_name'] = $store_company_name;
-                $save_joinArray['company_province_id']  = $province_id;
-                $save_joinArray['company_city_id']      = $city_id;
-
-                $store_joinModel->save($save_joinArray);
-
-                // 添加相册默认
-                $album_model = Model('album');
-                $album_arr = array();
-                $album_arr['aclass_name'] = '默认相册';
-                $album_arr['store_id'] = $storeId;
-                $album_arr['aclass_des'] = '';
-                $album_arr['aclass_sort'] = '255';
-                $album_arr['aclass_cover'] = '';
-                $album_arr['upload_time'] = time();
-                $album_arr['is_default'] = '1';
-                $album_model->addClass($album_arr);
-                //插入店铺扩展表
-                $model = Model();
-                $model->table('store_extend')->insert(array('store_id'=>$storeId));
-
-                $scounter++;
-            }
-            @fclose($handle); //关闭指针
-
-            showMessage('操作成功,成功导入 '.strval($scounter).' 条数据' , urlAdmin('store', 'store'));
-            return;
-        }
-    }
     
-    public function store_import_csvOp()
-    {
+    public function store_import_csvOp(){
     	if (isset($_POST['import'])) {
     		$file = $_FILES['csv_stores'];
     		$file_type = substr(strstr($file['name'], '.'), 1);
@@ -1192,7 +994,7 @@ class storeControl extends SystemControl{
     		}
 
     		$handle = fopen($file['tmp_name'], "r");
-		    $result = $this->input_csv($handle); //解析csv
+		    $result = $this->input_csv($handle); //解析csv 
 		    $rows = count($result); 
 		    if($rows == 0){ 
     			showMessage('没有任何数据!','','html','error');
@@ -1291,9 +1093,8 @@ class storeControl extends SystemControl{
     			$saveArray['store_phone'] = $store_phone;
     			
     			$storeId = $storeModel->addStore($saveArray);
-                QueueClient::push('UpdateSotreLocation',['store_id' => $storeId]);
 
-                model('seller')->addSeller(array(
+	            model('seller')->addSeller(array(
 	                'seller_name' => $seller_name,
 	                'member_id' => $memberId,
 	                'store_id' => $storeId,
@@ -1416,30 +1217,4 @@ class storeControl extends SystemControl{
     	}
     	return $out;
     }
-
-    /**
-     * 汽车类商家批量导入解析csv
-     */
-    private function read_csv($handle, $encoding, $delimeter=";")
-    {
-        $out = [];
-        $n = 0;
-        while ($line = @fgets($handle))
-        {
-            if($n == 0) {
-                $n++;
-                continue;
-            }else{
-                $out[] = explode($delimeter, iconv($encoding,'utf-8',trim($line)));
-                $n++;
-            }
-        }
-        return $out;
-    }
-
-    private function get_str_encoding($str)
-    {
-        $encoding = mb_detect_encoding($str, ['GB2312','GBK','UTF-16','UCS-2','UTF-8','BIG5','ASCII']);
-        return $encoding;
-    }
 }

+ 0 - 2
admin/include/menu.php

@@ -84,8 +84,6 @@ $arr = array(
 					array('args'=>'type,type,goods',						'text'=>$lang['nc_type_manage']),
 					array('args'=>'spec,spec,goods',						'text'=>$lang['nc_spec_manage']),
 					array('args'=>'list,goods_album,goods',					'text'=>$lang['nc_album_manage']),
-                    array('args'=>'index,goods_plus,goods',					'text'=>'附加条款'),
-                    array('args'=>'index,car_import,goods',					'text'=>'车型导入'),
 				)
 			),
 			3 => array(

+ 0 - 7
admin/templates/default/cache.clear.php

@@ -184,13 +184,6 @@
                                             &nbsp;<?php echo $lang['cache_cls_bargaingoods'] ?>
                                         </label>
                                     </li>
-                                    <li class="left w18pre">
-                                        <label>
-                                            <input type="checkbox" name="cache[]" id="car_data"
-                                                   value="car_data">
-                                            &nbsp;汽车数据
-                                        </label>
-                                    </li>
                                 </ul>
                             </td>
                         </tr>

+ 0 - 32
admin/templates/default/car_import.index.php

@@ -1,32 +0,0 @@
-<?php defined('InShopNC') or exit('Access Invalid!');?>
-<div class="page">
-    <div class="fixed-bar">
-        <div class="item-title">
-            <h3>从CSV导入</h3>
-        </div>
-    </div>
-    <div class="fixed-empty"></div>
-    <div>
-        <div>提醒:请仔细阅读以下各注意事项:</div>
-        <div>
-            <ul>
-                <li>非抓取的数据不要导入,以免污染车型数据库</li>
-            </ul>
-        </div>
-    </div>
-
-    <table class="table tb-type2">
-        <thead>
-        <tr class="thead">
-            <th>
-                <form method="post" action="index.php?act=car_import&op=index" enctype="multipart/form-data" id="stores_form">
-                    <label for="文件选择">请选择要导入的csv文件:</label><input name="csv_cars" type="file" />
-                    <label>分隔符:</label><input name="delimiter" size="70" type="text" placeholder="mac系统导出的csv以';'分割字段,windows系统导出的csv以','分割字段">
-                    <input type="submit" value="导入csv" name="import" />
-                </form>
-            </th>
-        </tr>
-        </thead>
-    </table>
-
-</div>

+ 0 - 102
admin/templates/default/goods_plus.add.php

@@ -1,102 +0,0 @@
-<?php defined('InShopNC') or exit('Access Invalid!');?>
-
-<div class="page">
-    <div class="fixed-bar">
-        <div class="item-title">
-            <h3><?php echo $lang['nc_spec_manage'];?></h3>
-            <ul class="tab-base">
-                <li><a href="index.php?act=goods_plus&op=index"><span><?php echo $lang['nc_manage'];?></span></a></li>
-                <li><a class="current" href="JavaScript:void(0);"><span>添加条款</span></a></li>
-            </ul>
-        </div>
-    </div>
-    <div class="fixed-empty"></div>
-    <form id="goods_plus_form" method="post" enctype="multipart/form-data">
-        <input type="hidden" value="ok" name="form_submit" />
-        <table class="table tb-type2">
-            <tbody>
-            <tr class="noborder">
-                <td class="required" colspan="2">
-                    <label class="validation" for="gp_name"><?php echo '条款内容'.$lang['nc_colon'];?></label>
-                </td>
-            </tr>
-            <tr class="noborder">
-                <td class="vatop rowform"><input type="text" class="txt" name="gp_name" id="gp_name" /></td>
-                <td class="vatop tips">请填写购车附加条款的内容,如:是否店内上牌、是否需要本地户口等</td>
-            </tr>
-
-            <tr>
-                <td class="vatop rowform required" colspan="2">
-                    <label class="validation" for="gp_type">条款类型</label>
-                </td>
-            </tr>
-            <tr class="noborder">
-                <td>
-                    <select class="class-select" name="gp_type" id="gp_type">
-                        <option value="1">1</option>
-                        <option value="2">2</option>
-                    </select>
-                </td>
-                <td>条款类型说明</td>
-            </tr>
-            <tr>
-                <td class="required" colspan="2"><label class="validation" for="gp_sort"><?php echo $lang['nc_sort'].$lang['nc_colon'];?></label></td>
-            </tr>
-            <tr class="noborder">
-                <td class="vatop rowform"><input type="text" class="txt" name="gp_sort" id="gp_sort" value="0" /></td>
-                <td class="vatop tips">请填写自然数。条款内容列表将会根据排序进行由小到大排列显示。</td>
-            </tr>
-            </tbody>
-            <tfoot>
-            <tr class="tfoot">
-                <td colspan="15"><a id="submitBtn" class="btn" href="JavaScript:void(0);"> <span><?php echo $lang['nc_submit'];?></span> </a></td>
-            </tr>
-            </tfoot>
-        </table>
-    </form>
-</div>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/common_select.js" charset="utf-8"></script>
-<script type="text/javascript">
-    $(function(){
-        //表单验证
-        $('#spec_form').validate({
-            errorPlacement: function(error, element){
-                error.appendTo(element.parent().parent().prev().find('td:first'));
-            },
-
-            rules : {
-                gp_name: {
-                    required : true,
-                    maxlength: 255,
-                    minlength: 1
-                },
-                gp_type: {
-                    required : true
-                },
-                gp_sort: {
-                    required : true,
-                    digits	 : true
-                }
-            },
-            messages : {
-                gp_name : {
-                    required : '条款内容不能为空',
-                    maxlength: '条款内容不能超过255个字符',
-                    minlength: '条款内容至少要有一个字符'
-                },
-                gp_sort: {
-                    required : '排序不能为空',
-                    digits   : '排序格式必须为数字'
-                }
-            }
-        });
-
-        //按钮先执行验证再提交表单
-        $("#submitBtn").click(function(){
-            if($("#goods_plus_form").valid()){
-                $("#goods_plus_form").submit();
-            }
-        });
-    });
-
-</script>

+ 0 - 126
admin/templates/default/goods_plus.index.php

@@ -1,126 +0,0 @@
-<?php defined('InShopNC') or exit('Access Invalid!');?>
-
-<div class="page">
-  <div class="fixed-bar">
-    <div class="item-title">
-        <h3>附加条款管理</h3>
-        <ul class="tab-base">
-            <li><a class="current" href="JavaScript:void(0);"><span><?php echo $lang['nc_manage'];?></span></a></li>
-            <li><a href="index.php?act=goods_plus&op=add"><span>添加条款</span></a></li>
-        </ul>
-    </div>
-  </div>
-    <div class="fixed-empty"></div>
-    <table id="prompt" class="table tb-type2">
-        <tbody>
-        <tr class="space odd">
-            <th colspan="12" class="nobg"> <div class="title">
-                    <h5><?php echo $lang['nc_prompts'];?></h5>
-                    <span class="arrow"></span> </div>
-            </th>
-        </tr>
-        <tr class="odd">
-            <td><ul>
-                    <li>如何添加附加条款</li>
-                    <li>...</li>
-            </ul></td>
-        </tr>
-        </tbody>
-    </table>
-    <form id="form_goods_plus" method="get">
-        <input type="hidden" name="act" value="goods_plus" />
-        <input type="hidden" name="op" value="delete" />
-        <table class="table tb-type2">
-            <thead>
-            <tr class="thead">
-                <th></th>
-                <th><?php echo $lang['nc_sort'];?></th>
-                <th>附加条款内容</th>
-                <th class="align-center"><?php echo $lang['nc_handle'];?></th>
-            </tr>
-            </thead>
-            <tbody>
-            <?php if ( !empty($output['plus_list']) && is_array($output['plus_list']) ) {?>
-                <?php foreach ($output['plus_list'] as $val) {?>
-                    <tr class="hover edit">
-                        <td class="w48">
-                            <input type="checkbox" name="del_id[]" value="<?php echo $val['gp_id'];?>" class="checkitem" />
-                            <img fieldid="<?php echo $val['gp_id'];?>" status="close" nc_type="flex" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/tv-item.gif">
-
-                        </td>
-                        <td class="w48 sort"><span class="editable" maxvalue="255" title="<?php echo $lang['nc_editable'];?>" datatype="pint" fieldid="<?php echo $val['gp_id'];?>" ajax_branch="sort" fieldname="gp_sort" nc_type="inline_edit"><?php echo $val['gp_sort'];?></span></td>
-                        <td class=""><span class="editable" fieldname="gp_name" nc_type="inline_edit"><?php echo $val['gp_name'];?></span></td>
-                        <td class="w96 align-center">
-                            <a href="javascript:void(0)" onclick="ajax_edit('<?php echo $val['gp_id'];?>')"><?php echo $lang['nc_edit'];?></a> | <a href="javascript:void(0)" onclick="ajax_delete('<?php echo $val['gp_id'];?>')"><?php echo $lang['nc_del'];?></a>
-                        </td>
-                    </tr>
-                <?php }?>
-            <?php }else{ ?>
-                <tr class="no_data">
-                    <td colspan="10"><?php echo $lang['nc_no_record'];?></td>
-                </tr>
-            <?php }?>
-            </tbody>
-            <?php if(!empty($output['plus_list']) && is_array($output['plus_list'])){ ?>
-                <tfoot>
-                <tr>
-                    <td><input type="checkbox" class="checkall" id="checkallBottom" /></td>
-                    <td id="dataFuncs" colspan="16"><label for="checkallBottom"><?php echo $lang['nc_select_all'];?></label>
-                        <a class="btn" onclick="submit_form('del');" href="JavaScript:void(0);"> <span><?php echo $lang['nc_del'];?></span> </a>
-                        <div class="pagination"> <?php echo $output['page'];?> </div></td>
-                <tr>
-                </tfoot>
-            <?php }?>
-        </table>
-    </form>
-</div>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.edit.js" charset="utf-8"></script>
-<script type="text/javascript">
-function ajax_edit($gp_id) {
-    var _url = 'index.php?act=goods_plus&op=ajax_edit&gp_id=' + $gp_id;
-    var parent = $(event.target).parents('tr');
-    var gp_name = parent.find("span[fieldname='gp_name']").text();
-    var gp_sort = parent.find("span[fieldname='gp_sort']").text();
-    $.getJSON(_url, {gp_name: gp_name, gp_sort: gp_sort}, function($data) {
-        if($data.done) {
-            window.location.reload();
-        } else {
-            alert("修改失败");
-            return false;
-        }
-    });
-}
-function ajax_delete($gp_id) {
-    if(confirm("确定要删除该条款内容吗?")) {
-        var _url = 'index.php?act=goods_plus&op=ajax_delete&gp_id=' + $gp_id;
-        $.getJSON(_url, {}, function($data) {
-            if($data.done) {
-                window.location.reload();
-            } else {
-                alert("修改失败");
-                return false;
-            }
-        });
-    } else {
-        return false;
-    }
-}
-function submit_form(type){
-    var id='';
-    $('input[type=checkbox]:checked').each(function(){
-        if(!isNaN($(this).val())){
-            id += $(this).val();
-        }
-    });
-    if(id == ''){
-        alert('请选择一个或多个附加条款');
-        return false;
-    }
-    if(type=='del'){
-        if(!confirm('<?php echo $lang['nc_ensure_del'];?>')){
-            return false;
-        }
-    }
-    $('#form_goods_plus').submit();
-}
-</script>

+ 1 - 0
admin/templates/default/mb_special_item.module_home5.php

@@ -89,6 +89,7 @@
                         <a nctype="btn_edit_item_image" href="javascript:;" class="a2"><i class="icon-edit"></i>编辑</a>
                     <?php } ?>
                 </div>
+                <br>
             <?php } ?>
         <?php } ?>
     </div>

+ 0 - 100
admin/templates/default/sp_value.add.php

@@ -1,100 +0,0 @@
-<?php defined('InShopNC') or exit('Access Invalid!');?>
-
-<div class="page">
-    <div class="fixed-bar">
-        <div class="item-title">
-            <h3><?php echo $lang['nc_spec_manage'];?></h3>
-            <ul class="tab-base">
-                <li><a href="index.php?act=spec&op=spec"><span><?php echo $lang['nc_manage'];?></span></a></li>
-                <li><a href="index.php?act=spec&op=spec_add"><span><?php echo $lang['nc_new'];?></span></a></li>
-                <li><a class="current" href="index.php?act=spec&op=spec_value_add"><span>添加规格值</span></a></li>
-            </ul>
-        </div>
-    </div>
-    <div class="fixed-empty"></div>
-    <form id="spec_form" method="post" enctype="multipart/form-data">
-        <input type="hidden" value="ok" name="form_submit" />
-        <table class="table tb-type2">
-            <tbody>
-            <tr class="noborder">
-                <td class="required" colspan="2"><label class="validation" for="s_name">规格值</label></td>
-            </tr>
-            <tr class="noborder">
-                <td class="vatop rowform"><input type="text" class="txt" name="sp_value" id="s_name" /></td>
-                <td class="vatop tips">输入分期数,填写12的整数倍</td>
-            </tr>
-            <tr>
-                <td class="required" colspan="2"><label class="" for="s_sort">所属规格</label></td>
-            </tr>
-            <tr class="noborder">
-                <td class="vatop rowform" id="gcategory"><input type="hidden" value="" class="mls_id" name="class_id" />
-                    <input type="hidden" value="" class="mls_name" name="class_name" />
-                    <select class="class-select" name="sp_id">
-                        <!--<option value="0"><?php /*echo $lang['nc_please_choose'];*/?>...</option>-->
-                        <?php if(!empty($output['sp_list'])){ ?>
-                            <?php foreach($output['sp_list'] as $k => $v){ ?>
-                                    <option value="<?php echo $v['sp_id'];?>"><?php echo $v['sp_name'];?></option>
-                            <?php } ?>
-                        <?php } ?>
-                    </select></td>
-                <td class="vatop tips">只能为分期数添加全平台通用规格值</td>
-            </tr>
-            <tr>
-                <td class="required" colspan="2"><label class="validation" for="s_sort"><?php echo $lang['nc_sort'].$lang['nc_colon'];?></label></td>
-            </tr>
-            <tr class="noborder">
-                <td class="vatop rowform"><input type="text" class="txt" name="s_sort" id="s_sort" value="0" /></td>
-                <td class="vatop tips"><?php echo $lang['spec_index_spec_sort_desc'];?></td>
-            </tr>
-            </tbody>
-            <tfoot>
-            <tr class="tfoot">
-                <td colspan="15"><a id="submitBtn" class="btn" href="JavaScript:void(0);"> <span><?php echo $lang['nc_submit'];?></span> </a></td>
-            </tr>
-            </tfoot>
-        </table>
-    </form>
-</div>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/common_select.js" charset="utf-8"></script>
-<script type="text/javascript">
-    $(function(){
-        //表单验证
-        $('#spec_form').validate({
-            errorPlacement: function(error, element){
-                error.appendTo(element.parent().parent().prev().find('td:first'));
-            },
-
-            rules : {
-                s_name: {
-                    required : true,
-                    maxlength: 10,
-                    minlength: 1
-                },
-                s_sort: {
-                    required : true,
-                    digits	 : true
-                }
-            },
-            messages : {
-                s_name : {
-                    required : '<?php echo $lang['spec_add_name_no_null'];?>',
-                    maxlength: '<?php echo $lang['spec_add_name_max'];?>',
-                    minlength: '<?php echo $lang['spec_add_name_max'];?>'
-                },
-                s_sort: {
-                    required : '<?php echo $lang['spec_add_sort_no_null'];?>',
-                    digits   : '<?php echo $lang['spec_add_sort_no_digits'];?>'
-                }
-            }
-        });
-
-        //按钮先执行验证再提交表单
-        $("#submitBtn").click(function(){
-            if($("#spec_form").valid()){
-                $("#spec_form").submit();
-            }
-        });
-    });
-
-    gcategoryInit('gcategory');
-</script>

+ 0 - 18
admin/templates/default/spec.add.php

@@ -7,7 +7,6 @@
       <ul class="tab-base">
         <li><a href="index.php?act=spec&op=spec"><span><?php echo $lang['nc_manage'];?></span></a></li>
         <li><a class="current" href="JavaScript:void(0);"><span><?php echo $lang['nc_new'];?></span></a></li>
-        <li><a href="index.php?act=spec&op=spec_value_add"><span>添加规格值</span></a></li>
       </ul>
     </div>
   </div>
@@ -42,20 +41,6 @@
           <td class="vatop tips"><?php echo $lang['spec_common_belong_class_tips'];?></td>
         </tr>
         <tr>
-            <td class="vatop rowform required" colspan="2">
-                <label class="validation" for="sp_type">规格类型</label>
-            </td>
-        </tr>
-        <tr class="noborder">
-            <td>
-                <select class="class-select" name="sp_type" id="sp_type">
-                    <option value="1">店铺自定义规格</option>
-                    <option value="2">平台通用规格</option>
-                </select>
-            </td>
-            <td>店铺自定义规格由店铺自行发布规格值,平台通用规格只能由平台发布规格值</td>
-        </tr>
-        <tr>
           <td class="required" colspan="2"><label class="validation" for="s_sort"><?php echo $lang['nc_sort'].$lang['nc_colon'];?></label></td>
         </tr>
         <tr class="noborder">
@@ -86,9 +71,6 @@ $(function(){
                 maxlength: 10,
                 minlength: 1
             },
-            sp_type: {
-                required : true
-            },
             s_sort: {
 				required : true,
 				digits	 : true

+ 0 - 1
admin/templates/default/spec.edit.php

@@ -8,7 +8,6 @@
         <li><a href="index.php?act=spec&op=spec"><span><?php echo $lang['nc_manage'];?></span></a></li>
         <li><a href="index.php?act=spec&op=spec_add"><span><?php echo $lang['nc_new'];?></span></a></li>
         <li><a class="current" href="JavaScript:void(0);"><span><?php echo $lang['nc_edit'];?></span></a></li>
-        <li><a href="index.php?act=spec&op=spec_value_add"><span>添加规格值</span></a></li>
       </ul>
     </div>
   </div>

+ 8 - 15
admin/templates/default/spec.index.php

@@ -7,7 +7,6 @@
       <ul class="tab-base">
         <li><a class="current" href="JavaScript:void(0);"><span><?php echo $lang['nc_manage'];?></span></a></li>
         <li><a href="index.php?act=spec&op=spec_add"><span><?php echo $lang['nc_new'];?></span></a></li>
-        <li><a href="index.php?act=spec&op=spec_value_add"><span>添加规格值</span></a></li>
       </ul>
     </div>
   </div>
@@ -45,18 +44,13 @@
       <tbody>
         <?php if ( !empty($output['spec_list']) && is_array($output['spec_list']) ) {?>
         <?php foreach ($output['spec_list'] as $val) {?>
-            <tr class="hover edit">
-              <td class="w48"><input type="checkbox" name="del_id[]" value="<?php echo $val['sp_id'];?>" <?php if($val['sp_id'] == '1'){?>disabled="disabled"<?php }else{?>class="checkitem"<?php }?> />
-              <?php if($val['sp_type'] == '2'){ ?>
-                  <img fieldid="<?php echo $val['sp_id'];?>" status="open" nc_type="flex" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/tv-expandable.gif">
-              <?php }else{ ?>
-                  <img fieldid="<?php echo $val['sp_id'];?>" status="close" nc_type="flex" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/tv-item.gif">
-              <?php } ?></td>
-              <td class="w48 sort"><span class=" <?php if($val['sp_id'] != '1'){?>editable<?php }?>" maxvalue="255" <?php if($val['sp_id'] != '1'){?> title="<?php echo $lang['nc_editable'];?>" datatype="pint" fieldid="<?php echo $val['sp_id'];?>" ajax_branch="sort" fieldname="sp_sort" nc_type="inline_edit"<?php }?>><?php echo $val['sp_sort'];?></span></td>
-              <td class=""><span><?php echo $val['sp_name'];?></span></td>
-              <td class="w150 name"><?php echo $val['class_name'];?></td>
-              <td class="w96 align-center"><a href="index.php?act=spec&op=spec_edit&sp_id=<?php echo $val['sp_id'];?>"><?php echo $lang['nc_edit'];?></a> <?php if($val['sp_id'] != '1'){?>| <a onclick="if(confirm('<?php echo $lang['nc_ensure_del'];?>')){location.href='index.php?act=spec&op=spec_del&del_id=<?php echo $val['sp_id'];?>';}else{return false;}" href="javascript:void(0)"><?php echo $lang['nc_del'];?></a><?php }?> </td>
-            </tr>
+        <tr class="hover edit">
+          <td class="w24"><input type="checkbox" name="del_id[]" value="<?php echo $val['sp_id'];?>" <?php if($val['sp_id'] == '1'){?>disabled="disabled"<?php }else{?>class="checkitem"<?php }?> /></td>
+          <td class="w48 sort"><span class=" <?php if($val['sp_id'] != '1'){?>editable<?php }?>" maxvalue="255" <?php if($val['sp_id'] != '1'){?> title="<?php echo $lang['nc_editable'];?>" datatype="pint" fieldid="<?php echo $val['sp_id'];?>" ajax_branch="sort" fieldname="sp_sort" nc_type="inline_edit"<?php }?>><?php echo $val['sp_sort'];?></span></td>
+          <td class=""><span><?php echo $val['sp_name'];?></span></td>
+          <td class="w150 name"><?php echo $val['class_name'];?></td>
+          <td class="w96 align-center"><a href="index.php?act=spec&op=spec_edit&sp_id=<?php echo $val['sp_id'];?>"><?php echo $lang['nc_edit'];?></a> <?php if($val['sp_id'] != '1'){?>| <a onclick="if(confirm('<?php echo $lang['nc_ensure_del'];?>')){location.href='index.php?act=spec&op=spec_del&del_id=<?php echo $val['sp_id'];?>';}else{return false;}" href="javascript:void(0)"><?php echo $lang['nc_del'];?></a><?php }?> </td>
+        </tr>
         <?php }?>
         <?php }else{ ?>
         <tr class="no_data">
@@ -77,8 +71,7 @@
     </table>
   </form>
 </div>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.edit.js" charset="utf-8"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.spec.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.edit.js" charset="utf-8"></script> 
 <script type="text/javascript">
 function submit_form(type){
 	var id='';

+ 0 - 21
admin/templates/default/store.edit.php

@@ -51,20 +51,6 @@
           <td class="vatop tips"></td>
         </tr>
         <tr>
-            <td colspan="2">
-                商家类型:
-            </td>
-        </tr>
-        <tr class="noborder">
-            <td class="vatop rowform">
-                <select name="store_type" id="store_type">
-                    <option value="0">其他</option>
-                    <option value="1">门店</option>
-                    <option value="2">融资公司</option>
-                </select>
-            </td>
-        </tr>
-        <tr>
           <td colspan="2" class="required"><label><?php echo $lang['belongs_class'];?>:</label></td>
         </tr>
         <tr class="noborder">
@@ -449,10 +435,6 @@ $(function(){
     });
 
     $("#btn_fail").click(function(){
-        if($("input[name='company_address']").siblings('select').length > 0) {
-            $("input[name='company_address']").siblings('select').eq(0)&&$("input[name='company_address']").siblings('select').eq(0).attr('name','province_id');
-            $("input[name='company_address']").siblings('select').eq(1)&&$("input[name='company_address']").siblings('select').eq(1).attr('name','city_id');
-        }
         $("#joinin_form").submit();
     });
 
@@ -482,8 +464,5 @@ $(function(){
         _form.hide();
         _form.eq(_index).show();
     });
-
-    var $store_type_val = <?php echo $output['store_array']['store_type']; ?>;
-    $("#store_type").val($store_type_val);
 });
 </script>

+ 0 - 9
admin/templates/default/store.index.php

@@ -71,7 +71,6 @@
           <th><?php echo $lang['store_name'];?></th>
           <th><?php echo $lang['store_user_name'];?></th>
           <th>店主卖家账号</th>
-          <th>商家类型</th>
           <th class="align-center"><?php echo $lang['belongs_level'];?></th>
           <th class="align-center"><?php echo $lang['period_to'];?></th>
           <th class="align-center"><?php echo $lang['state'];?></th>
@@ -89,14 +88,6 @@
           </td>
           <td><?php echo $v['member_name'];?></td>
           <td><?php echo $v['seller_name'];?></td>
-          <td><?php if(intval($v['store_type']) == 1) {
-                echo "门店";
-              } elseif (intval($v['store_type']) == 2) {
-                echo "融资公司";
-              } else {
-                echo "其他";
-              }
-          ?></td>
           <td class="align-center"><?php echo $output['search_grade_list'][$v['grade_id']];?></td>
           <td class="nowarp align-center"><?php echo $v['store_end_time']?date('Y-m-d', $v['store_end_time']):$lang['no_limit'];?></td>
           <td class="align-center w72"><?php echo $v['store_state']?$lang['open']:$lang['close'];?></td>

+ 2 - 4
admin/templates/default/store_import.php

@@ -12,8 +12,7 @@
       <th>下载csv模板:</th>
       <td>
 	      <ul>
-	      	<li><a href="<?php echo RESOURCE_SITE_URL ?>/store_import_win.csv">批量导入商家模板下载(windows版本)</a></li>
-            <li><a href="<?php echo RESOURCE_SITE_URL ?>/store_import_mac.csv">批量导入商家模板下载(MacOs版本)</a></li>
+	      	<li><a href="<?php echo RESOURCE_SITE_URL ?>/store_import.csv">批量导入商家模板下载</a></li>
 	      </ul>
       </td>
     </tr>
@@ -43,9 +42,8 @@
       <thead>
         <tr class="thead">
           <th>
-  			<form method="post" action="index.php?act=store&op=store_import_csv_x" enctype="multipart/form-data" id="stores_form">
+  			<form method="post" action="index.php?act=store&op=store_import_csv" enctype="multipart/form-data" id="stores_form">
      		<label for="文件选择">请选择要导入的csv文件:</label><input name="csv_stores" type="file" />
-                <label>分隔符:</label><input name="delimiter" size="70" type="text" placeholder="mac系统导出的csv以';'分割字段,windows系统导出的csv以','分割字段">
     		<input type="submit" value="导入csv" name="import" />
   			</form>  
   		  </th>

+ 0 - 11
admin/templates/default/store_joinin.detail.php

@@ -256,17 +256,6 @@
           <td><?php echo $output['joinin_detail']['store_name'];?></td>
         </tr>
         <tr>
-            <th class="w150">商家类型:</th>
-            <td><?php if(intval($output['joinin_detail']['store_type']) == 1) {
-                    echo "门店";
-                } elseif (intval($output['joinin_detail']['store_type']) == 2) {
-                    echo "融资公司";
-                } else {
-                    echo "其他";
-                }
-                ?></td>
-        </tr>
-        <tr>
           <th>店铺等级:</th>
           <td><?php echo $output['joinin_detail']['sg_name'];?>(开店费用:<?php echo $output['joinin_detail']['sg_price'];?> 元/年)</td>
         </tr>

+ 0 - 9
admin/templates/default/store_joinin.php

@@ -71,7 +71,6 @@
         <tr class="thead">
           <th><?php echo $lang['store_name'];?></th>
           <th><?php echo $lang['store_user_name'];?></th>
-          <th>商家类型</th>
           <th><?php echo $lang['location'];?></th>
           <th class="align-center"><?php echo $lang['belongs_level'];?></th>
           <th class="align-center"><?php echo $lang['state'];?></th>
@@ -84,14 +83,6 @@
         <tr class="hover edit">
           <td><?php echo $v['store_name'];?></td>
           <td><?php echo $v['member_name'];?></td>
-          <td><?php if(intval($v['store_type']) == 1) {
-                    echo "门店";
-                } elseif (intval($v['store_type']) == 2) {
-                    echo "融资公司";
-                } else {
-                    echo "其他";
-                }
-          ?></td>
           <td class="w150"><?php echo $v['company_address'];?></td>
           <td class="align-center"><?php echo $v['sg_name'];?></td>
           <td class="align-center"><?php echo $output['joinin_state_array'][$v['joinin_state']];?></td>

+ 1 - 1
admin/templates/default/web_brand.list.php

@@ -4,7 +4,7 @@
 <ul class="brands dialog-brandslist-s2">
   <?php foreach($output['brand_list'] as $k => $v){ ?>
   <li>
-    <div class="brands-pic" onclick="select_brand(<?php echo $v['brand_id'];?>);"><span class="ac-ico"></span><span class="thumb size-88x29"><i></i><img brand_id="<?php echo $v['brand_id'];?>" title="<?php echo $v['brand_name'];?>" src="<?php if(!empty($v['brand_logo'])){ echo UPLOAD_SITE_URL.$v['brand_logo'];}else{ echo ADMIN_SITE_URL.'/templates/'.TPL_NAME.'/images/default_brand_image.gif';}?>" onload="javascript:DrawImage(this,88,30);" /></span></div>
+    <div class="brands-pic" onclick="select_brand(<?php echo $v['brand_id'];?>);"><span class="ac-ico"></span><span class="thumb size-88x29"><i></i><img brand_id="<?php echo $v['brand_id'];?>" title="<?php echo $v['brand_name'];?>" src="<?php if(!empty($v['brand_pic'])){ echo UPLOAD_SITE_URL.'/'.ATTACH_BRAND.'/'.$v['brand_pic'];}else{ echo ADMIN_SITE_URL.'/templates/'.TPL_NAME.'/images/default_brand_image.gif';}?>" onload="javascript:DrawImage(this,88,30);" /></span></div>
     <div class="brands-name"><?php echo $v['brand_name'];?></div>
   </li>
   <?php } ?>

+ 1 - 1
admin/templates/default/web_code.edit.php

@@ -180,7 +180,7 @@ var UPLOAD_SITE_URL = "<?php echo UPLOAD_SITE_URL; ?>";
                   <ul class="brands">
                     <?php if (is_array($output['code_brand_list']['code_info']) && !empty($output['code_brand_list']['code_info'])) { ?>
                     <?php foreach ($output['code_brand_list']['code_info'] as $key => $val) { ?>
-                    <li><span><img title="<?php echo $val['brand_name'];?>" src="<?php echo UPLOAD_SITE_URL.'/'.$val['brand_logo'];?>"/> </span></li>
+                    <li><span><img title="<?php echo $val['brand_name'];?>" src="<?php echo UPLOAD_SITE_URL.'/'.$val['brand_pic'];?>"/> </span></li>
                     <?php } ?>
                     <?php }else { ?>
                     <li>

+ 0 - 129
car/testSubmit.html

@@ -1,129 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>Mobile提交申请</title>
-    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
-    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
-</head>
-<body>
-<div class="container">
-    <form class="form-horizontal" role="form" method="post" action="/mobile/index.php?act=store_joinin&op=submit">
-        <input name="member_id" value="39679" type="hidden">
-        <div class="text-center">
-            基本资料(必填)
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">公司名称</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="company_name" type="text" placeholder="请输入公司名称...">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">法人姓名</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="representative" type="text" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">门店座机</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="company_phone" type="text" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">负责人</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="contacts_name" type="text" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">联系电话</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="contacts_phone" type="text" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">选择地区</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="province_id" type="text" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">详细地址</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="company_address_detail" type="text" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">员工数量</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="company_employee_count" type="text" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">主营业务</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="business_sphere" type="text" placeholder="">
-            </div>
-        </div>
-        <div class="text-center">
-            开户银行资料(必填)
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">开户行</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="bank_name" type="text" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">开户行地址</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="bank_address" type="text" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">开户行账号</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="bank_account_number" type="text" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">三证合一图片</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="business_licence_number_electronic" type="file" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">法人身份证</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="representative_id_card" type="file" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">银行开户许可</label>
-            <div class="col-sm-10">
-                <input class="form-control input-sm" name="bank_licence_electronic" type="file" placeholder="">
-            </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-2 control-label">展厅照片</label>
-            <div class="col-sm-10">
-                <div>
-                    <input class="form-control input-sm" name="exhibition_photos" type="file" placeholder="">
-                </div>
-                <div>
-                    <input class="form-control input-sm" name="exhibition_photos" type="file" placeholder="">
-                </div>
-                <div>
-                    <input class="form-control input-sm" name="exhibition_photos" type="file" placeholder="">
-                </div>
-            </div>
-        </div>
-        <div class="form-group text-center">
-            <button type="submit" class="btn btn-default">提交</button>
-        </div>
-    </form>
-</div>
-</body>
-</html>

+ 37 - 0
core/framework/function/core.php

@@ -730,6 +730,23 @@ function delCacheFile($dir){
 	return true;
 }
 
+function del_share_images()
+{
+    $share_image_cache_path = BASE_UPLOAD_PATH . DS . 'shareimages' . DS;
+
+    if (is_dir($share_image_cache_path)) {
+        $files = scandir($share_image_cache_path);
+
+        foreach ($files as $file)
+        {
+            if (in_array($file, array('.','..'))) {
+                continue;
+            }
+            @unlink($share_image_cache_path. $file);
+        }
+    }
+}
+
 /**
  * 获取文件列表(所有子目录文件)
  *
@@ -2521,3 +2538,23 @@ function encryptShow($str,$start,$length) {
 function callback($state = true, $msg = '', $data = array()) {
     return array('state' => $state, 'msg' => $msg, 'data' => $data);
 }
+
+/**
+ * Input file content and return which image type is
+ * @param $content
+ * @return string: 'jpg', 'png', 'gif', 'bmp', 'unknown'
+ */
+function getImageType($content)
+{
+    $data = unpack('C2chars', $content);
+    $type_code = intval($data['chars1'].$data['chars2']);
+    switch ($type_code)
+    {
+        case 255216:    $filetype = 'jpg';break;
+        case 7173:      $filetype = 'gif';break;
+        case 6677:      $filetype = 'bmp';break;
+        case 13780:     $filetype = 'png';break;
+        default:        $filetype = 'unknown';
+    }
+    return $filetype;
+}

+ 58 - 1
core/framework/function/http.php

@@ -12,7 +12,7 @@ defined('InShopNC') or exit('Access Invalid!');
 function http_request($url, $params = array(), $method = 'GET', $multi = false, $extheaders = array()) 
 {
     if (!function_exists('curl_init')) {  
-        return NULL;
+        return false;
     }
 
     $method = strtoupper($method);
@@ -98,3 +98,60 @@ function http_post_data($url, $body, $headers = array())
 
     return $response;
 }
+
+function https_request($url, $params = array(), $method = 'GET', $multi = false, $extheaders = array())
+{
+    if (!function_exists('curl_init')) {
+        return false;
+    }
+
+    $method = strtoupper($method);
+    $ci = curl_init();
+    curl_setopt($ci, CURLOPT_USERAGENT, 'PHP-SDK OAuth2.0');
+    curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 3);
+    curl_setopt($ci, CURLOPT_TIMEOUT, 3);
+    curl_setopt($ci, CURLOPT_RETURNTRANSFER, true);
+    curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, false);
+    curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 2);
+    curl_setopt($ci, CURLOPT_HEADER, false);
+    $headers = (array) $extheaders;
+    switch ($method)
+    {
+        case 'POST':
+            curl_setopt($ci, CURLOPT_POST, TRUE);
+            if (!empty($params))
+            {
+                if ($multi)
+                {
+                    foreach ($multi as $key => $file) {
+                        $params[$key] = '@' . $file;
+                    }
+                    curl_setopt($ci, CURLOPT_POSTFIELDS, $params);
+                    $headers[] = 'Expect: ';
+                }
+                else {
+                    curl_setopt($ci, CURLOPT_POSTFIELDS, http_build_query($params));
+                }
+            }
+            break;
+        case 'DELETE':
+        case 'GET':
+            if($method == 'DELETE') {
+                curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');
+            }
+            if (!empty($params)) {
+                $url = $url . (strpos($url, '?') ? '&' : '?') . (is_array($params) ? http_build_query($params) : $params);
+            }
+            break;
+    }
+    curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE);
+    curl_setopt($ci, CURLOPT_URL, $url);
+    if ($headers) {
+        curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);
+    }
+
+    $response = curl_exec($ci);
+    curl_close($ci);
+
+    return $response;
+}

+ 300 - 0
core/framework/libraries/geohash.php

@@ -0,0 +1,300 @@
+<?php
+/**
+ * Geohash generation class for php 
+ *
+ * This file copyright (C) 2013 Bruce Chen (http://weibo.com/smcz)
+ *
+ * Author: Bruce Chen (weibo: @一个开发者)
+ *
+ */
+
+
+/**
+ *
+ * Encode and decode geohashes
+ *
+ * Find neighbors
+ *
+ */
+
+class geohash {
+
+	private $bitss = array(16, 8, 4, 2, 1);
+	private $neighbors = array();
+	private $borders = array();
+	
+	private $coding = "0123456789bcdefghjkmnpqrstuvwxyz";
+	private $codingMap = array();
+
+	public function geohash()
+    {
+		$this->neighbors['right']['even'] = 'bc01fg45238967deuvhjyznpkmstqrwx';
+		$this->neighbors['left']['even'] = '238967debc01fg45kmstqrwxuvhjyznp';
+		$this->neighbors['top']['even'] = 'p0r21436x8zb9dcf5h7kjnmqesgutwvy';
+		$this->neighbors['bottom']['even'] = '14365h7k9dcfesgujnmqp0r2twvyx8zb';
+		
+		$this->borders['right']['even'] = 'bcfguvyz';
+		$this->borders['left']['even'] = '0145hjnp';
+		$this->borders['top']['even'] = 'prxz';
+		$this->borders['bottom']['even'] = '028b';
+		
+		$this->neighbors['bottom']['odd'] = $this->neighbors['left']['even'];
+		$this->neighbors['top']['odd'] = $this->neighbors['right']['even'];
+		$this->neighbors['left']['odd'] = $this->neighbors['bottom']['even'];
+		$this->neighbors['right']['odd'] = $this->neighbors['top']['even'];
+		
+		$this->borders['bottom']['odd'] = $this->borders['left']['even'];
+		$this->borders['top']['odd'] = $this->borders['right']['even'];
+		$this->borders['left']['odd'] = $this->borders['bottom']['even'];
+		$this->borders['right']['odd'] = $this->borders['top']['even'];
+		
+		//build map from encoding char to 0 padded bitfield
+		for($i=0; $i<32; $i++) {
+		
+			$this->codingMap[substr($this->coding, $i, 1)] = str_pad(decbin($i), 5, "0", STR_PAD_LEFT);
+		}
+		
+	}
+	
+	/**
+	* Decode a geohash and return an array with decimal lat,long in it
+	* Author: Bruce Chen (weibo: @一个开发者)
+	*/
+	public function decode($hash) {
+	
+		//decode hash into binary string
+		$binary = "";
+		$hl = strlen($hash);
+		for ($i=0; $i<$hl; $i++) {
+		
+			$binary .= $this->codingMap[substr($hash, $i, 1)];
+		}
+		
+		//split the binary into lat and log binary strings
+		$bl = strlen($binary);
+		$blat = "";
+		$blong = "";
+		for ($i=0; $i<$bl; $i++) {
+		
+			if ($i%2)
+				$blat=$blat.substr($binary, $i, 1);
+			else
+				$blong=$blong.substr($binary, $i, 1);
+			
+		}
+		
+		//now concert to decimal
+		$lat = $this->binDecode($blat, -90, 90);
+		$long = $this->binDecode($blong, -180, 180);
+		
+		//figure out how precise the bit count makes this calculation
+		$latErr = $this->calcError(strlen($blat), -90, 90);
+		$longErr = $this->calcError(strlen($blong), -180, 180);
+				
+		//how many decimal places should we use? There's a little art to
+		//this to ensure I get the same roundings as geohash.org
+		$latPlaces = max(1, -round(log10($latErr))) - 1;
+		$longPlaces = max(1, -round(log10($longErr))) - 1;
+		
+		//round it
+		$lat = round($lat, $latPlaces);
+		$long = round($long, $longPlaces);
+
+		return array($lat, $long);
+	}
+
+	
+	private function calculateAdjacent($srcHash, $dir) {
+	
+		$srcHash = strtolower($srcHash);
+		$lastChr = $srcHash[strlen($srcHash) - 1];
+		$type = (strlen($srcHash) % 2) ? 'odd' : 'even';
+		$base = substr($srcHash, 0, strlen($srcHash) - 1);
+		
+		if (strpos($this->borders[$dir][$type], $lastChr) !== false) {
+			
+			$base = $this->calculateAdjacent($base, $dir);	
+		}
+			
+		return $base . $this->coding[strpos($this->neighbors[$dir][$type], $lastChr)];
+	}
+	
+	
+	public function neighbors($srcHash) {
+	
+		$geohashPrefix = substr($srcHash, 0, strlen($srcHash) - 1);
+	 
+	 	$neighbors['top'] = $this->calculateAdjacent($srcHash, 'top');
+	 	$neighbors['bottom'] = $this->calculateAdjacent($srcHash, 'bottom');
+	 	$neighbors['right'] = $this->calculateAdjacent($srcHash, 'right');
+	 	$neighbors['left'] = $this->calculateAdjacent($srcHash, 'left');
+	 	
+	 	$neighbors['topleft'] = $this->calculateAdjacent($neighbors['left'], 'top');
+	 	$neighbors['topright'] = $this->calculateAdjacent($neighbors['right'], 'top');
+	 	$neighbors['bottomright'] = $this->calculateAdjacent($neighbors['right'], 'bottom');
+	 	$neighbors['bottomleft'] = $this->calculateAdjacent($neighbors['left'], 'bottom');
+	 
+		return $neighbors;
+	}
+
+
+	
+	/**
+	* Encode a hash from given lat and long
+	* Author: Bruce Chen (weibo: @一个开发者)
+	*/
+	public function encode($lat, $long) {
+	
+		//how many bits does latitude need?	
+		$plat = $this->precision($lat);
+		$latbits = 1;
+		$err = 45;
+		while($err > $plat) {
+		
+			$latbits++;
+			$err /= 2;
+		}
+		
+		//how many bits does longitude need?
+		$plong = $this->precision($long);
+		$longbits = 1;
+		$err = 90;
+		while($err > $plong) {
+		
+			$longbits++;
+			$err /= 2;
+		}
+		
+		//bit counts need to be equal
+		$bits = max($latbits, $longbits);
+		
+		//as the hash create bits in groups of 5, lets not
+		//waste any bits - lets bulk it up to a multiple of 5
+		//and favour the longitude for any odd bits
+		$longbits = $bits;
+		$latbits = $bits;
+		$addlong = 1;
+		while (($longbits + $latbits) % 5 != 0) {
+		
+			$longbits += $addlong;
+			$latbits += !$addlong;
+			$addlong = !$addlong;
+		}
+		
+		
+		//encode each as binary string
+		$blat = $this->binEncode($lat, -90, 90, $latbits);
+		$blong = $this->binEncode($long, -180, 180, $longbits);
+		
+		//merge lat and long together
+		$binary = "";
+		$uselong = 1;
+		while (strlen($blat) + strlen($blong)) {
+		
+			if ($uselong) {
+			
+				$binary = $binary.substr($blong, 0, 1);
+				$blong = substr($blong, 1);
+			
+			} else {
+			
+				$binary = $binary.substr($blat, 0, 1);
+				$blat = substr($blat, 1);
+			}
+			
+			$uselong = !$uselong;
+		}
+		
+		//convert binary string to hash
+		$hash = "";
+		for ($i=0; $i<strlen($binary); $i+=5) {
+		
+			$n = bindec(substr($binary, $i, 5));
+			$hash = $hash.$this->coding[$n];
+		}
+		
+		return $hash;
+	}
+	
+	/**
+	* What's the maximum error for $bits bits covering a range $min to $max
+	*/
+	private function calcError($bits, $min, $max) {
+	
+		$err = ($max - $min) / 2;
+		while ($bits--)
+			$err /= 2;
+		return $err;
+	}
+	
+	/*
+	* returns precision of number
+	* precision of 42 is 0.5
+	* precision of 42.4 is 0.05
+	* precision of 42.41 is 0.005 etc
+	*
+	* Author: Bruce Chen (weibo: @一个开发者)
+	*/
+	private function precision($number) {
+	
+		$precision = 0;
+		$pt = strpos($number,'.');
+		if ($pt !== false) {
+		
+			$precision = -(strlen($number) - $pt - 1);
+		}
+		
+		return pow(10, $precision) / 2;
+	}
+	
+	
+	/**
+	* create binary encoding of number as detailed in http://en.wikipedia.org/wiki/Geohash#Example
+	* removing the tail recursion is left an exercise for the reader
+	* 
+	* Author: Bruce Chen (weibo: @一个开发者)
+	*/
+	private function binEncode($number, $min, $max, $bitcount) {
+	
+		if ($bitcount == 0)
+			return "";
+		
+		#echo "$bitcount: $min $max<br>";
+			
+		//this is our mid point - we will produce a bit to say
+		//whether $number is above or below this mid point
+		$mid = ($min + $max) / 2;
+		if ($number > $mid)
+			return "1" . $this->binEncode($number, $mid, $max, $bitcount - 1);
+		else
+			return "0" . $this->binEncode($number, $min, $mid, $bitcount - 1);
+	}
+	
+
+	/**
+	* decodes binary encoding of number as detailed in http://en.wikipedia.org/wiki/Geohash#Example
+	* removing the tail recursion is left an exercise for the reader
+	* 
+	* Author: Bruce Chen (weibo: @一个开发者)
+	*/
+	private function binDecode($binary, $min, $max) {
+	
+		$mid = ($min + $max) / 2;
+		
+		if (strlen($binary) == 0)
+			return $mid;
+			
+		$bit = substr($binary, 0, 1);
+		$binary = substr($binary, 1);
+		
+		if ($bit == 1)
+			return $this->binDecode($binary, $mid, $max);
+		else
+			return $this->binDecode($binary, $min, $mid);
+	}
+}
+
+
+
+
+

+ 14 - 0
core/framework/libraries/log.php

@@ -4,6 +4,20 @@
  ***/
 defined('InShopNC') or exit('Access Invalid!');
 
+class scope_trace
+{
+    private $mTag;
+    public function __construct($tag)
+    {
+        $this->mTag = $tag;
+        Log::record("{$this->mTag} begin----------------------------",Log::DEBUG);
+    }
+    public function __destruct()
+    {
+        Log::record("{$this->mTag} end  ----------------------------",Log::DEBUG);
+    }
+}
+
 class Log
 {
     const open_sql = true;

+ 23 - 1
core/framework/libraries/pinyin.php

@@ -1503,7 +1503,7 @@ class Pinyin
         '撙' => 'zun',
         '胙' => 'zuo',
         '阿' => 'a',
-        '阿' => 'e',
+//        '阿' => 'e',
         '柏' => 'bai',
         '蚌' => 'beng',
         '薄' => 'bo',
@@ -7004,6 +7004,7 @@ class Pinyin
      */
     public static function getPinyin($string, $encoding = 'utf-8')
     {
+        self::$pinyin = '';
         if ($string != self::$string || $encoding != self::$encoding) {
             self::chineseToPinyin($string, $encoding);
         }
@@ -7018,9 +7019,30 @@ class Pinyin
      */
     public static function getShortPinyin($string, $encoding = 'utf-8')
     {
+        self::$short_pinyin = '';
         if ($string != self::$string || $encoding != self::$encoding) {
             self::chineseToPinyin($string, $encoding);
         }
         return self::$short_pinyin;
     }
+
+    /**
+     * 获取首字母
+     */
+    public static function getAlpha($string, $encoding = 'utf-8')
+    {
+        self::$short_pinyin = '';
+        if ($string != self::$string || $encoding != self::$encoding) {
+            self::chineseToPinyin($string, $encoding);
+        }
+
+        $words = self::$short_pinyin;
+        if(empty($words)) {
+            return '';
+        }
+        else {
+            $ar = str_split($words);
+            return $ar[0];
+        }
+    }
 }

+ 0 - 31
crontab/control/command.php

@@ -19,9 +19,6 @@ require_once(BASE_ROOT_PATH . '/helper/account_helper.php');
 require_once(BASE_ROOT_PATH . '/data/mobile/lrlz_staff.php');
 require_once(BASE_ROOT_PATH . '/helper/search/tcp_client.php');
 require_once(BASE_ROOT_PATH . '/helper/room/factory_client.php');
-require_once(BASE_ROOT_PATH . '/helper/car/importer.php');
-require_once(BASE_ROOT_PATH . '/helper/car/formater.php');
-require_once(BASE_ROOT_PATH . '/helper/geo_helper.php');
 
 class commandControl extends BaseCronControl
 {
@@ -254,12 +251,6 @@ class commandControl extends BaseCronControl
         }
     }
 
-    public function init_carOp()
-    {
-        $import = new car\importer("all", ";");
-        $import->run(BASE_ROOT_PATH . '/data/car/data_all.csv');
-    }
-
     public function init_rewared_inviterOp()
     {
         $mod_member = Model('member');
@@ -290,26 +281,4 @@ class commandControl extends BaseCronControl
     {
         $ret = room\factory_client::instance()->create_shake(self::admin_member_id);
     }
-
-    public function init_storeOp()
-    {
-        $mod_member = Model('store');
-        $i = 0;
-        while (true) {
-            $start = $i * 1000;
-            $items = $mod_member->field('*')->order('store_id asc')->limit("{$start},1000")->select();
-            if (empty($items)) {
-                return;
-            }
-            $i++;
-
-            foreach ($items as $item) {
-                $store_id = intval($item['store_id']);
-                $ret = geo_helper::instance()->update_store($store_id);
-                if($ret == false) {
-                    Log::record("",Log::ERR);
-                }
-            }
-        }
-    }
 }

+ 7 - 1
crontab/crawl/upload_control.php

@@ -74,7 +74,13 @@ class upload_control
             $output = array();
             $output['error'] = $upload->error;
             $output = json_encode($output);
-            exit($output);
+
+            if(is_mobile()) {
+                return false;
+            }
+            else {
+                exit($output);
+            }
         }
 
         $img_path = $upload->getSysSetPath() . $upload->file_name;

+ 2 - 0
data/api/aliyun-oss-php-sdk-2.3.0/.coveralls.yml

@@ -0,0 +1,2 @@
+coverage_clover: coverage.xml
+json_path: coverage.json

+ 8 - 0
data/api/aliyun-oss-php-sdk-2.3.0/.gitignore

@@ -0,0 +1,8 @@
+vendor
+composer.lock
+doc
+output
+.idea
+.buildpath
+.project
+.settings

File diff suppressed because it is too large
+ 21 - 0
data/api/aliyun-oss-php-sdk-2.3.0/.travis.yml


+ 92 - 0
data/api/aliyun-oss-php-sdk-2.3.0/CHANGELOG.md

@@ -0,0 +1,92 @@
+# ChangeLog - Aliyun OSS SDK for PHP
+
+## v2.3.0 / 2018-01-05
+
+* 修复:putObject支持创建空文件
+* 修复:createBucket支持IA/Archive
+* 增加:支持restoreObject
+* 增加:支持Symlink功能
+* 增加:支持getBucketLocation
+* 增加:支持getBucketMeta
+* 增加:支持代理服务器Proxy
+
+## v2.2.4 / 2017-04-25
+
+* fix getObject to local file bug
+
+## v2.2.3 / 2017-04-14
+
+* fix md5 check
+
+## v2.2.2 / 2017-01-18
+
+* 解决在php7上运行连接数和内存bug
+
+## v2.2.1 / 2016-12-01
+
+* 禁止http curl自动填充Accept-Encoding
+
+## v2.2.0 / 2016-11-22
+
+* 修复PutObject/CompleteMultipartUpload的返回值问题(#26)
+
+## v2.1.0 / 2016-11-12
+
+* 增加[RTMP](https://help.aliyun.com/document_detail/44297.html)接口
+* 增加支持[图片服务](https://help.aliyun.com/document_detail/44686.html)
+
+## v2.0.7 / 2016-06-17
+
+* Support append object
+
+## v2.0.6
+
+* Trim access key id/secret and endpoint
+* Refine tests and setup travis CI
+
+## v2.0.5
+
+* 增加Add/Delete/Get BucketCname接口
+
+## v2.0.4
+
+* 增加Put/Get Object Acl接口
+
+## v2.0.3
+
+* 修复Util中的常量定义在低于5.6的PHP版本中报错的问题
+
+## v2.0.2
+
+* 修复multipart上传时无法指定Content-Type的问题
+
+## v2.0.1
+
+* 增加对ListObjects/ListMultipartUploads时特殊字符的处理
+* 提供接口获取OssException中的详细信息
+
+
+## 2015.11.25
+
+* **大版本升级,不再兼容以前接口,新版本对易用性做了很大的改进,建议用户迁移到新版本。**
+
+## 修改内容
+
+* 不再支持PHP 5.2版本
+
+### 新增内容
+
+* 引入命名空间
+* 接口命名修正,采用驼峰式命名
+* 接口入参修改,把常用参数从Options参数中提出来
+* 接口返回结果修改,对返回结果进行处理,用户可以直接得到容易处理的数据结构 
+* OssClient的构造函数变更
+* 支持CNAME和IP格式的Endpoint地址
+* 重新整理sample文件组织结构,使用function组织功能点
+* 增加设置连接超时,请求超时的接口
+* 去掉Object Group相关的已经过时的接口
+* OssException中的message改为英文
+
+### 问题修复
+
+* object名称校验不完备

+ 21 - 0
data/api/aliyun-oss-php-sdk-2.3.0/LICENSE.md

@@ -0,0 +1,21 @@
+#The MIT License (MIT)
+
+Copyright (c) ali-sdk and other contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 149 - 0
data/api/aliyun-oss-php-sdk-2.3.0/README-CN.md

@@ -0,0 +1,149 @@
+# Aliyun OSS SDK for PHP
+
+[![Latest Stable Version](https://poser.pugx.org/aliyuncs/oss-sdk-php/v/stable)](https://packagist.org/packages/aliyuncs/oss-sdk-php)
+[![Build Status](https://travis-ci.org/aliyun/aliyun-oss-php-sdk.svg?branch=master)](https://travis-ci.org/aliyun/aliyun-oss-php-sdk)
+[![Coverage Status](https://coveralls.io/repos/github/aliyun/aliyun-oss-php-sdk/badge.svg?branch=master)](https://coveralls.io/github/aliyun/aliyun-oss-php-sdk?branch=master)
+
+## [README of English](https://github.com/aliyun/aliyun-oss-php-sdk/blob/master/README.md)
+
+## 概述
+
+阿里云对象存储(Object Storage Service,简称OSS),是阿里云对外提供的海量、安全、低成本、高可靠的云存储服务。用户可以通过调用API,在任何应用、任何时间、任何地点上传和下载数据,也可以通过用户Web控制台对数据进行简单的管理。OSS适合存放任意文件类型,适合各种网站、开发企业及开发者使用。
+
+
+## 运行环境
+- PHP 5.3+
+- cURL extension
+
+提示:
+
+- Ubuntu下可以使用apt-get包管理器安装php的cURL扩展 `sudo apt-get install php5-curl`
+
+## 安装方法
+
+1. 如果您通过composer管理您的项目依赖,可以在你的项目根目录运行:
+
+        $ composer require aliyuncs/oss-sdk-php
+
+   或者在你的`composer.json`中声明对Aliyun OSS SDK for PHP的依赖:
+
+        "require": {
+            "aliyuncs/oss-sdk-php": "~2.0"
+        }
+
+   然后通过`composer install`安装依赖。composer安装完成后,在您的PHP代码中引入依赖即可:
+
+        require_once __DIR__ . '/vendor/autoload.php';
+
+2. 您也可以直接下载已经打包好的[phar文件][releases-page],然后在你
+   的代码中引入这个文件即可:
+
+        require_once '/path/to/oss-sdk-php.phar';
+
+3. 下载SDK源码,在您的代码中引入SDK目录下的`autoload.php`文件:
+
+        require_once '/path/to/oss-sdk/autoload.php';
+
+## 快速使用
+
+### 常用类
+
+| 类名 | 解释 |
+|:------------------|:------------------------------------|
+|OSS\OssClient | OSS客户端类,用户通过OssClient的实例调用接口 |
+|OSS\Core\OssException | OSS异常类,用户在使用的过程中,只需要注意这个异常|
+
+### OssClient初始化
+
+SDK的OSS操作通过OssClient类完成的,下面代码创建一个OssClient对象:
+
+```php
+<?php
+$accessKeyId = "<您从OSS获得的AccessKeyId>"; ;
+$accessKeySecret = "<您从OSS获得的AccessKeySecret>";
+$endpoint = "<您选定的OSS数据中心访问域名,例如oss-cn-hangzhou.aliyuncs.com>";
+try {
+    $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);
+} catch (OssException $e) {
+    print $e->getMessage();
+}
+```
+
+### 文件操作
+
+文件(又称对象,Object)是OSS中最基本的数据单元,您可以把它简单地理解为文件,用下面代码可以实现一个Object的上传:
+
+```php
+<?php
+$bucket = "<您使用的Bucket名字,注意命名规范>";
+$object = "<您使用的Object名字,注意命名规范>";
+$content = "Hello, OSS!"; // 上传的文件内容
+try {
+    $ossClient->putObject($bucket, $object, $content);
+} catch (OssException $e) {
+    print $e->getMessage();
+}
+```
+
+### 存储空间操作
+
+存储空间(又称Bucket)是一个用户用来管理所存储Object的存储空间,对于用户来说是一个管理Object的单元,所有的Object都必须隶属于某个Bucket。您可以按照下面的代码新建一个Bucket:
+
+```php
+<?php
+$bucket = "<您使用的Bucket名字,注意命名规范>";
+try {
+    $ossClient->createBucket($bucket);
+} catch (OssException $e) {
+    print $e->getMessage();
+}
+```
+
+### 返回结果处理
+
+OssClient提供的接口返回返回数据分为两种:
+
+* Put,Delete类接口,接口返回null,如果没有OssException,即可认为操作成功
+* Get,List类接口,接口返回对应的数据,如果没有OssException,即可认为操作成功,举个例子:
+
+```php
+<?php
+$bucketListInfo = $ossClient->listBuckets();
+$bucketList = $bucketListInfo->getBucketList();
+foreach($bucketList as $bucket) {
+    print($bucket->getLocation() . "\t" . $bucket->getName() . "\t" . $bucket->getCreatedate() . "\n");
+}
+```
+上面代码中的$bucketListInfo的数据类型是 `OSS\Model\BucketListInfo`
+
+
+### 运行Sample程序
+
+1. 修改 `samples/Config.php`, 补充配置信息
+2. 执行 `cd samples/ && php RunAll.php`
+
+### 运行单元测试
+
+1. 执行`composer install`下载依赖的库
+2. 设置环境变量
+
+        export OSS_ACCESS_KEY_ID=access-key-id
+        export OSS_ACCESS_KEY_SECRET=access-key-secret
+        export OSS_ENDPOINT=endpoint
+        export OSS_BUCKET=bucket-name
+
+3. 执行 `php vendor/bin/phpunit`
+
+## License
+
+- MIT
+
+## 联系我们
+
+- [阿里云OSS官方网站](http://oss.aliyun.com)
+- [阿里云OSS官方论坛](http://bbs.aliyun.com)
+- [阿里云OSS官方文档中心](http://www.aliyun.com/product/oss#Docs)
+- 阿里云官方技术支持:[提交工单](https://workorder.console.aliyun.com/#/ticket/createIndex)
+
+[releases-page]: https://github.com/aliyun/aliyun-oss-php-sdk/releases
+[phar-composer]: https://github.com/clue/phar-composer

+ 150 - 0
data/api/aliyun-oss-php-sdk-2.3.0/README.md

@@ -0,0 +1,150 @@
+# Alibaba Cloud OSS SDK for PHP
+
+[![Latest Stable Version](https://poser.pugx.org/aliyuncs/oss-sdk-php/v/stable)](https://packagist.org/packages/aliyuncs/oss-sdk-php)
+[![Build Status](https://travis-ci.org/aliyun/aliyun-oss-php-sdk.svg?branch=master)](https://travis-ci.org/aliyun/aliyun-oss-php-sdk)
+[![Coverage Status](https://coveralls.io/repos/github/aliyun/aliyun-oss-php-sdk/badge.svg?branch=master)](https://coveralls.io/github/aliyun/aliyun-oss-php-sdk?branch=master)
+
+## [README of Chinese](https://github.com/aliyun/aliyun-oss-php-sdk/blob/master/README-CN.md)
+
+## Overview
+
+Alibaba Cloud Object Storage Service (OSS) is a cloud storage service provided by Alibaba Cloud, featuring a massive capacity, security, a low cost, and high reliability. You can upload and download data on any application anytime and anywhere by calling APIs, and perform simple management of data through the web console. The OSS can store any type of files and therefore applies to various websites, development enterprises and developers.
+
+
+## Run environment
+- PHP 5.3+.
+- cURL extension.
+
+Tips:
+
+- In Ubuntu, you can use the ***apt-get*** package manager to install the *PHP cURL extension*: `sudo apt-get install php5-curl`.
+
+## Install OSS PHP SDK
+
+- If you use the ***composer*** to manage project dependencies, run the following command in your project's root directory:
+
+        composer require aliyuncs/oss-sdk-php
+
+   You can also declare the dependency on Alibaba Cloud OSS SDK for PHP in the `composer.json` file.
+
+        "require": {
+            "aliyuncs/oss-sdk-php": "~2.0"
+        }
+
+   Then run `composer install` to install the dependency. After the Composer Dependency Manager is installed, import the dependency in your PHP code: 
+
+        require_once __DIR__ . '/vendor/autoload.php';
+
+- You can also directly download the packaged [PHAR File][releases-page], and 
+   introduce the file to your code: 
+
+        require_once '/path/to/oss-sdk-php.phar';
+
+- Download the SDK source code, and introduce the `autoload.php` file under the SDK directory to your code: 
+
+        require_once '/path/to/oss-sdk/autoload.php';
+
+## Quick use
+
+### Common classes
+
+| Class | Explanation |
+|:------------------|:------------------------------------|
+|OSS\OSSClient | OSS client class. An OSSClient instance can be used to call the interface.  |
+|OSS\Core\OSSException |OSS Exception class . You only need to pay attention to this exception when you use the OSSClient. |
+
+### Initialize an OSSClient
+
+The SDK's operations for the OSS are performed through the OSSClient class. The code below creates an OSSClient object:
+
+```php
+<?php
+$accessKeyId = "<AccessKeyID that you obtain from OSS>";
+$accessKeySecret = "<AccessKeySecret that you obtain from OSS>";
+$endpoint = "<Domain that you select to access an OSS data center, such as "oss-cn-hangzhou.aliyuncs.com>";
+try {
+    $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);
+} catch (OssException $e) {
+    print $e->getMessage();
+}
+```
+
+### Operations on objects
+
+Objects are the most basic data units on the OSS. You can simply consider objects as files. The following code uploads an object:
+
+```php
+<?php
+$bucket= "<Name of the bucket in use. Pay attention to naming conventions>";
+$object = "<Name of the object in use. Pay attention to naming conventions>";
+$content = "Hello, OSS!"; // Content of the uploaded file
+try {
+    $ossClient->putObject($bucket, $object, $content);
+} catch (OssException $e) {
+    print $e->getMessage();
+}
+```
+
+### Operations on buckets
+
+Buckets are the space that you use to manage the stored objects. It is an object management unit for users. Each object must belong to a bucket. You can create a bucket with the following code:
+
+```php
+<?php
+$bucket= "<Name of the bucket in use. Pay attention to naming conventions>";
+try {
+    $ossClient->createBucket($bucket);
+} catch (OssException $e) {
+    print $e->getMessage();
+}
+```
+
+### Handle returned results
+
+The OSSClient provides the following two types of returned data from interfaces:
+
+- Put and Delete interfaces: The *PUT* and *DELETE* operations are deemed successful if *null* is returned by the interfaces without *OSSException*.
+- Get and List interfaces: The *GET* and *LIST* operations are deemed successful if the desired data is returned by the interfaces without *OSSException*. For example, 
+
+    ```php
+    <?php
+    $bucketListInfo = $ossClient->listBuckets();
+    $bucketList = $bucketListInfo->getBucketList();
+    foreach($bucketList as $bucket) {
+        print($bucket->getLocation() . "\t" . $bucket->getName() . "\t" . $bucket->getCreatedate() . "\n");
+    }
+    ```
+In the above code, $bucketListInfo falls into the 'OSS\Model\BucketListInfo' data type.
+
+
+### Run a sample project
+
+- Modify `samples/Config.php` to complete the configuration information. 
+- Run `cd samples/ && php RunAll.php`. 
+
+### Run a unit test
+
+- Run `composer install` to download the dependent libraries. 
+- Set the environment variable. 
+
+        export OSS_ACCESS_KEY_ID=access-key-id
+        export OSS_ACCESS_KEY_SECRET=access-key-secret
+        export OSS_ENDPOINT=endpoint
+        export OSS_BUCKET=bucket-name
+
+- Run `php vendor/bin/phpunit`
+
+## License
+
+- MIT
+
+## Contact us
+
+- [Alibaba Cloud OSS official website](http://oss.aliyun.com).
+- [Alibaba Cloud OSS official forum](http://bbs.aliyun.com).
+- [Alibaba Cloud OSS official documentation center](http://www.aliyun.com/product/oss#Docs).
+- Alibaba Cloud official technical support: [Submit a ticket](https://workorder.console.aliyun.com/#/ticket/createIndex).
+
+[releases-page]: https://github.com/aliyun/aliyun-oss-php-sdk/releases
+[phar-composer]: https://github.com/clue/phar-composer
+

+ 11 - 0
data/api/aliyun-oss-php-sdk-2.3.0/autoload.php

@@ -0,0 +1,11 @@
+<?php
+
+function classLoader($class)
+{
+    $path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
+    $file = __DIR__ . DIRECTORY_SEPARATOR .'src'. DIRECTORY_SEPARATOR . $path . '.php';
+    if (file_exists($file)) {
+        require_once $file;
+    }
+}
+spl_autoload_register('classLoader');

+ 13 - 0
data/api/aliyun-oss-php-sdk-2.3.0/build-phar.sh

@@ -0,0 +1,13 @@
+#! /usr/bin/env bash
+
+# Remove dev deps to reduce phar size
+rm -rf composer.lock vendor/
+
+# Generate composer.lock
+composer install --no-dev
+
+# Find SDK version
+version=$(grep 'const OSS_VERSION' src/OSS/OssClient.php | grep -oE '[0-9.]+')
+
+# Build phar
+phar-composer build . aliyun-oss-php-sdk-$version.phar

+ 24 - 0
data/api/aliyun-oss-php-sdk-2.3.0/composer.json

@@ -0,0 +1,24 @@
+{
+    "name": "aliyuncs/oss-sdk-php",
+    "description": "Aliyun OSS SDK for PHP",
+    "homepage": "http://www.aliyun.com/product/oss/",
+    "type": "library",
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Aliyuncs",
+            "homepage": "http://www.aliyun.com"
+        }
+    ],
+    "require": {
+        "php":">=5.3"
+    },
+    "require-dev" : {
+        "phpunit/phpunit": "~4.0",
+        "satooshi/php-coveralls": "~1.0"
+    },
+    "minimum-stability": "stable",
+    "autoload": {
+        "psr-4": {"OSS\\": "src/OSS"}
+    }
+}

BIN
data/api/aliyun-oss-php-sdk-2.3.0/example.jpg


+ 3 - 0
data/api/aliyun-oss-php-sdk-2.3.0/index.php

@@ -0,0 +1,3 @@
+<?php
+
+require_once __DIR__ . '/vendor/autoload.php';

+ 19 - 0
data/api/aliyun-oss-php-sdk-2.3.0/phpunit.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xml>
+
+<phpunit>
+	<filter>
+		<whitelist>
+			<directory suffix=".php">./src</directory>
+		</whitelist>
+	</filter>
+	<logging>
+		<log type="coverage-clover" target="coverage.xml" />
+	</logging>
+	<testsuites>
+		<testsuite name="FunctionTest">
+			<directory>./tests</directory>
+			<exclude>./tests/OSS/Tests/BucketCnameTest.php</exclude>
+		</testsuite>
+	</testsuites>
+</phpunit>

+ 167 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/Bucket.php

@@ -0,0 +1,167 @@
+<?php
+require_once __DIR__ . '/Common.php';
+
+use OSS\OssClient;
+use OSS\Core\OssException;
+
+$ossClient = Common::getOssClient();
+if (is_null($ossClient)) exit(1);
+$bucket = Common::getBucketName();
+
+//******************************* 简单使用 ****************************************************************
+
+//创建bucket
+$ossClient->createBucket($bucket, OssClient::OSS_ACL_TYPE_PUBLIC_READ_WRITE);
+Common::println("bucket $bucket created");
+
+// 判断Bucket是否存在
+$doesExist = $ossClient->doesBucketExist($bucket);
+Common::println("bucket $bucket exist? " . ($doesExist ? "yes" : "no"));
+
+// 获取Bucket列表
+$bucketListInfo = $ossClient->listBuckets();
+
+// 设置bucket的ACL
+$ossClient->putBucketAcl($bucket, OssClient::OSS_ACL_TYPE_PUBLIC_READ_WRITE);
+Common::println("bucket $bucket acl put");
+// 获取bucket的ACL
+$acl = $ossClient->getBucketAcl($bucket);
+Common::println("bucket $bucket acl get: " . $acl);
+
+
+//******************************* 完整用法参考下面函数 ****************************************************
+
+createBucket($ossClient, $bucket);
+doesBucketExist($ossClient, $bucket);
+deleteBucket($ossClient, $bucket);
+putBucketAcl($ossClient, $bucket);
+getBucketAcl($ossClient, $bucket);
+listBuckets($ossClient);
+
+/**
+ * 创建一个存储空间
+ * acl 指的是bucket的访问控制权限,有三种,私有读写,公共读私有写,公共读写。
+ * 私有读写就是只有bucket的拥有者或授权用户才有权限操作
+ * 三种权限分别对应 (OssClient::OSS_ACL_TYPE_PRIVATE,OssClient::OSS_ACL_TYPE_PUBLIC_READ, OssClient::OSS_ACL_TYPE_PUBLIC_READ_WRITE)
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 要创建的存储空间名称
+ * @return null
+ */
+function createBucket($ossClient, $bucket)
+{
+    try {
+        $ossClient->createBucket($bucket, OssClient::OSS_ACL_TYPE_PUBLIC_READ_WRITE);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+/**
+ *  判断Bucket是否存在
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ */
+function doesBucketExist($ossClient, $bucket)
+{
+    try {
+        $res = $ossClient->doesBucketExist($bucket);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    if ($res === true) {
+        print(__FUNCTION__ . ": OK" . "\n");
+    } else {
+        print(__FUNCTION__ . ": FAILED" . "\n");
+    }
+}
+
+/**
+ * 删除bucket,如果bucket不为空则bucket无法删除成功, 不为空表示bucket既没有object,也没有未完成的multipart上传时的parts
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 待删除的存储空间名称
+ * @return null
+ */
+function deleteBucket($ossClient, $bucket)
+{
+    try {
+        $ossClient->deleteBucket($bucket);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+/**
+ * 设置bucket的acl配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function putBucketAcl($ossClient, $bucket)
+{
+    $acl = OssClient::OSS_ACL_TYPE_PRIVATE;
+    try {
+        $ossClient->putBucketAcl($bucket, $acl);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+
+/**
+ * 获取bucket的acl配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function getBucketAcl($ossClient, $bucket)
+{
+    try {
+        $res = $ossClient->getBucketAcl($bucket);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    print('acl: ' . $res);
+}
+
+
+/**
+ * 列出用户所有的Bucket
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @return null
+ */
+function listBuckets($ossClient)
+{
+    $bucketList = null;
+    try {
+        $bucketListInfo = $ossClient->listBuckets();
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    $bucketList = $bucketListInfo->getBucketList();
+    foreach ($bucketList as $bucket) {
+        print($bucket->getLocation() . "\t" . $bucket->getName() . "\t" . $bucket->getCreatedate() . "\n");
+    }
+}

+ 108 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/BucketCors.php

@@ -0,0 +1,108 @@
+<?php
+require_once __DIR__ . '/Common.php';
+
+use OSS\OssClient;
+use OSS\Core\OssException;
+use OSS\Model\CorsConfig;
+use OSS\Model\CorsRule;
+
+$ossClient = Common::getOssClient();
+if (is_null($ossClient)) exit(1);
+$bucket = Common::getBucketName();
+
+
+//******************************* 简单使用 ****************************************************************
+
+// 设置cors配置
+$corsConfig = new CorsConfig();
+$rule = new CorsRule();
+$rule->addAllowedHeader("x-oss-header");
+$rule->addAllowedOrigin("http://www.b.com");
+$rule->addAllowedMethod("POST");
+$rule->setMaxAgeSeconds(10);
+$corsConfig->addRule($rule);
+$ossClient->putBucketCors($bucket, $corsConfig);
+Common::println("bucket $bucket corsConfig created:" . $corsConfig->serializeToXml());
+
+// 获取cors配置
+$corsConfig = $ossClient->getBucketCors($bucket);
+Common::println("bucket $bucket corsConfig fetched:" . $corsConfig->serializeToXml());
+
+// 删除cors配置
+$ossClient->deleteBucketCors($bucket);
+Common::println("bucket $bucket corsConfig deleted");
+
+//******************************* 完整用法参考下面函数  *****************************************************
+
+putBucketCors($ossClient, $bucket);
+getBucketCors($ossClient, $bucket);
+deleteBucketCors($ossClient, $bucket);
+getBucketCors($ossClient, $bucket);
+
+/**
+ * 设置bucket的cors配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function putBucketCors($ossClient, $bucket)
+{
+    $corsConfig = new CorsConfig();
+    $rule = new CorsRule();
+    $rule->addAllowedHeader("x-oss-header");
+    $rule->addAllowedOrigin("http://www.b.com");
+    $rule->addAllowedMethod("POST");
+    $rule->setMaxAgeSeconds(10);
+    $corsConfig->addRule($rule);
+
+    try {
+        $ossClient->putBucketCors($bucket, $corsConfig);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+/**
+ * 获取并打印bucket的cors配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function getBucketCors($ossClient, $bucket)
+{
+    $corsConfig = null;
+    try {
+        $corsConfig = $ossClient->getBucketCors($bucket);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    print($corsConfig->serializeToXml() . "\n");
+}
+
+/**
+ * 删除bucket的所有的cors配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function deleteBucketCors($ossClient, $bucket)
+{
+    try {
+        $ossClient->deleteBucketCors($bucket);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+

+ 109 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/BucketLifecycle.php

@@ -0,0 +1,109 @@
+<?php
+require_once __DIR__ . '/Common.php';
+
+use OSS\OssClient;
+use OSS\Core\OssException;
+use OSS\Model\LifecycleAction;
+use OSS\Model\LifecycleConfig;
+use OSS\Model\LifecycleRule;
+
+$bucket = Common::getBucketName();
+$ossClient = Common::getOssClient();
+if (is_null($ossClient)) exit(1);
+
+//******************************* 简单使用 *******************************************************
+
+//设置lifecycle规则
+$lifecycleConfig = new LifecycleConfig();
+$actions = array();
+$actions[] = new LifecycleAction("Expiration", "Days", 3);
+$lifecycleRule = new LifecycleRule("delete obsoleted files", "obsoleted/", "Enabled", $actions);
+$lifecycleConfig->addRule($lifecycleRule);
+$ossClient->putBucketLifecycle($bucket, $lifecycleConfig);
+Common::println("bucket $bucket lifecycleConfig created:" . $lifecycleConfig->serializeToXml());
+
+//获取lifecycle规则
+$lifecycleConfig = $ossClient->getBucketLifecycle($bucket);
+Common::println("bucket $bucket lifecycleConfig fetched:" . $lifecycleConfig->serializeToXml());
+
+//删除bucket的lifecycle配置
+$ossClient->deleteBucketLifecycle($bucket);
+Common::println("bucket $bucket lifecycleConfig deleted");
+
+
+//***************************** 完整用法参考下面函数  ***********************************************
+
+putBucketLifecycle($ossClient, $bucket);
+getBucketLifecycle($ossClient, $bucket);
+deleteBucketLifecycle($ossClient, $bucket);
+getBucketLifecycle($ossClient, $bucket);
+
+/**
+ * 设置bucket的生命周期配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function putBucketLifecycle($ossClient, $bucket)
+{
+    $lifecycleConfig = new LifecycleConfig();
+    $actions = array();
+    $actions[] = new LifecycleAction(OssClient::OSS_LIFECYCLE_EXPIRATION, OssClient::OSS_LIFECYCLE_TIMING_DAYS, 3);
+    $lifecycleRule = new LifecycleRule("delete obsoleted files", "obsoleted/", "Enabled", $actions);
+    $lifecycleConfig->addRule($lifecycleRule);
+    $actions = array();
+    $actions[] = new LifecycleAction(OssClient::OSS_LIFECYCLE_EXPIRATION, OssClient::OSS_LIFECYCLE_TIMING_DATE, '2022-10-12T00:00:00.000Z');
+    $lifecycleRule = new LifecycleRule("delete temporary files", "temporary/", "Enabled", $actions);
+    $lifecycleConfig->addRule($lifecycleRule);
+    try {
+        $ossClient->putBucketLifecycle($bucket, $lifecycleConfig);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+/**
+ * 获取bucket的生命周期配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function getBucketLifecycle($ossClient, $bucket)
+{
+    $lifecycleConfig = null;
+    try {
+        $lifecycleConfig = $ossClient->getBucketLifecycle($bucket);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    print($lifecycleConfig->serializeToXml() . "\n");
+}
+
+/**
+ * 删除bucket的生命周期配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function deleteBucketLifecycle($ossClient, $bucket)
+{
+    try {
+        $ossClient->deleteBucketLifecycle($bucket);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+

+ 95 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/BucketLogging.php

@@ -0,0 +1,95 @@
+<?php
+require_once __DIR__ . '/Common.php';
+
+use OSS\OssClient;
+use OSS\Core\OssException;
+
+$bucket = Common::getBucketName();
+$ossClient = Common::getOssClient();
+if (is_null($ossClient)) exit(1);
+
+//*******************************简单使用***************************************************************
+
+// 设置Bucket访问日志记录规则, 访问日志文件的存放位置是同bucket下的access.log前缀的文件
+$ossClient->putBucketLogging($bucket, $bucket, "access.log", array());
+Common::println("bucket $bucket lifecycleConfig created");
+
+// 获取Bucket访问日志记录规则
+$loggingConfig = $ossClient->getBucketLogging($bucket, array());
+Common::println("bucket $bucket lifecycleConfig fetched:" . $loggingConfig->serializeToXml());
+
+// 删除Bucket访问日志记录规则
+$loggingConfig = $ossClient->getBucketLogging($bucket, array());
+Common::println("bucket $bucket lifecycleConfig deleted");
+
+//******************************* 完整用法参考下面函数 ****************************************************
+
+putBucketLogging($ossClient, $bucket);
+getBucketLogging($ossClient, $bucket);
+deleteBucketLogging($ossClient, $bucket);
+getBucketLogging($ossClient, $bucket);
+
+/**
+ * 设置bucket的Logging配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function putBucketLogging($ossClient, $bucket)
+{
+    $option = array();
+    //访问日志存放在本bucket下
+    $targetBucket = $bucket;
+    $targetPrefix = "access.log";
+
+    try {
+        $ossClient->putBucketLogging($bucket, $targetBucket, $targetPrefix, $option);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+/**
+ * 获取bucket的Logging配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function getBucketLogging($ossClient, $bucket)
+{
+    $loggingConfig = null;
+    $options = array();
+    try {
+        $loggingConfig = $ossClient->getBucketLogging($bucket, $options);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    print($loggingConfig->serializeToXml() . "\n");
+}
+
+/**
+ * 删除bucket的Logging配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function deleteBucketLogging($ossClient, $bucket)
+{
+    try {
+        $ossClient->deleteBucketLogging($bucket);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}

+ 101 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/BucketReferer.php

@@ -0,0 +1,101 @@
+<?php
+require_once __DIR__ . '/Common.php';
+
+use OSS\OssClient;
+use OSS\Core\OssException;
+use \OSS\Model\RefererConfig;
+
+$bucket = Common::getBucketName();
+$ossClient = Common::getOssClient();
+if (is_null($ossClient)) exit(1);
+
+//******************************* 简单使用 ****************************************************************
+
+//设置referer白名单
+$refererConfig = new RefererConfig();
+$refererConfig->setAllowEmptyReferer(true);
+$refererConfig->addReferer("www.aliiyun.com");
+$refererConfig->addReferer("www.aliiyuncs.com");
+$ossClient->putBucketReferer($bucket, $refererConfig);
+Common::println("bucket $bucket refererConfig created:" . $refererConfig->serializeToXml());
+//获取Referer白名单
+$refererConfig = $ossClient->getBucketReferer($bucket);
+Common::println("bucket $bucket refererConfig fetched:" . $refererConfig->serializeToXml());
+
+//删除referer白名单
+$refererConfig = new RefererConfig();
+$ossClient->putBucketReferer($bucket, $refererConfig);
+Common::println("bucket $bucket refererConfig deleted");
+
+
+//******************************* 完整用法参考下面函数 ****************************************************
+
+putBucketReferer($ossClient, $bucket);
+getBucketReferer($ossClient, $bucket);
+deleteBucketReferer($ossClient, $bucket);
+getBucketReferer($ossClient, $bucket);
+
+/**
+ * 设置bucket的防盗链配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function putBucketReferer($ossClient, $bucket)
+{
+    $refererConfig = new RefererConfig();
+    $refererConfig->setAllowEmptyReferer(true);
+    $refererConfig->addReferer("www.aliiyun.com");
+    $refererConfig->addReferer("www.aliiyuncs.com");
+    try {
+        $ossClient->putBucketReferer($bucket, $refererConfig);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+/**
+ * 获取bucket的防盗链配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function getBucketReferer($ossClient, $bucket)
+{
+    $refererConfig = null;
+    try {
+        $refererConfig = $ossClient->getBucketReferer($bucket);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    print($refererConfig->serializeToXml() . "\n");
+}
+
+/**
+ * 删除bucket的防盗链配置
+ * Referer白名单不能直接清空,只能通过重新设置来覆盖之前的规则。
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function deleteBucketReferer($ossClient, $bucket)
+{
+    $refererConfig = new RefererConfig();
+    try {
+        $ossClient->putBucketReferer($bucket, $refererConfig);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}

+ 92 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/BucketWebsite.php

@@ -0,0 +1,92 @@
+<?php
+require_once __DIR__ . '/Common.php';
+
+use OSS\OssClient;
+use OSS\Core\OssException;
+use OSS\Model\WebsiteConfig;
+
+$bucket = Common::getBucketName();
+$ossClient = Common::getOssClient();
+if (is_null($ossClient)) exit(1);
+
+//*******************************简单使用***************************************************************
+
+// 设置Bucket的静态网站托管模式
+$websiteConfig = new WebsiteConfig("index.html", "error.html");
+$ossClient->putBucketWebsite($bucket, $websiteConfig);
+Common::println("bucket $bucket websiteConfig created:" . $websiteConfig->serializeToXml());
+
+// 查看Bucket的静态网站托管状态
+$websiteConfig = $ossClient->getBucketWebsite($bucket);
+Common::println("bucket $bucket websiteConfig fetched:" . $websiteConfig->serializeToXml());
+
+// 删除Bucket的静态网站托管模式
+$ossClient->deleteBucketWebsite($bucket);
+Common::println("bucket $bucket websiteConfig deleted");
+
+//******************************* 完整用法参考下面函数 ****************************************************
+
+putBucketWebsite($ossClient, $bucket);
+getBucketWebsite($ossClient, $bucket);
+deleteBucketWebsite($ossClient, $bucket);
+getBucketWebsite($ossClient, $bucket);
+
+/**
+ * 设置bucket的静态网站托管模式配置
+ *
+ * @param $ossClient OssClient
+ * @param  $bucket string 存储空间名称
+ * @return null
+ */
+function putBucketWebsite($ossClient, $bucket)
+{
+    $websiteConfig = new WebsiteConfig("index.html", "error.html");
+    try {
+        $ossClient->putBucketWebsite($bucket, $websiteConfig);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+/**
+ * 获取bucket的静态网站托管状态
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function getBucketWebsite($ossClient, $bucket)
+{
+    $websiteConfig = null;
+    try {
+        $websiteConfig = $ossClient->getBucketWebsite($bucket);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    print($websiteConfig->serializeToXml() . "\n");
+}
+
+/**
+ * 删除bucket的静态网站托管模式配置
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function deleteBucketWebsite($ossClient, $bucket)
+{
+    try {
+        $ossClient->deleteBucketWebsite($bucket);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}

+ 83 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/Callback.php

@@ -0,0 +1,83 @@
+<?php
+require_once __DIR__ . '/Common.php';
+
+use OSS\OssClient;
+
+$bucket = Common::getBucketName();
+$ossClient = Common::getOssClient();
+if (is_null($ossClient)) exit(1);
+
+//*******************************简单使用***************************************************************
+
+/** putObject 使用callback上传内容到oss文件
+  * callbackurl参数指定请求回调的服务器url
+  * callbackbodytype参数可为application/json或application/x-www-form-urlencoded, 可选参数,默认为application/x-www-form-urlencoded
+  * OSS_CALLBACK_VAR参数可以不设置
+  */
+$url = 
+    '{
+        "callbackUrl":"callback.oss-demo.com:23450",
+        "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
+        "callbackBody":"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&imageInfo.height=${imageInfo.height}&imageInfo.width=${imageInfo.width}&imageInfo.format=${imageInfo.format}&my_var1=${x:var1}&my_var2=${x:var2}",
+         "callbackBodyType":"application/x-www-form-urlencoded"
+
+    }';
+$var = 
+    '{
+        "x:var1":"value1",
+        "x:var2":"值2"
+    }';
+$options = array(OssClient::OSS_CALLBACK => $url,
+                 OssClient::OSS_CALLBACK_VAR => $var
+                );
+$result = $ossClient->putObject($bucket, "b.file", "random content", $options);
+Common::println($result['body']);
+Common::println($result['info']['http_code']);
+
+/**
+  * completeMultipartUpload 使用callback上传内容到oss文件
+  * callbackurl参数指定请求回调的服务器url
+  * callbackbodytype参数可为application/json或application/x-www-form-urlencoded, 可选参数,默认为application/x-www-form-urlencoded
+  * OSS_CALLBACK_VAR参数可以不设置
+  */  
+$object = "multipart-callback-test.txt";
+$copiedObject = "multipart-callback-test.txt.copied";
+$ossClient->putObject($bucket, $copiedObject, file_get_contents(__FILE__));
+
+/**
+  *  step 1. 初始化一个分块上传事件, 也就是初始化上传Multipart, 获取upload id
+  */
+$upload_id = $ossClient->initiateMultipartUpload($bucket, $object);
+
+/**
+ * step 2. uploadPartCopy
+ */
+$copyId = 1;
+$eTag = $ossClient->uploadPartCopy($bucket, $copiedObject, $bucket, $object, $copyId, $upload_id);
+$upload_parts[] = array(
+    'PartNumber' => $copyId,
+    'ETag' => $eTag,
+    );
+$listPartsInfo = $ossClient->listParts($bucket, $object, $upload_id);
+
+/**
+ * step 3.
+ */
+$json = 
+    '{
+        "callbackUrl":"callback.oss-demo.com:23450",
+        "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
+        "callbackBody":"{\"mimeType\":${mimeType},\"size\":${size},\"x:var1\":${x:var1},\"x:var2\":${x:var2}}",
+        "callbackBodyType":"application/json"
+    }';
+$var = 
+    '{
+        "x:var1":"value1",
+        "x:var2":"值2"
+    }';
+$options = array(OssClient::OSS_CALLBACK => $json,
+                 OssClient::OSS_CALLBACK_VAR => $var);
+
+$result = $ossClient->completeMultipartUpload($bucket, $object, $upload_id, $upload_parts, $options);
+Common::println($result['body']);
+Common::println($result['info']['http_code']);

+ 84 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/Common.php

@@ -0,0 +1,84 @@
+<?php
+
+if (is_file(__DIR__ . '/../autoload.php')) {
+    require_once __DIR__ . '/../autoload.php';
+}
+if (is_file(__DIR__ . '/../vendor/autoload.php')) {
+    require_once __DIR__ . '/../vendor/autoload.php';
+}
+require_once __DIR__ . '/Config.php';
+
+use OSS\OssClient;
+use OSS\Core\OssException;
+
+/**
+ * Class Common
+ *
+ * 示例程序【Samples/*.php】 的Common类,用于获取OssClient实例和其他公用方法
+ */
+class Common
+{
+    const endpoint = Config::OSS_ENDPOINT;
+    const accessKeyId = Config::OSS_ACCESS_ID;
+    const accessKeySecret = Config::OSS_ACCESS_KEY;
+    const bucket = Config::OSS_TEST_BUCKET;
+
+    /**
+     * 根据Config配置,得到一个OssClient实例
+     *
+     * @return OssClient 一个OssClient实例
+     */
+    public static function getOssClient()
+    {
+        try {
+            $ossClient = new OssClient(self::accessKeyId, self::accessKeySecret, self::endpoint, false);
+        } catch (OssException $e) {
+            printf(__FUNCTION__ . "creating OssClient instance: FAILED\n");
+            printf($e->getMessage() . "\n");
+            return null;
+        }
+        return $ossClient;
+    }
+
+    public static function getBucketName()
+    {
+        return self::bucket;
+    }
+
+    /**
+     * 工具方法,创建一个存储空间,如果发生异常直接exit
+     */
+    public static function createBucket()
+    {
+        $ossClient = self::getOssClient();
+        if (is_null($ossClient)) exit(1);
+        $bucket = self::getBucketName();
+        $acl = OssClient::OSS_ACL_TYPE_PUBLIC_READ;
+        try {
+            $ossClient->createBucket($bucket, $acl);
+        } catch (OssException $e) {
+
+            $message = $e->getMessage();
+            if (\OSS\Core\OssUtil::startsWith($message, 'http status: 403')) {
+                echo "Please Check your AccessKeyId and AccessKeySecret" . "\n";
+                exit(0);
+            } elseif (strpos($message, "BucketAlreadyExists") !== false) {
+                echo "Bucket already exists. Please check whether the bucket belongs to you, or it was visited with correct endpoint. " . "\n";
+                exit(0);
+            }
+            printf(__FUNCTION__ . ": FAILED\n");
+            printf($e->getMessage() . "\n");
+            return;
+        }
+        print(__FUNCTION__ . ": OK" . "\n");
+    }
+
+    public static function println($message)
+    {
+        if (!empty($message)) {
+            echo strval($message) . "\n";
+        }
+    }
+}
+
+Common::createBucket();

+ 15 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/Config.php

@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * Class Config
+ *
+ * 执行Sample示例所需要的配置,用户在这里配置好Endpoint,AccessId, AccessKey和Sample示例操作的
+ * bucket后,便可以直接运行RunAll.php, 运行所有的samples
+ */
+final class Config
+{
+    const OSS_ACCESS_ID = '';
+    const OSS_ACCESS_KEY = '';
+    const OSS_ENDPOINT = '';
+    const OSS_TEST_BUCKET = '';
+}

+ 87 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/Image.php

@@ -0,0 +1,87 @@
+<?php
+require_once __DIR__ . '/Common.php';
+
+use OSS\OssClient;
+
+$bucketName = Common::getBucketName();
+$object = "example.jpg";
+$ossClient = Common::getOssClient();
+$download_file = "download.jpg";
+if (is_null($ossClient)) exit(1);
+
+//*******************************简单使用***************************************************************
+
+// 先把本地的example.jpg上传到指定$bucket, 命名为$object
+$ossClient->uploadFile($bucketName, $object, "example.jpg");
+
+// 图片缩放
+$options = array(
+    OssClient::OSS_FILE_DOWNLOAD => $download_file,
+    OssClient::OSS_PROCESS => "image/resize,m_fixed,h_100,w_100", );
+$ossClient->getObject($bucketName, $object, $options);
+printImage("imageResize",$download_file);
+
+// 图片裁剪
+$options = array(
+    OssClient::OSS_FILE_DOWNLOAD => $download_file,
+    OssClient::OSS_PROCESS => "image/crop,w_100,h_100,x_100,y_100,r_1", );
+$ossClient->getObject($bucketName, $object, $options);
+printImage("iamgeCrop", $download_file);
+
+// 图片旋转
+$options = array(
+    OssClient::OSS_FILE_DOWNLOAD => $download_file,
+    OssClient::OSS_PROCESS => "image/rotate,90", );
+$ossClient->getObject($bucketName, $object, $options);
+printImage("imageRotate", $download_file);
+
+// 图片锐化
+$options = array(
+    OssClient::OSS_FILE_DOWNLOAD => $download_file,
+    OssClient::OSS_PROCESS => "image/sharpen,100", );
+$ossClient->getObject($bucketName, $object, $options);
+printImage("imageSharpen", $download_file);
+
+// 图片水印
+$options = array(
+    OssClient::OSS_FILE_DOWNLOAD => $download_file,
+    OssClient::OSS_PROCESS => "image/watermark,text_SGVsbG8g5Zu-54mH5pyN5YqhIQ", );
+$ossClient->getObject($bucketName, $object, $options);
+printImage("imageWatermark", $download_file);
+
+// 图片格式转换
+$options = array(
+    OssClient::OSS_FILE_DOWNLOAD => $download_file,
+    OssClient::OSS_PROCESS => "image/format,png", );
+$ossClient->getObject($bucketName, $object, $options);
+printImage("imageFormat", $download_file);
+
+// 获取图片信息
+$options = array(
+    OssClient::OSS_FILE_DOWNLOAD => $download_file,
+    OssClient::OSS_PROCESS => "image/info", );
+$ossClient->getObject($bucketName, $object, $options);
+printImage("imageInfo", $download_file);
+
+
+/**
+ *  生成一个带签名的可用于浏览器直接打开的url, URL的有效期是3600秒
+ */
+ $timeout = 3600;
+$options = array(
+    OssClient::OSS_PROCESS => "image/resize,m_lfit,h_100,w_100",
+    );
+$signedUrl = $ossClient->signUrl($bucketName, $object, $timeout, "GET", $options);
+Common::println("rtmp url: \n" . $signedUrl);
+
+//最后删除上传的$object
+$ossClient->deleteObject($bucketName, $object);     
+
+function printImage($func, $imageFile)
+{
+    $array = getimagesize($imageFile);
+    Common::println("$func, image width: " . $array[0]);
+    Common::println("$func, image height: " . $array[1]);
+    Common::println("$func, image type: " . ($array[2] === 2 ? 'jpg' : 'png'));
+    Common::println("$func, image size: " . ceil(filesize($imageFile)));
+}

+ 125 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/LiveChannel.php

@@ -0,0 +1,125 @@
+<?php
+require_once __DIR__ . '/Common.php';
+
+use OSS\OssClient;
+use OSS\Model\LiveChannelConfig;
+
+$bucket = Common::getBucketName();
+$ossClient = Common::getOssClient();
+if (is_null($ossClient)) exit(1);
+
+//******************************* 简单使用 *******************************************************
+
+/**
+    创建一个直播频道
+    频道的名称是test_rtmp_live。直播生成的m3u8文件叫做test.m3u8,该索引文件包含3片ts文件,每片ts文件的时长为5秒(这只是一个建议值,具体的时长取决于关键帧)。
+ */
+$config = new LiveChannelConfig(array(
+            'description' => 'live channel test',
+            'type' => 'HLS',
+            'fragDuration' => 10,
+            'fragCount' => 5,
+            'playListName' => 'hello.m3u8'
+        ));
+$info = $ossClient->putBucketLiveChannel($bucket, 'test_rtmp_live', $config);
+Common::println("bucket $bucket liveChannel created:\n" . 
+"live channel name: ". $info->getName() . "\n" .
+"live channel description: ". $info->getDescription() . "\n" .
+"publishurls: ". $info->getPublishUrls()[0] . "\n" .
+"playurls: ". $info->getPlayUrls()[0] . "\n");
+
+/**
+    对创建好的频道,可以使用listBucketLiveChannels来进行列举已达到管理的目的。
+    prefix可以按照前缀过滤list出来的频道。
+    max_keys表示迭代器内部一次list出来的频道的最大数量,这个值最大不能超过1000,不填写的话默认为100。
+ */
+$list = $ossClient->listBucketLiveChannels($bucket);
+Common::println("bucket $bucket listLiveChannel:\n" . 
+"list live channel prefix: ". $list->getPrefix() . "\n" .
+"list live channel marker: ". $list->getMarker() . "\n" .
+"list live channel maxkey: ". $list->getMaxKeys() . "\n" .
+"list live channel IsTruncated: ". $list->getIsTruncated() . "\n" .
+"list live channel getNextMarker: ". $list->getNextMarker() . "\n");
+
+foreach($list->getChannelList()  as $list)
+{
+    Common::println("bucket $bucket listLiveChannel:\n" . 
+    "list live channel IsTruncated: ". $list->getName() . "\n" .
+    "list live channel Description: ". $list->getDescription() . "\n" .
+    "list live channel Status: ". $list->getStatus() . "\n" .
+    "list live channel getNextMarker: ". $list->getLastModified() . "\n");
+}
+/**
+    创建直播频道之后拿到推流用的play_url(rtmp推流的url,如果Bucket不是公共读写权限那么还需要带上签名,见下文示例)和推流用的publish_url(推流产生的m3u8文件的url)
+ */
+$play_url = $ossClient->signRtmpUrl($bucket, "test_rtmp_live", 3600, array('params' => array('playlistName' => 'playlist.m3u8')));
+Common::println("bucket $bucket rtmp url: \n" . $play_url);
+$play_url = $ossClient->signRtmpUrl($bucket, "test_rtmp_live", 3600);
+Common::println("bucket $bucket rtmp url: \n" . $play_url);
+
+/**
+   创建好直播频道,如果想把这个频道禁用掉(断掉正在推的流或者不再允许向一个地址推流),应该使用putLiveChannelStatus接口,将频道的status改成“Disabled”,如果要将一个禁用状态的频道启用,那么也是调用这个接口,将status改成“Enabled”
+ */
+$resp = $ossClient->putLiveChannelStatus($bucket, "test_rtmp_live", "enabled");
+
+/**
+    创建好直播频道之后调用getLiveChannelInfo可以得到频道相关的信息
+ */
+$info = $ossClient->getLiveChannelInfo($bucket, 'test_rtmp_live');
+Common::println("bucket $bucket LiveChannelInfo:\n" . 
+"live channel info description: ". $info->getDescription() . "\n" .
+"live channel info status: ". $info->getStatus() . "\n" .
+"live channel info type: ". $info->getType() . "\n" .
+"live channel info fragDuration: ". $info->getFragDuration() . "\n" .
+"live channel info fragCount: ". $info->getFragCount() . "\n" .
+"live channel info playListName: ". $info->getPlayListName() . "\n");
+
+/**
+    如果想查看一个频道历史推流记录,可以调用getLiveChannelHistory。目前最多可以看到10次推流的记录
+ */
+$history = $ossClient->getLiveChannelHistory($bucket, "test_rtmp_live");
+if (count($history->getLiveRecordList()) != 0)
+{
+    foreach($history->getLiveRecordList() as $recordList)
+    {
+        Common::println("bucket $bucket liveChannelHistory:\n" . 
+        "live channel history startTime: ". $recordList->getStartTime() . "\n" .
+        "live channel history endTime: ". $recordList->getEndTime() . "\n" .
+        "live channel history remoteAddr: ". $recordList->getRemoteAddr() . "\n");
+    }
+}
+
+/**
+    对于正在推流的频道调用get_live_channel_stat可以获得流的状态信息。
+    如果频道正在推流,那么stat_result中的所有字段都有意义。
+    如果频道闲置或者处于“Disabled”状态,那么status为“Idle”或“Disabled”,其他字段无意义。
+ */
+$status = $ossClient->getLiveChannelStatus($bucket, "test_rtmp_live");
+Common::println("bucket $bucket listLiveChannel:\n" . 
+"live channel status status: ". $status->getStatus() . "\n" .
+"live channel status ConnectedTime: ". $status->getConnectedTime() . "\n" .
+"live channel status VideoWidth: ". $status->getVideoWidth() . "\n" .
+"live channel status VideoHeight: ". $status->getVideoHeight() . "\n" .
+"live channel status VideoFrameRate: ". $status->getVideoFrameRate() . "\n" .
+"live channel status VideoBandwidth: ". $status->getVideoBandwidth() . "\n" .
+"live channel status VideoCodec: ". $status->getVideoCodec() . "\n" .
+"live channel status AudioBandwidth: ". $status->getAudioBandwidth() . "\n" .
+"live channel status AudioSampleRate: ". $status->getAudioSampleRate() . "\n" .
+"live channel status AdioCodec: ". $status->getAudioCodec() . "\n");
+
+/**
+ *  如果希望利用直播推流产生的ts文件生成一个点播列表,可以使用postVodPlaylist方法。
+ *  指定起始时间为当前时间减去60秒,结束时间为当前时间,这意味着将生成一个长度为60秒的点播视频。
+ *  播放列表指定为“vod_playlist.m3u8”,也就是说这个接口调用成功之后会在OSS上生成一个名叫“vod_playlist.m3u8”的播放列表文件。
+ */
+$current_time = time();
+$ossClient->postVodPlaylist($bucket,
+    "test_rtmp_live", "vod_playlist.m3u8", 
+    array('StartTime' => $current_time - 60, 
+          'EndTime' => $current_time)
+);
+
+/**
+ *  如果一个直播频道已经不打算再使用了,那么可以调用delete_live_channel来删除频道。
+ */
+$ossClient->deleteBucketLiveChannel($bucket, "test_rtmp_live");

+ 182 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/MultipartUpload.php

@@ -0,0 +1,182 @@
+<?php
+require_once __DIR__ . '/Common.php';
+
+use OSS\OssClient;
+use OSS\Core\OssUtil;
+use OSS\Core\OssException;
+
+$bucket = Common::getBucketName();
+$ossClient = Common::getOssClient();
+if (is_null($ossClient)) exit(1);
+
+//*******************************简单使用***************************************************************
+
+/**
+ * 查看完整用法中的 "putObjectByRawApis"函数,查看使用基础的分片上传api进行文件上传,用户可以基于这个自行实现断点续传等功能
+ */
+
+// 使用分片上传接口上传文件, 接口会根据文件大小决定是使用普通上传还是分片上传
+$ossClient->multiuploadFile($bucket, "file.php", __FILE__, array());
+Common::println("local file " . __FILE__ . " is uploaded to the bucket $bucket, file.php");
+
+
+// 上传本地目录到bucket内的targetdir子目录中
+$ossClient->uploadDir($bucket, "targetdir", __DIR__);
+Common::println("local dir " . __DIR__ . " is uploaded to the bucket $bucket, targetdir/");
+
+
+// 列出当前未完成的分片上传
+$listMultipartUploadInfo = $ossClient->listMultipartUploads($bucket, array());
+
+
+//******************************* 完整用法参考下面函数 ****************************************************
+
+multiuploadFile($ossClient, $bucket);
+putObjectByRawApis($ossClient, $bucket);
+uploadDir($ossClient, $bucket);
+listMultipartUploads($ossClient, $bucket);
+
+/**
+ * 通过multipart上传文件
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function multiuploadFile($ossClient, $bucket)
+{
+    $object = "test/multipart-test.txt";
+    $file = __FILE__;
+    $options = array();
+
+    try {
+        $ossClient->multiuploadFile($bucket, $object, $file, $options);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ":  OK" . "\n");
+}
+
+/**
+ * 使用基本的api分阶段进行分片上传
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @throws OssException
+ */
+function putObjectByRawApis($ossClient, $bucket)
+{
+    $object = "test/multipart-test.txt";
+    /**
+     *  step 1. 初始化一个分块上传事件, 也就是初始化上传Multipart, 获取upload id
+     */
+    try {
+        $uploadId = $ossClient->initiateMultipartUpload($bucket, $object);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": initiateMultipartUpload FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": initiateMultipartUpload OK" . "\n");
+    /*
+     * step 2. 上传分片
+     */
+    $partSize = 10 * 1024 * 1024;
+    $uploadFile = __FILE__;
+    $uploadFileSize = filesize($uploadFile);
+    $pieces = $ossClient->generateMultiuploadParts($uploadFileSize, $partSize);
+    $responseUploadPart = array();
+    $uploadPosition = 0;
+    $isCheckMd5 = true;
+    foreach ($pieces as $i => $piece) {
+        $fromPos = $uploadPosition + (integer)$piece[$ossClient::OSS_SEEK_TO];
+        $toPos = (integer)$piece[$ossClient::OSS_LENGTH] + $fromPos - 1;
+        $upOptions = array(
+            $ossClient::OSS_FILE_UPLOAD => $uploadFile,
+            $ossClient::OSS_PART_NUM => ($i + 1),
+            $ossClient::OSS_SEEK_TO => $fromPos,
+            $ossClient::OSS_LENGTH => $toPos - $fromPos + 1,
+            $ossClient::OSS_CHECK_MD5 => $isCheckMd5,
+        );
+        if ($isCheckMd5) {
+            $contentMd5 = OssUtil::getMd5SumForFile($uploadFile, $fromPos, $toPos);
+            $upOptions[$ossClient::OSS_CONTENT_MD5] = $contentMd5;
+        }
+        //2. 将每一分片上传到OSS
+        try {
+            $responseUploadPart[] = $ossClient->uploadPart($bucket, $object, $uploadId, $upOptions);
+        } catch (OssException $e) {
+            printf(__FUNCTION__ . ": initiateMultipartUpload, uploadPart - part#{$i} FAILED\n");
+            printf($e->getMessage() . "\n");
+            return;
+        }
+        printf(__FUNCTION__ . ": initiateMultipartUpload, uploadPart - part#{$i} OK\n");
+    }
+    $uploadParts = array();
+    foreach ($responseUploadPart as $i => $eTag) {
+        $uploadParts[] = array(
+            'PartNumber' => ($i + 1),
+            'ETag' => $eTag,
+        );
+    }
+    /**
+     * step 3. 完成上传
+     */
+    try {
+        $ossClient->completeMultipartUpload($bucket, $object, $uploadId, $uploadParts);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": completeMultipartUpload FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    printf(__FUNCTION__ . ": completeMultipartUpload OK\n");
+}
+
+/**
+ * 按照目录上传文件
+ *
+ * @param OssClient $ossClient OssClient
+ * @param string $bucket 存储空间名称
+ *
+ */
+function uploadDir($ossClient, $bucket)
+{
+    $localDirectory = ".";
+    $prefix = "samples/codes";
+    try {
+        $ossClient->uploadDir($bucket, $prefix, $localDirectory);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    printf(__FUNCTION__ . ": completeMultipartUpload OK\n");
+}
+
+/**
+ * 获取当前未完成的分片上传列表
+ *
+ * @param $ossClient OssClient
+ * @param $bucket   string
+ */
+function listMultipartUploads($ossClient, $bucket)
+{
+    $options = array(
+        'max-uploads' => 100,
+        'key-marker' => '',
+        'prefix' => '',
+        'upload-id-marker' => ''
+    );
+    try {
+        $listMultipartUploadInfo = $ossClient->listMultipartUploads($bucket, $options);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": listMultipartUploads FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    printf(__FUNCTION__ . ": listMultipartUploads OK\n");
+    $listUploadInfo = $listMultipartUploadInfo->getUploads();
+    var_dump($listUploadInfo);
+}

+ 517 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/Object.php

@@ -0,0 +1,517 @@
+<?php
+require_once __DIR__ . '/Common.php';
+
+use OSS\OssClient;
+use OSS\Core\OssException;
+
+$bucket = Common::getBucketName();
+$ossClient = Common::getOssClient();
+if (is_null($ossClient)) exit(1);
+//*******************************简单使用***************************************************************
+
+// 简单上传变量的内容到oss文件
+$result = $ossClient->putObject($bucket, "b.file", "hi, oss");
+Common::println("b.file is created");
+Common::println($result['x-oss-request-id']);
+Common::println($result['etag']);
+Common::println($result['content-md5']);
+Common::println($result['body']);
+
+// 上传本地文件
+$result = $ossClient->uploadFile($bucket, "c.file", __FILE__);
+Common::println("c.file is created");
+Common::println("b.file is created");
+Common::println($result['x-oss-request-id']);
+Common::println($result['etag']);
+Common::println($result['content-md5']);
+Common::println($result['body']);
+
+// 下载object到本地变量
+$content = $ossClient->getObject($bucket, "b.file");
+Common::println("b.file is fetched, the content is: " . $content);
+
+// 给object添加symlink
+$content = $ossClient->putSymlink($bucket, "test-symlink", "b.file");
+Common::println("test-symlink is created");
+Common::println($result['x-oss-request-id']);
+Common::println($result['etag']);
+
+// 获取symlink
+$content = $ossClient->getSymlink($bucket, "test-symlink");
+Common::println("test-symlink refer to : " . $content[OssClient::OSS_SYMLINK_TARGET]);
+
+// 下载object到本地文件
+$options = array(
+    OssClient::OSS_FILE_DOWNLOAD => "./c.file.localcopy",
+);
+$ossClient->getObject($bucket, "c.file", $options);
+Common::println("b.file is fetched to the local file: c.file.localcopy");
+Common::println("b.file is created");
+
+// 拷贝object
+$result = $ossClient->copyObject($bucket, "c.file", $bucket, "c.file.copy");
+Common::println("lastModifiedTime: " . $result[0]);
+Common::println("ETag: " . $result[1]);
+
+// 判断object是否存在
+$doesExist = $ossClient->doesObjectExist($bucket, "c.file.copy");
+Common::println("file c.file.copy exist? " . ($doesExist ? "yes" : "no"));
+
+// 删除object
+$result = $ossClient->deleteObject($bucket, "c.file.copy");
+Common::println("c.file.copy is deleted");
+Common::println("b.file is created");
+Common::println($result['x-oss-request-id']);
+
+// 判断object是否存在
+$doesExist = $ossClient->doesObjectExist($bucket, "c.file.copy");
+Common::println("file c.file.copy exist? " . ($doesExist ? "yes" : "no"));
+
+// 批量删除object
+$result = $ossClient->deleteObjects($bucket, array("b.file", "c.file"));
+foreach($result as $object)
+    Common::println($object);
+
+sleep(2);
+unlink("c.file.localcopy");
+
+//******************************* 完整用法参考下面函数 ****************************************************
+
+listObjects($ossClient, $bucket);
+listAllObjects($ossClient, $bucket);
+createObjectDir($ossClient, $bucket);
+putObject($ossClient, $bucket);
+uploadFile($ossClient, $bucket);
+getObject($ossClient, $bucket);
+getObjectToLocalFile($ossClient, $bucket);
+copyObject($ossClient, $bucket);
+modifyMetaForObject($ossClient, $bucket);
+getObjectMeta($ossClient, $bucket);
+deleteObject($ossClient, $bucket);
+deleteObjects($ossClient, $bucket);
+doesObjectExist($ossClient, $bucket);
+getSymlink($ossClient, $bucket);
+putSymlink($ossClient, $bucket);
+/**
+ * 创建虚拟目录
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function createObjectDir($ossClient, $bucket)
+{
+    try {
+        $ossClient->createObjectDir($bucket, "dir");
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+/**
+ * 把本地变量的内容到文件
+ *
+ * 简单上传,上传指定变量的内存值作为object的内容
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function putObject($ossClient, $bucket)
+{
+    $object = "oss-php-sdk-test/upload-test-object-name.txt";
+    $content = file_get_contents(__FILE__);
+    $options = array();
+    try {
+        $ossClient->putObject($bucket, $object, $content, $options);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+
+/**
+ * 上传指定的本地文件内容
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function uploadFile($ossClient, $bucket)
+{
+    $object = "oss-php-sdk-test/upload-test-object-name.txt";
+    $filePath = __FILE__;
+    $options = array();
+
+    try {
+        $ossClient->uploadFile($bucket, $object, $filePath, $options);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+/**
+ * 列出Bucket内所有目录和文件, 注意如果符合条件的文件数目超过设置的max-keys, 用户需要使用返回的nextMarker作为入参,通过
+ * 循环调用ListObjects得到所有的文件,具体操作见下面的 listAllObjects 示例
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function listObjects($ossClient, $bucket)
+{
+    $prefix = 'oss-php-sdk-test/';
+    $delimiter = '/';
+    $nextMarker = '';
+    $maxkeys = 1000;
+    $options = array(
+        'delimiter' => $delimiter,
+        'prefix' => $prefix,
+        'max-keys' => $maxkeys,
+        'marker' => $nextMarker,
+    );
+    try {
+        $listObjectInfo = $ossClient->listObjects($bucket, $options);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    $objectList = $listObjectInfo->getObjectList(); // 文件列表
+    $prefixList = $listObjectInfo->getPrefixList(); // 目录列表
+    if (!empty($objectList)) {
+        print("objectList:\n");
+        foreach ($objectList as $objectInfo) {
+            print($objectInfo->getKey() . "\n");
+        }
+    }
+    if (!empty($prefixList)) {
+        print("prefixList: \n");
+        foreach ($prefixList as $prefixInfo) {
+            print($prefixInfo->getPrefix() . "\n");
+        }
+    }
+}
+
+/**
+ * 列出Bucket内所有目录和文件, 根据返回的nextMarker循环得到所有Objects
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function listAllObjects($ossClient, $bucket)
+{
+    //构造dir下的文件和虚拟目录
+    for ($i = 0; $i < 100; $i += 1) {
+        $ossClient->putObject($bucket, "dir/obj" . strval($i), "hi");
+        $ossClient->createObjectDir($bucket, "dir/obj" . strval($i));
+    }
+
+    $prefix = 'dir/';
+    $delimiter = '/';
+    $nextMarker = '';
+    $maxkeys = 30;
+
+    while (true) {
+        $options = array(
+            'delimiter' => $delimiter,
+            'prefix' => $prefix,
+            'max-keys' => $maxkeys,
+            'marker' => $nextMarker,
+        );
+        var_dump($options);
+        try {
+            $listObjectInfo = $ossClient->listObjects($bucket, $options);
+        } catch (OssException $e) {
+            printf(__FUNCTION__ . ": FAILED\n");
+            printf($e->getMessage() . "\n");
+            return;
+        }
+        // 得到nextMarker,从上一次listObjects读到的最后一个文件的下一个文件开始继续获取文件列表
+        $nextMarker = $listObjectInfo->getNextMarker();
+        $listObject = $listObjectInfo->getObjectList();
+        $listPrefix = $listObjectInfo->getPrefixList();
+        var_dump(count($listObject));
+        var_dump(count($listPrefix));
+        if ($nextMarker === '') {
+            break;
+        }
+    }
+}
+
+/**
+ * 获取object的内容
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function getObject($ossClient, $bucket)
+{
+    $object = "oss-php-sdk-test/upload-test-object-name.txt";
+    $options = array();
+    try {
+        $content = $ossClient->getObject($bucket, $object, $options);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    if (file_get_contents(__FILE__) === $content) {
+        print(__FUNCTION__ . ": FileContent checked OK" . "\n");
+    } else {
+        print(__FUNCTION__ . ": FileContent checked FAILED" . "\n");
+    }
+}
+
+/**
+ * put symlink
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function putSymlink($ossClient, $bucket)
+{
+    $symlink = "test-samples-symlink";
+    $object = "test-samples-object";
+    try {
+        $ossClient->putObject($bucket, $object, 'test-content');
+        $ossClient->putSymlink($bucket, $symlink, $object);
+        $content = $ossClient->getObject($bucket, $symlink);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    if ($content == 'test-content') {
+        print(__FUNCTION__ . ": putSymlink checked OK" . "\n");
+    } else {
+        print(__FUNCTION__ . ": putSymlink checked FAILED" . "\n");
+    }
+}
+
+/**
+ * 获取symlink
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function getSymlink($ossClient, $bucket)
+{
+    $symlink = "test-samples-symlink";
+    $object = "test-samples-object";
+    try {
+        $ossClient->putObject($bucket, $object, 'test-content');
+        $ossClient->putSymlink($bucket, $symlink, $object);
+        $content = $ossClient->getSymlink($bucket, $symlink);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    if ($content[OssClient::OSS_SYMLINK_TARGET]) {
+        print(__FUNCTION__ . ": getSymlink checked OK" . "\n");
+    } else {
+        print(__FUNCTION__ . ": getSymlink checked FAILED" . "\n");
+    }
+}
+
+/**
+ * get_object_to_local_file
+ *
+ * 获取object
+ * 将object下载到指定的文件
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function getObjectToLocalFile($ossClient, $bucket)
+{
+    $object = "oss-php-sdk-test/upload-test-object-name.txt";
+    $localfile = "upload-test-object-name.txt";
+    $options = array(
+        OssClient::OSS_FILE_DOWNLOAD => $localfile,
+    );
+
+    try {
+        $ossClient->getObject($bucket, $object, $options);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK, please check localfile: 'upload-test-object-name.txt'" . "\n");
+    if (file_get_contents($localfile) === file_get_contents(__FILE__)) {
+        print(__FUNCTION__ . ": FileContent checked OK" . "\n");
+    } else {
+        print(__FUNCTION__ . ": FileContent checked FAILED" . "\n");
+    }
+    if (file_exists($localfile)) {
+        unlink($localfile);
+    }
+}
+
+/**
+ * 拷贝object
+ * 当目的object和源object完全相同时,表示修改object的meta信息
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function copyObject($ossClient, $bucket)
+{
+    $fromBucket = $bucket;
+    $fromObject = "oss-php-sdk-test/upload-test-object-name.txt";
+    $toBucket = $bucket;
+    $toObject = $fromObject . '.copy';
+    $options = array();
+
+    try {
+        $ossClient->copyObject($fromBucket, $fromObject, $toBucket, $toObject, $options);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+/**
+ * 修改Object Meta
+ * 利用copyObject接口的特性:当目的object和源object完全相同时,表示修改object的meta信息
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function modifyMetaForObject($ossClient, $bucket)
+{
+    $fromBucket = $bucket;
+    $fromObject = "oss-php-sdk-test/upload-test-object-name.txt";
+    $toBucket = $bucket;
+    $toObject = $fromObject;
+    $copyOptions = array(
+        OssClient::OSS_HEADERS => array(
+            'Cache-Control' => 'max-age=60',
+            'Content-Disposition' => 'attachment; filename="xxxxxx"',
+        ),
+    );
+    try {
+        $ossClient->copyObject($fromBucket, $fromObject, $toBucket, $toObject, $copyOptions);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+/**
+ * 获取object meta, 也就是getObjectMeta接口
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function getObjectMeta($ossClient, $bucket)
+{
+    $object = "oss-php-sdk-test/upload-test-object-name.txt";
+    try {
+        $objectMeta = $ossClient->getObjectMeta($bucket, $object);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    if (isset($objectMeta[strtolower('Content-Disposition')]) &&
+        'attachment; filename="xxxxxx"' === $objectMeta[strtolower('Content-Disposition')]
+    ) {
+        print(__FUNCTION__ . ": ObjectMeta checked OK" . "\n");
+    } else {
+        print(__FUNCTION__ . ": ObjectMeta checked FAILED" . "\n");
+    }
+}
+
+/**
+ * 删除object
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function deleteObject($ossClient, $bucket)
+{
+    $object = "oss-php-sdk-test/upload-test-object-name.txt";
+    try {
+        $ossClient->deleteObject($bucket, $object);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+
+/**
+ * 批量删除object
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function deleteObjects($ossClient, $bucket)
+{
+    $objects = array();
+    $objects[] = "oss-php-sdk-test/upload-test-object-name.txt";
+    $objects[] = "oss-php-sdk-test/upload-test-object-name.txt.copy";
+    try {
+        $ossClient->deleteObjects($bucket, $objects);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+}
+
+/**
+ * 判断object是否存在
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ */
+function doesObjectExist($ossClient, $bucket)
+{
+    $object = "oss-php-sdk-test/upload-test-object-name.txt";
+    try {
+        $exist = $ossClient->doesObjectExist($bucket, $object);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": OK" . "\n");
+    var_dump($exist);
+}
+

+ 13 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/RunAll.php

@@ -0,0 +1,13 @@
+<?php
+
+error_reporting(E_ALL | E_NOTICE);
+
+require_once __DIR__ . '/Bucket.php';
+require_once __DIR__ . '/BucketCors.php';
+require_once __DIR__ . '/BucketLifecycle.php';
+require_once __DIR__ . '/BucketReferer.php';
+require_once __DIR__ . '/BucketLogging.php';
+require_once __DIR__ . '/BucketWebsite.php';
+require_once __DIR__ . '/Signature.php';
+require_once __DIR__ . '/Object.php';
+require_once __DIR__ . '/MultipartUpload.php';

+ 143 - 0
data/api/aliyun-oss-php-sdk-2.3.0/samples/Signature.php

@@ -0,0 +1,143 @@
+<?php
+require_once __DIR__ . '/Common.php';
+
+use OSS\Http\RequestCore;
+use OSS\Http\ResponseCore;
+use OSS\OssClient;
+use OSS\Core\OssException;
+
+$bucket = Common::getBucketName();
+$ossClient = Common::getOssClient();
+if (is_null($ossClient)) exit(1);
+
+//******************************* 简单使用 ***************************************************************
+
+$ossClient->uploadFile($bucket, "a.file", __FILE__);
+
+// 生成GetObject的签名url,用户可以使用这个url直接在浏览器下载
+$signedUrl = $ossClient->signUrl($bucket, "a.file", 3600);
+Common::println($signedUrl);
+
+// 生成用于putObject的签名URL,用户可以直接用put方法使用这个url上传文件到 "a.file"
+$signedUrl = $ossClient->signUrl($bucket, "a.file", "3600", "PUT");
+Common::println($signedUrl);
+
+// 生成从本地文件上传PutObject的签名url, 用户可以直接使用这个url把本地文件上传到 "a.file"
+$signedUrl = $ossClient->signUrl($bucket, "a.file", 3600, "PUT", array('Content-Type' => 'txt'));
+Common::println($signedUrl);
+
+//******************************* 完整用法参考下面函数 ****************************************************
+
+getSignedUrlForPuttingObject($ossClient, $bucket);
+getSignedUrlForPuttingObjectFromFile($ossClient, $bucket);
+getSignedUrlForGettingObject($ossClient, $bucket);
+
+/**
+ * 生成GetObject的签名url,主要用于私有权限下的读访问控制
+ *
+ * @param $ossClient OssClient OssClient实例
+ * @param $bucket string 存储空间名称
+ * @return null
+ */
+function getSignedUrlForGettingObject($ossClient, $bucket)
+{
+    $object = "test/test-signature-test-upload-and-download.txt";
+    $timeout = 3600;
+    try {
+        $signedUrl = $ossClient->signUrl($bucket, $object, $timeout);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": signedUrl: " . $signedUrl . "\n");
+    /**
+     * 可以类似的代码来访问签名的URL,也可以输入到浏览器中去访问
+     */
+    $request = new RequestCore($signedUrl);
+    $request->set_method('GET');
+    $request->add_header('Content-Type', '');
+    $request->send_request();
+    $res = new ResponseCore($request->get_response_header(), $request->get_response_body(), $request->get_response_code());
+    if ($res->isOK()) {
+        print(__FUNCTION__ . ": OK" . "\n");
+    } else {
+        print(__FUNCTION__ . ": FAILED" . "\n");
+    };
+}
+
+/**
+ * 生成PutObject的签名url,主要用于私有权限下的写访问控制
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @return null
+ * @throws OssException
+ */
+function getSignedUrlForPuttingObject($ossClient, $bucket)
+{
+    $object = "test/test-signature-test-upload-and-download.txt";
+    $timeout = 3600;
+    $options = NULL;
+    try {
+        $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "PUT");
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": signedUrl: " . $signedUrl . "\n");
+    $content = file_get_contents(__FILE__);
+
+    $request = new RequestCore($signedUrl);
+    $request->set_method('PUT');
+    $request->add_header('Content-Type', '');
+    $request->add_header('Content-Length', strlen($content));
+    $request->set_body($content);
+    $request->send_request();
+    $res = new ResponseCore($request->get_response_header(),
+        $request->get_response_body(), $request->get_response_code());
+    if ($res->isOK()) {
+        print(__FUNCTION__ . ": OK" . "\n");
+    } else {
+        print(__FUNCTION__ . ": FAILED" . "\n");
+    };
+}
+
+/**
+ * 生成PutObject的签名url,主要用于私有权限下的写访问控制, 用户可以利用生成的signedUrl
+ * 从文件上传文件
+ *
+ * @param OssClient $ossClient OssClient实例
+ * @param string $bucket 存储空间名称
+ * @throws OssException
+ */
+function getSignedUrlForPuttingObjectFromFile($ossClient, $bucket)
+{
+    $file = __FILE__;
+    $object = "test/test-signature-test-upload-and-download.txt";
+    $timeout = 3600;
+    $options = array('Content-Type' => 'txt');
+    try {
+        $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "PUT", $options);
+    } catch (OssException $e) {
+        printf(__FUNCTION__ . ": FAILED\n");
+        printf($e->getMessage() . "\n");
+        return;
+    }
+    print(__FUNCTION__ . ": signedUrl: " . $signedUrl . "\n");
+
+    $request = new RequestCore($signedUrl);
+    $request->set_method('PUT');
+    $request->add_header('Content-Type', 'txt');
+    $request->set_read_file($file);
+    $request->set_read_stream_size(filesize($file));
+    $request->send_request();
+    $res = new ResponseCore($request->get_response_header(),
+        $request->get_response_body(), $request->get_response_code());
+    if ($res->isOK()) {
+        print(__FUNCTION__ . ": OK" . "\n");
+    } else {
+        print(__FUNCTION__ . ": FAILED" . "\n");
+    };
+}

+ 262 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Core/MimeTypes.php

@@ -0,0 +1,262 @@
+<?php
+
+namespace OSS\Core;
+
+/**
+ * Class MimeTypes
+ *
+ * 在上传文件的时候,根据文件的缺省名,得到其对应的Content-type
+ *
+ * @package OSS\Core
+ */
+class MimeTypes
+{
+    /**
+     * 根据文件名,获取http协议header中的content-type应该填写的数据
+     *
+     * @param string $name 缺省名
+     * @return string content-type
+     */
+    public static function getMimetype($name)
+    {
+        $parts = explode('.', $name);
+        if (count($parts) > 1) {
+            $ext = strtolower(end($parts));
+            if (isset(self::$mime_types[$ext])) {
+                return self::$mime_types[$ext];
+            }
+        }
+
+        return null;
+    }
+
+    private static $mime_types = array(
+        'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+        'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
+        'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
+        'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
+        'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+        'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
+        'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+        'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
+        'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
+        'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
+        'apk' => 'application/vnd.android.package-archive',
+        'hqx' => 'application/mac-binhex40',
+        'cpt' => 'application/mac-compactpro',
+        'doc' => 'application/msword',
+        'ogg' => 'audio/ogg',
+        'pdf' => 'application/pdf',
+        'rtf' => 'text/rtf',
+        'mif' => 'application/vnd.mif',
+        'xls' => 'application/vnd.ms-excel',
+        'ppt' => 'application/vnd.ms-powerpoint',
+        'odc' => 'application/vnd.oasis.opendocument.chart',
+        'odb' => 'application/vnd.oasis.opendocument.database',
+        'odf' => 'application/vnd.oasis.opendocument.formula',
+        'odg' => 'application/vnd.oasis.opendocument.graphics',
+        'otg' => 'application/vnd.oasis.opendocument.graphics-template',
+        'odi' => 'application/vnd.oasis.opendocument.image',
+        'odp' => 'application/vnd.oasis.opendocument.presentation',
+        'otp' => 'application/vnd.oasis.opendocument.presentation-template',
+        'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+        'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
+        'odt' => 'application/vnd.oasis.opendocument.text',
+        'odm' => 'application/vnd.oasis.opendocument.text-master',
+        'ott' => 'application/vnd.oasis.opendocument.text-template',
+        'oth' => 'application/vnd.oasis.opendocument.text-web',
+        'sxw' => 'application/vnd.sun.xml.writer',
+        'stw' => 'application/vnd.sun.xml.writer.template',
+        'sxc' => 'application/vnd.sun.xml.calc',
+        'stc' => 'application/vnd.sun.xml.calc.template',
+        'sxd' => 'application/vnd.sun.xml.draw',
+        'std' => 'application/vnd.sun.xml.draw.template',
+        'sxi' => 'application/vnd.sun.xml.impress',
+        'sti' => 'application/vnd.sun.xml.impress.template',
+        'sxg' => 'application/vnd.sun.xml.writer.global',
+        'sxm' => 'application/vnd.sun.xml.math',
+        'sis' => 'application/vnd.symbian.install',
+        'wbxml' => 'application/vnd.wap.wbxml',
+        'wmlc' => 'application/vnd.wap.wmlc',
+        'wmlsc' => 'application/vnd.wap.wmlscriptc',
+        'bcpio' => 'application/x-bcpio',
+        'torrent' => 'application/x-bittorrent',
+        'bz2' => 'application/x-bzip2',
+        'vcd' => 'application/x-cdlink',
+        'pgn' => 'application/x-chess-pgn',
+        'cpio' => 'application/x-cpio',
+        'csh' => 'application/x-csh',
+        'dvi' => 'application/x-dvi',
+        'spl' => 'application/x-futuresplash',
+        'gtar' => 'application/x-gtar',
+        'hdf' => 'application/x-hdf',
+        'jar' => 'application/java-archive',
+        'jnlp' => 'application/x-java-jnlp-file',
+        'js' => 'application/javascript',
+        'json' => 'application/json',
+        'ksp' => 'application/x-kspread',
+        'chrt' => 'application/x-kchart',
+        'kil' => 'application/x-killustrator',
+        'latex' => 'application/x-latex',
+        'rpm' => 'application/x-rpm',
+        'sh' => 'application/x-sh',
+        'shar' => 'application/x-shar',
+        'swf' => 'application/x-shockwave-flash',
+        'sit' => 'application/x-stuffit',
+        'sv4cpio' => 'application/x-sv4cpio',
+        'sv4crc' => 'application/x-sv4crc',
+        'tar' => 'application/x-tar',
+        'tcl' => 'application/x-tcl',
+        'tex' => 'application/x-tex',
+        'man' => 'application/x-troff-man',
+        'me' => 'application/x-troff-me',
+        'ms' => 'application/x-troff-ms',
+        'ustar' => 'application/x-ustar',
+        'src' => 'application/x-wais-source',
+        'zip' => 'application/zip',
+        'm3u' => 'audio/x-mpegurl',
+        'ra' => 'audio/x-pn-realaudio',
+        'wav' => 'audio/x-wav',
+        'wma' => 'audio/x-ms-wma',
+        'wax' => 'audio/x-ms-wax',
+        'pdb' => 'chemical/x-pdb',
+        'xyz' => 'chemical/x-xyz',
+        'bmp' => 'image/bmp',
+        'gif' => 'image/gif',
+        'ief' => 'image/ief',
+        'png' => 'image/png',
+        'wbmp' => 'image/vnd.wap.wbmp',
+        'ras' => 'image/x-cmu-raster',
+        'pnm' => 'image/x-portable-anymap',
+        'pbm' => 'image/x-portable-bitmap',
+        'pgm' => 'image/x-portable-graymap',
+        'ppm' => 'image/x-portable-pixmap',
+        'rgb' => 'image/x-rgb',
+        'xbm' => 'image/x-xbitmap',
+        'xpm' => 'image/x-xpixmap',
+        'xwd' => 'image/x-xwindowdump',
+        'css' => 'text/css',
+        'rtx' => 'text/richtext',
+        'tsv' => 'text/tab-separated-values',
+        'jad' => 'text/vnd.sun.j2me.app-descriptor',
+        'wml' => 'text/vnd.wap.wml',
+        'wmls' => 'text/vnd.wap.wmlscript',
+        'etx' => 'text/x-setext',
+        'mxu' => 'video/vnd.mpegurl',
+        'flv' => 'video/x-flv',
+        'wm' => 'video/x-ms-wm',
+        'wmv' => 'video/x-ms-wmv',
+        'wmx' => 'video/x-ms-wmx',
+        'wvx' => 'video/x-ms-wvx',
+        'avi' => 'video/x-msvideo',
+        'movie' => 'video/x-sgi-movie',
+        'ice' => 'x-conference/x-cooltalk',
+        '3gp' => 'video/3gpp',
+        'ai' => 'application/postscript',
+        'aif' => 'audio/x-aiff',
+        'aifc' => 'audio/x-aiff',
+        'aiff' => 'audio/x-aiff',
+        'asc' => 'text/plain',
+        'atom' => 'application/atom+xml',
+        'au' => 'audio/basic',
+        'bin' => 'application/octet-stream',
+        'cdf' => 'application/x-netcdf',
+        'cgm' => 'image/cgm',
+        'class' => 'application/octet-stream',
+        'dcr' => 'application/x-director',
+        'dif' => 'video/x-dv',
+        'dir' => 'application/x-director',
+        'djv' => 'image/vnd.djvu',
+        'djvu' => 'image/vnd.djvu',
+        'dll' => 'application/octet-stream',
+        'dmg' => 'application/octet-stream',
+        'dms' => 'application/octet-stream',
+        'dtd' => 'application/xml-dtd',
+        'dv' => 'video/x-dv',
+        'dxr' => 'application/x-director',
+        'eps' => 'application/postscript',
+        'exe' => 'application/octet-stream',
+        'ez' => 'application/andrew-inset',
+        'gram' => 'application/srgs',
+        'grxml' => 'application/srgs+xml',
+        'gz' => 'application/x-gzip',
+        'htm' => 'text/html',
+        'html' => 'text/html',
+        'ico' => 'image/x-icon',
+        'ics' => 'text/calendar',
+        'ifb' => 'text/calendar',
+        'iges' => 'model/iges',
+        'igs' => 'model/iges',
+        'jp2' => 'image/jp2',
+        'jpe' => 'image/jpeg',
+        'jpeg' => 'image/jpeg',
+        'jpg' => 'image/jpeg',
+        'kar' => 'audio/midi',
+        'lha' => 'application/octet-stream',
+        'lzh' => 'application/octet-stream',
+        'm4a' => 'audio/mp4a-latm',
+        'm4p' => 'audio/mp4a-latm',
+        'm4u' => 'video/vnd.mpegurl',
+        'm4v' => 'video/x-m4v',
+        'mac' => 'image/x-macpaint',
+        'mathml' => 'application/mathml+xml',
+        'mesh' => 'model/mesh',
+        'mid' => 'audio/midi',
+        'midi' => 'audio/midi',
+        'mov' => 'video/quicktime',
+        'mp2' => 'audio/mpeg',
+        'mp3' => 'audio/mpeg',
+        'mp4' => 'video/mp4',
+        'mpe' => 'video/mpeg',
+        'mpeg' => 'video/mpeg',
+        'mpg' => 'video/mpeg',
+        'mpga' => 'audio/mpeg',
+        'msh' => 'model/mesh',
+        'nc' => 'application/x-netcdf',
+        'oda' => 'application/oda',
+        'ogv' => 'video/ogv',
+        'pct' => 'image/pict',
+        'pic' => 'image/pict',
+        'pict' => 'image/pict',
+        'pnt' => 'image/x-macpaint',
+        'pntg' => 'image/x-macpaint',
+        'ps' => 'application/postscript',
+        'qt' => 'video/quicktime',
+        'qti' => 'image/x-quicktime',
+        'qtif' => 'image/x-quicktime',
+        'ram' => 'audio/x-pn-realaudio',
+        'rdf' => 'application/rdf+xml',
+        'rm' => 'application/vnd.rn-realmedia',
+        'roff' => 'application/x-troff',
+        'sgm' => 'text/sgml',
+        'sgml' => 'text/sgml',
+        'silo' => 'model/mesh',
+        'skd' => 'application/x-koan',
+        'skm' => 'application/x-koan',
+        'skp' => 'application/x-koan',
+        'skt' => 'application/x-koan',
+        'smi' => 'application/smil',
+        'smil' => 'application/smil',
+        'snd' => 'audio/basic',
+        'so' => 'application/octet-stream',
+        'svg' => 'image/svg+xml',
+        't' => 'application/x-troff',
+        'texi' => 'application/x-texinfo',
+        'texinfo' => 'application/x-texinfo',
+        'tif' => 'image/tiff',
+        'tiff' => 'image/tiff',
+        'tr' => 'application/x-troff',
+        'txt' => 'text/plain',
+        'vrml' => 'model/vrml',
+        'vxml' => 'application/voicexml+xml',
+        'webm' => 'video/webm',
+        'webp' => 'image/webp',
+        'wrl' => 'model/vrml',
+        'xht' => 'application/xhtml+xml',
+        'xhtml' => 'application/xhtml+xml',
+        'xml' => 'application/xml',
+        'xsl' => 'application/xml',
+        'xslt' => 'application/xslt+xml',
+        'xul' => 'application/vnd.mozilla.xul+xml',
+    );
+}

+ 54 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Core/OssException.php

@@ -0,0 +1,54 @@
+<?php
+
+namespace OSS\Core;
+
+/**
+ * Class OssException
+ *
+ * OssClient在使用的时候,所抛出的异常,用户在使用OssClient的时候,要Try住相关代码,
+ * try的Exception应该是OssException,其中会得到相关异常原因
+ *
+ * @package OSS\Core
+ */
+class OssException extends \Exception
+{
+    private $details = array();
+
+    function __construct($details)
+    {
+        if (is_array($details)) {
+            $message = $details['code'] . ': ' . $details['message']
+                     . ' RequestId: ' . $details['request-id'];
+            parent::__construct($message);
+            $this->details = $details;
+        } else {
+            $message = $details;
+            parent::__construct($message);
+        }
+    }
+
+    public function getHTTPStatus()
+    {
+        return isset($this->details['status']) ? $this->details['status'] : '';
+    }
+
+    public function getRequestId()
+    {
+        return isset($this->details['request-id']) ? $this->details['request-id'] : '';
+    }
+
+    public function getErrorCode()
+    {
+        return isset($this->details['code']) ? $this->details['code'] : '';
+    }
+
+    public function getErrorMessage()
+    {
+        return isset($this->details['message']) ? $this->details['message'] : '';
+    }
+
+    public function getDetails()
+    {
+        return isset($this->details['body']) ? $this->details['body'] : '';
+    }
+}

+ 461 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Core/OssUtil.php

@@ -0,0 +1,461 @@
+<?php
+
+namespace OSS\Core;
+
+/**
+ * Class OssUtil
+ *
+ * Oss工具类,主要供OssClient使用,用户也可以使用本类进行返回结果的格式化
+ *
+ * @package OSS
+ */
+class OssUtil
+{
+    const OSS_CONTENT = 'content';
+    const OSS_LENGTH = 'length';
+    const OSS_HEADERS = 'headers';
+    const OSS_MAX_OBJECT_GROUP_VALUE = 1000;
+    const OSS_MAX_PART_SIZE = 5368709120; // 5GB
+    const OSS_MID_PART_SIZE = 10485760; // 10MB
+    const OSS_MIN_PART_SIZE = 102400; // 100KB
+
+    /**
+     * 生成query params
+     *
+     * @param array $options 关联数组
+     * @return string 返回诸如 key1=value1&key2=value2
+     */
+    public static function toQueryString($options = array())
+    {
+        $temp = array();
+        uksort($options, 'strnatcasecmp');
+        foreach ($options as $key => $value) {
+            if (is_string($key) && !is_array($value)) {
+                $temp[] = rawurlencode($key) . '=' . rawurlencode($value);
+            }
+        }
+        return implode('&', $temp);
+    }
+
+    /**
+     * 转义字符替换
+     *
+     * @param string $subject
+     * @return string
+     */
+    public static function sReplace($subject)
+    {
+        $search = array('<', '>', '&', '\'', '"');
+        $replace = array('&lt;', '&gt;', '&amp;', '&apos;', '&quot;');
+        return str_replace($search, $replace, $subject);
+    }
+
+    /**
+     * 检查是否是中文编码
+     *
+     * @param $str
+     * @return int
+     */
+    public static function chkChinese($str)
+    {
+        return preg_match('/[\x80-\xff]./', $str);
+    }
+
+    /**
+     * 检测是否GB2312编码
+     *
+     * @param string $str
+     * @return boolean false UTF-8编码  TRUE GB2312编码
+     */
+    public static function isGb2312($str)
+    {
+        for ($i = 0; $i < strlen($str); $i++) {
+            $v = ord($str[$i]);
+            if ($v > 127) {
+                if (($v >= 228) && ($v <= 233)) {
+                    if (($i + 2) >= (strlen($str) - 1)) return true;  // not enough characters
+                    $v1 = ord($str[$i + 1]);
+                    $v2 = ord($str[$i + 2]);
+                    if (($v1 >= 128) && ($v1 <= 191) && ($v2 >= 128) && ($v2 <= 191))
+                        return false;
+                    else
+                        return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 检测是否GBK编码
+     *
+     * @param string $str
+     * @param boolean $gbk
+     * @return boolean
+     */
+    public static function checkChar($str, $gbk = true)
+    {
+        for ($i = 0; $i < strlen($str); $i++) {
+            $v = ord($str[$i]);
+            if ($v > 127) {
+                if (($v >= 228) && ($v <= 233)) {
+                    if (($i + 2) >= (strlen($str) - 1)) return $gbk ? true : FALSE;  // not enough characters
+                    $v1 = ord($str[$i + 1]);
+                    $v2 = ord($str[$i + 2]);
+                    if ($gbk) {
+                        return (($v1 >= 128) && ($v1 <= 191) && ($v2 >= 128) && ($v2 <= 191)) ? FALSE : TRUE;//GBK
+                    } else {
+                        return (($v1 >= 128) && ($v1 <= 191) && ($v2 >= 128) && ($v2 <= 191)) ? TRUE : FALSE;
+                    }
+                }
+            }
+        }
+        return $gbk ? TRUE : FALSE;
+    }
+
+    /**
+     * 检验bucket名称是否合法
+     * bucket的命名规范:
+     * 1. 只能包括小写字母,数字
+     * 2. 必须以小写字母或者数字开头
+     * 3. 长度必须在3-63字节之间
+     *
+     * @param string $bucket Bucket名称
+     * @return boolean
+     */
+    public static function validateBucket($bucket)
+    {
+        $pattern = '/^[a-z0-9][a-z0-9-]{2,62}$/';
+        if (!preg_match($pattern, $bucket)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * 检验object名称是否合法
+     * object命名规范:
+     * 1. 规则长度必须在1-1023字节之间
+     * 2. 使用UTF-8编码
+     * 3. 不能以 "/" "\\"开头
+     *
+     * @param string $object Object名称
+     * @return boolean
+     */
+    public static function validateObject($object)
+    {
+        $pattern = '/^.{1,1023}$/';
+        if (empty($object) || !preg_match($pattern, $object) ||
+            self::startsWith($object, '/') || self::startsWith($object, '\\')
+        ) {
+            return false;
+        }
+        return true;
+    }
+
+
+    /**
+     * 判断字符串$str是不是以$findMe开始
+     *
+     * @param string $str
+     * @param string $findMe
+     * @return bool
+     */
+    public static function startsWith($str, $findMe)
+    {
+        if (strpos($str, $findMe) === 0) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 生成createBucketXmlBody接口的xml消息
+     *
+     * @param string $storageClass
+     * @return string
+     */
+    public static function createBucketXmlBody($storageClass)
+    {
+        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><CreateBucketConfiguration></CreateBucketConfiguration>');
+        $xml->addChild('StorageClass',  $storageClass);
+        return $xml->asXML();
+    }
+
+    /**
+     * 检验$options
+     *
+     * @param array $options
+     * @throws OssException
+     * @return boolean
+     */
+    public static function validateOptions($options)
+    {
+        //$options
+        if ($options != NULL && !is_array($options)) {
+            throw new OssException ($options . ':' . 'option must be array');
+        }
+    }
+
+    /**
+     * 检查上传文件的内容是否合法
+     *
+     * @param $content string
+     * @throws OssException
+     */
+    public static function validateContent($content)
+    {
+        if (empty($content)) {
+            throw new OssException("http body content is invalid");
+        }
+    }
+
+    /**
+     * 校验BUCKET/OBJECT/OBJECT GROUP是否为空
+     *
+     * @param  string $name
+     * @param  string $errMsg
+     * @throws OssException
+     * @return void
+     */
+    public static function throwOssExceptionWithMessageIfEmpty($name, $errMsg)
+    {
+        if (empty($name)) {
+            throw new OssException($errMsg);
+        }
+    }
+
+    /**
+     * 仅供测试使用的接口,请勿使用
+     *
+     * @param $filename
+     * @param $size
+     */
+    public static function generateFile($filename, $size)
+    {
+        if (file_exists($filename) && $size == filesize($filename)) {
+            echo $filename . " already exists, no need to create again. ";
+            return;
+        }
+        $part_size = 1 * 1024 * 1024;
+        $fp = fopen($filename, "w");
+        $characters = <<<BBB
+0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+BBB;
+
+        $charactersLength = strlen($characters);
+        if ($fp) {
+            while ($size > 0) {
+                if ($size < $part_size) {
+                    $write_size = $size;
+                } else {
+                    $write_size = $part_size;
+                }
+                $size -= $write_size;
+                $a = $characters[rand(0, $charactersLength - 1)];
+                $content = str_repeat($a, $write_size);
+                $flag = fwrite($fp, $content);
+                if (!$flag) {
+                    echo "write to " . $filename . " failed. <br>";
+                    break;
+                }
+            }
+        } else {
+            echo "open " . $filename . " failed. <br>";
+        }
+        fclose($fp);
+    }
+
+    /**
+     * 得到文件的md5编码
+     *
+     * @param $filename
+     * @param $from_pos
+     * @param $to_pos
+     * @return string
+     */
+    public static function getMd5SumForFile($filename, $from_pos, $to_pos)
+    {
+        $content_md5 = "";
+        if (($to_pos - $from_pos) > self::OSS_MAX_PART_SIZE) {
+            return $content_md5;
+        }
+        $filesize = filesize($filename);
+        if ($from_pos >= $filesize || $to_pos >= $filesize || $from_pos < 0 || $to_pos < 0) {
+            return $content_md5;
+        }
+
+        $total_length = $to_pos - $from_pos + 1;
+        $buffer = 8192;
+        $left_length = $total_length;
+        if (!file_exists($filename)) {
+            return $content_md5;
+        }
+
+        if (false === $fh = fopen($filename, 'rb')) {
+            return $content_md5;
+        }
+
+        fseek($fh, $from_pos);
+        $data = '';
+        while (!feof($fh)) {
+            if ($left_length >= $buffer) {
+                $read_length = $buffer;
+            } else {
+                $read_length = $left_length;
+            }
+            if ($read_length <= 0) {
+                break;
+            } else {
+                $data .= fread($fh, $read_length);
+                $left_length = $left_length - $read_length;
+            }
+        }
+        fclose($fh);
+        $content_md5 = base64_encode(md5($data, true));
+        return $content_md5;
+    }
+
+    /**
+     * 检测是否windows系统,因为windows系统默认编码为GBK
+     *
+     * @return bool
+     */
+    public static function isWin()
+    {
+        return strtoupper(substr(PHP_OS, 0, 3)) == "WIN";
+    }
+
+    /**
+     * 主要是由于windows系统编码是gbk,遇到中文时候,如果不进行转换处理会出现找不到文件的问题
+     *
+     * @param $file_path
+     * @return string
+     */
+    public static function encodePath($file_path)
+    {
+        if (self::chkChinese($file_path) && self::isWin()) {
+            $file_path = iconv('utf-8', 'gbk', $file_path);
+        }
+        return $file_path;
+    }
+
+    /**
+     * 判断用户输入的endpoint是否是 xxx.xxx.xxx.xxx:port 或者 xxx.xxx.xxx.xxx的ip格式
+     *
+     * @param string $endpoint 需要做判断的endpoint
+     * @return boolean
+     */
+    public static function isIPFormat($endpoint)
+    {
+        $ip_array = explode(":", $endpoint);
+        $hostname = $ip_array[0];
+        $ret = filter_var($hostname, FILTER_VALIDATE_IP);
+        if (!$ret) {
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    /**
+     * 生成DeleteMultiObjects接口的xml消息
+     *
+     * @param string[] $objects
+     * @param bool $quiet
+     * @return string
+     */
+    public static function createDeleteObjectsXmlBody($objects, $quiet)
+    {
+        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><Delete></Delete>');
+        $xml->addChild('Quiet', $quiet);
+        foreach ($objects as $object) {
+            $sub_object = $xml->addChild('Object');
+            $object = OssUtil::sReplace($object);
+            $sub_object->addChild('Key', $object);
+        }
+        return $xml->asXML();
+    }
+
+    /**
+     * 生成CompleteMultipartUpload接口的xml消息
+     *
+     * @param array[] $listParts
+     * @return string
+     */
+    public static function createCompleteMultipartUploadXmlBody($listParts)
+    {
+        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><CompleteMultipartUpload></CompleteMultipartUpload>');
+        foreach ($listParts as $node) {
+            $part = $xml->addChild('Part');
+            $part->addChild('PartNumber', $node['PartNumber']);
+            $part->addChild('ETag', $node['ETag']);
+        }
+        return $xml->asXML();
+    }
+
+    /**
+     * 读取目录
+     *
+     * @param string $dir
+     * @param string $exclude
+     * @param bool $recursive
+     * @return string[]
+     */
+    public static function readDir($dir, $exclude = ".|..|.svn|.git", $recursive = false)
+    {
+        $file_list_array = array();
+        $base_path = $dir;
+        $exclude_array = explode("|", $exclude);
+        $exclude_array = array_unique(array_merge($exclude_array, array('.', '..')));
+
+        if ($recursive) {
+            foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir)) as $new_file) {
+                if ($new_file->isDir()) continue;
+                $object = str_replace($base_path, '', $new_file);
+                if (!in_array(strtolower($object), $exclude_array)) {
+                    $object = ltrim($object, '/');
+                    if (is_file($new_file)) {
+                        $key = md5($new_file . $object, false);
+                        $file_list_array[$key] = array('path' => $new_file, 'file' => $object,);
+                    }
+                }
+            }
+        } else if ($handle = opendir($dir)) {
+            while (false !== ($file = readdir($handle))) {
+                if (!in_array(strtolower($file), $exclude_array)) {
+                    $new_file = $dir . '/' . $file;
+                    $object = $file;
+                    $object = ltrim($object, '/');
+                    if (is_file($new_file)) {
+                        $key = md5($new_file . $object, false);
+                        $file_list_array[$key] = array('path' => $new_file, 'file' => $object,);
+                    }
+                }
+            }
+            closedir($handle);
+        }
+        return $file_list_array;
+    }
+
+    /**
+     * Decode key based on the encoding type
+     *
+     * @param string $key
+     * @param string $encoding
+     * @return string
+     */
+    public static function decodeKey($key, $encoding)
+    {
+        if ($encoding == "") {
+            return $key;
+        }
+
+        if ($encoding == "url") {
+            return rawurldecode($key);
+        } else {
+            throw new OssException("Unrecognized encoding type: " . $encoding);
+        }
+    }
+}

+ 25 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Http/LICENSE

@@ -0,0 +1,25 @@
+Copyright (c) 2006-2010 Ryan Parman, Foleeo Inc., and contributors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are
+permitted provided that the following conditions are met:
+
+	* Redistributions of source code must retain the above copyright notice, this list of
+	  conditions and the following disclaimer.
+
+	* Redistributions in binary form must reproduce the above copyright notice, this list
+	  of conditions and the following disclaimer in the documentation and/or other materials
+	  provided with the distribution.
+
+	* Neither the name of Ryan Parman, Foleeo Inc. nor the names of its contributors may be used to
+	  endorse or promote products derived from this software without specific prior written
+	  permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
+AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.

+ 896 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Http/RequestCore.php

@@ -0,0 +1,896 @@
+<?php
+namespace OSS\Http;
+
+
+/**
+ * Handles all HTTP requests using cURL and manages the responses.
+ *
+ * @version 2011.06.07
+ * @copyright 2006-2011 Ryan Parman
+ * @copyright 2006-2010 Foleeo Inc.
+ * @copyright 2010-2011 Amazon.com, Inc. or its affiliates.
+ * @copyright 2008-2011 Contributors
+ * @license http://opensource.org/licenses/bsd-license.php Simplified BSD License
+ */
+class RequestCore
+{
+    /**
+     * The URL being requested.
+     */
+    public $request_url;
+
+    /**
+     * The headers being sent in the request.
+     */
+    public $request_headers;
+   
+    /**
+     * The raw response callback headers
+     */
+    public $response_raw_headers;
+
+    /**
+     * Response body when error occurs
+     */
+    public $response_error_body;
+
+    /**
+     *The hander of write file
+     */
+    public $write_file_handle; 
+
+    /**
+     * The body being sent in the request.
+     */
+    public $request_body;
+
+    /**
+     * The response returned by the request.
+     */
+    public $response;
+
+    /**
+     * The headers returned by the request.
+     */
+    public $response_headers;
+
+    /**
+     * The body returned by the request.
+     */
+    public $response_body;
+
+    /**
+     * The HTTP status code returned by the request.
+     */
+    public $response_code;
+
+    /**
+     * Additional response data.
+     */
+    public $response_info;
+
+    /**
+     * The method by which the request is being made.
+     */
+    public $method;
+
+    /**
+     * Stores the proxy settings to use for the request.
+     */
+    public $proxy = null;
+
+    /**
+     * The username to use for the request.
+     */
+    public $username = null;
+
+    /**
+     * The password to use for the request.
+     */
+    public $password = null;
+
+    /**
+     * Custom CURLOPT settings.
+     */
+    public $curlopts = null;
+
+    /**
+     * The state of debug mode.
+     */
+    public $debug_mode = false;
+
+    /**
+     * The default class to use for HTTP Requests (defaults to <RequestCore>).
+     */
+    public $request_class = 'OSS\Http\RequestCore';
+
+    /**
+     * The default class to use for HTTP Responses (defaults to <ResponseCore>).
+     */
+    public $response_class = 'OSS\Http\ResponseCore';
+
+    /**
+     * Default useragent string to use.
+     */
+    public $useragent = 'RequestCore/1.4.3';
+
+    /**
+     * File to read from while streaming up.
+     */
+    public $read_file = null;
+
+    /**
+     * The resource to read from while streaming up.
+     */
+    public $read_stream = null;
+
+    /**
+     * The size of the stream to read from.
+     */
+    public $read_stream_size = null;
+
+    /**
+     * The length already read from the stream.
+     */
+    public $read_stream_read = 0;
+
+    /**
+     * File to write to while streaming down.
+     */
+    public $write_file = null;
+
+    /**
+     * The resource to write to while streaming down.
+     */
+    public $write_stream = null;
+
+    /**
+     * Stores the intended starting seek position.
+     */
+    public $seek_position = null;
+
+    /**
+     * The location of the cacert.pem file to use.
+     */
+    public $cacert_location = false;
+
+    /**
+     * The state of SSL certificate verification.
+     */
+    public $ssl_verification = true;
+
+    /**
+     * The user-defined callback function to call when a stream is read from.
+     */
+    public $registered_streaming_read_callback = null;
+
+    /**
+     * The user-defined callback function to call when a stream is written to.
+     */
+    public $registered_streaming_write_callback = null;
+
+    /**
+     * 请求超时时间, 默认是5184000秒,6天
+     *
+     * @var int
+     */
+    public $timeout = 5184000;
+
+    /**
+     * 连接超时时间,默认是10秒
+     *
+     * @var int
+     */
+    public $connect_timeout = 10;
+
+    /*%******************************************************************************************%*/
+    // CONSTANTS
+
+    /**
+     * GET HTTP Method
+     */
+    const HTTP_GET = 'GET';
+
+    /**
+     * POST HTTP Method
+     */
+    const HTTP_POST = 'POST';
+
+    /**
+     * PUT HTTP Method
+     */
+    const HTTP_PUT = 'PUT';
+
+    /**
+     * DELETE HTTP Method
+     */
+    const HTTP_DELETE = 'DELETE';
+
+    /**
+     * HEAD HTTP Method
+     */
+    const HTTP_HEAD = 'HEAD';
+
+
+    /*%******************************************************************************************%*/
+    // CONSTRUCTOR/DESTRUCTOR
+
+    /**
+     * Constructs a new instance of this class.
+     *
+     * @param string $url (Optional) The URL to request or service endpoint to query.
+     * @param string $proxy (Optional) The faux-url to use for proxy settings. Takes the following format: `proxy://user:pass@hostname:port`
+     * @param array $helpers (Optional) An associative array of classnames to use for request, and response functionality. Gets passed in automatically by the calling class.
+     * @return $this A reference to the current instance.
+     */
+    public function __construct($url = null, $proxy = null, $helpers = null)
+    {
+        // Set some default values.
+        $this->request_url = $url;
+        $this->method = self::HTTP_GET;
+        $this->request_headers = array();
+        $this->request_body = '';
+
+        // Set a new Request class if one was set.
+        if (isset($helpers['request']) && !empty($helpers['request'])) {
+            $this->request_class = $helpers['request'];
+        }
+
+        // Set a new Request class if one was set.
+        if (isset($helpers['response']) && !empty($helpers['response'])) {
+            $this->response_class = $helpers['response'];
+        }
+
+        if ($proxy) {
+            $this->set_proxy($proxy);
+        }
+
+        return $this;
+    }
+
+    /**
+     * Destructs the instance. Closes opened file handles.
+     *
+     * @return $this A reference to the current instance.
+     */
+    public function __destruct()
+    {
+        if (isset($this->read_file) && isset($this->read_stream)) {
+            fclose($this->read_stream);
+        }
+
+        if (isset($this->write_file) && isset($this->write_stream)) {
+            fclose($this->write_stream);
+        }
+
+        return $this;
+    }
+
+
+    /*%******************************************************************************************%*/
+    // REQUEST METHODS
+
+    /**
+     * Sets the credentials to use for authentication.
+     *
+     * @param string $user (Required) The username to authenticate with.
+     * @param string $pass (Required) The password to authenticate with.
+     * @return $this A reference to the current instance.
+     */
+    public function set_credentials($user, $pass)
+    {
+        $this->username = $user;
+        $this->password = $pass;
+        return $this;
+    }
+
+    /**
+     * Adds a custom HTTP header to the cURL request.
+     *
+     * @param string $key (Required) The custom HTTP header to set.
+     * @param mixed $value (Required) The value to assign to the custom HTTP header.
+     * @return $this A reference to the current instance.
+     */
+    public function add_header($key, $value)
+    {
+        $this->request_headers[$key] = $value;
+        return $this;
+    }
+
+    /**
+     * Removes an HTTP header from the cURL request.
+     *
+     * @param string $key (Required) The custom HTTP header to set.
+     * @return $this A reference to the current instance.
+     */
+    public function remove_header($key)
+    {
+        if (isset($this->request_headers[$key])) {
+            unset($this->request_headers[$key]);
+        }
+        return $this;
+    }
+
+    /**
+     * Set the method type for the request.
+     *
+     * @param string $method (Required) One of the following constants: <HTTP_GET>, <HTTP_POST>, <HTTP_PUT>, <HTTP_HEAD>, <HTTP_DELETE>.
+     * @return $this A reference to the current instance.
+     */
+    public function set_method($method)
+    {
+        $this->method = strtoupper($method);
+        return $this;
+    }
+
+    /**
+     * Sets a custom useragent string for the class.
+     *
+     * @param string $ua (Required) The useragent string to use.
+     * @return $this A reference to the current instance.
+     */
+    public function set_useragent($ua)
+    {
+        $this->useragent = $ua;
+        return $this;
+    }
+
+    /**
+     * Set the body to send in the request.
+     *
+     * @param string $body (Required) The textual content to send along in the body of the request.
+     * @return $this A reference to the current instance.
+     */
+    public function set_body($body)
+    {
+        $this->request_body = $body;
+        return $this;
+    }
+
+    /**
+     * Set the URL to make the request to.
+     *
+     * @param string $url (Required) The URL to make the request to.
+     * @return $this A reference to the current instance.
+     */
+    public function set_request_url($url)
+    {
+        $this->request_url = $url;
+        return $this;
+    }
+
+    /**
+     * Set additional CURLOPT settings. These will merge with the default settings, and override if
+     * there is a duplicate.
+     *
+     * @param array $curlopts (Optional) A set of key-value pairs that set `CURLOPT` options. These will merge with the existing CURLOPTs, and ones passed here will override the defaults. Keys should be the `CURLOPT_*` constants, not strings.
+     * @return $this A reference to the current instance.
+     */
+    public function set_curlopts($curlopts)
+    {
+        $this->curlopts = $curlopts;
+        return $this;
+    }
+
+    /**
+     * Sets the length in bytes to read from the stream while streaming up.
+     *
+     * @param integer $size (Required) The length in bytes to read from the stream.
+     * @return $this A reference to the current instance.
+     */
+    public function set_read_stream_size($size)
+    {
+        $this->read_stream_size = $size;
+
+        return $this;
+    }
+
+    /**
+     * Sets the resource to read from while streaming up. Reads the stream from its current position until
+     * EOF or `$size` bytes have been read. If `$size` is not given it will be determined by <php:fstat()> and
+     * <php:ftell()>.
+     *
+     * @param resource $resource (Required) The readable resource to read from.
+     * @param integer $size (Optional) The size of the stream to read.
+     * @return $this A reference to the current instance.
+     */
+    public function set_read_stream($resource, $size = null)
+    {
+        if (!isset($size) || $size < 0) {
+            $stats = fstat($resource);
+
+            if ($stats && $stats['size'] >= 0) {
+                $position = ftell($resource);
+
+                if ($position !== false && $position >= 0) {
+                    $size = $stats['size'] - $position;
+                }
+            }
+        }
+
+        $this->read_stream = $resource;
+
+        return $this->set_read_stream_size($size);
+    }
+
+    /**
+     * Sets the file to read from while streaming up.
+     *
+     * @param string $location (Required) The readable location to read from.
+     * @return $this A reference to the current instance.
+     */
+    public function set_read_file($location)
+    {
+        $this->read_file = $location;
+        $read_file_handle = fopen($location, 'r');
+
+        return $this->set_read_stream($read_file_handle);
+    }
+
+    /**
+     * Sets the resource to write to while streaming down.
+     *
+     * @param resource $resource (Required) The writeable resource to write to.
+     * @return $this A reference to the current instance.
+     */
+    public function set_write_stream($resource)
+    {
+        $this->write_stream = $resource;
+
+        return $this;
+    }
+
+    /**
+     * Sets the file to write to while streaming down.
+     *
+     * @param string $location (Required) The writeable location to write to.
+     * @return $this A reference to the current instance.
+     */
+    public function set_write_file($location)
+    {
+        $this->write_file = $location;
+    }
+
+    /**
+     * Set the proxy to use for making requests.
+     *
+     * @param string $proxy (Required) The faux-url to use for proxy settings. Takes the following format: `proxy://user:pass@hostname:port`
+     * @return $this A reference to the current instance.
+     */
+    public function set_proxy($proxy)
+    {
+        $proxy = parse_url($proxy);
+        $proxy['user'] = isset($proxy['user']) ? $proxy['user'] : null;
+        $proxy['pass'] = isset($proxy['pass']) ? $proxy['pass'] : null;
+        $proxy['port'] = isset($proxy['port']) ? $proxy['port'] : null;
+        $this->proxy = $proxy;
+        return $this;
+    }
+
+    /**
+     * Set the intended starting seek position.
+     *
+     * @param integer $position (Required) The byte-position of the stream to begin reading from.
+     * @return $this A reference to the current instance.
+     */
+    public function set_seek_position($position)
+    {
+        $this->seek_position = isset($position) ? (integer)$position : null;
+
+        return $this;
+    }
+
+    /**
+     * A callback function that is invoked by cURL for streaming up.
+     *
+     * @param resource $curl_handle (Required) The cURL handle for the request.
+     * @param resource $header_content (Required) The header callback result.
+     * @return headers from a stream.
+     */
+   public function streaming_header_callback($curl_handle, $header_content)
+   {
+        $code = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
+
+        if (isset($this->write_file) && intval($code) / 100 == 2 && !isset($this->write_file_handle))
+        {
+            $this->write_file_handle = fopen($this->write_file, 'w');
+            $this->set_write_stream($this->write_file_handle);
+        }
+
+        $this->response_raw_headers .= $header_content;
+        return strlen($header_content); 
+    }
+        
+
+    /**
+     * Register a callback function to execute whenever a data stream is read from using
+     * <CFRequest::streaming_read_callback()>.
+     *
+     * The user-defined callback function should accept three arguments:
+     *
+     * <ul>
+     *    <li><code>$curl_handle</code> - <code>resource</code> - Required - The cURL handle resource that represents the in-progress transfer.</li>
+     *    <li><code>$file_handle</code> - <code>resource</code> - Required - The file handle resource that represents the file on the local file system.</li>
+     *    <li><code>$length</code> - <code>integer</code> - Required - The length in kilobytes of the data chunk that was transferred.</li>
+     * </ul>
+     *
+     * @param string|array|function $callback (Required) The callback function is called by <php:call_user_func()>, so you can pass the following values: <ul>
+     *    <li>The name of a global function to execute, passed as a string.</li>
+     *    <li>A method to execute, passed as <code>array('ClassName', 'MethodName')</code>.</li>
+     *    <li>An anonymous function (PHP 5.3+).</li></ul>
+     * @return $this A reference to the current instance.
+     */
+    public function register_streaming_read_callback($callback)
+    {
+        $this->registered_streaming_read_callback = $callback;
+
+        return $this;
+    }
+
+    /**
+     * Register a callback function to execute whenever a data stream is written to using
+     * <CFRequest::streaming_write_callback()>.
+     *
+     * The user-defined callback function should accept two arguments:
+     *
+     * <ul>
+     *    <li><code>$curl_handle</code> - <code>resource</code> - Required - The cURL handle resource that represents the in-progress transfer.</li>
+     *    <li><code>$length</code> - <code>integer</code> - Required - The length in kilobytes of the data chunk that was transferred.</li>
+     * </ul>
+     *
+     * @param string|array|function $callback (Required) The callback function is called by <php:call_user_func()>, so you can pass the following values: <ul>
+     *    <li>The name of a global function to execute, passed as a string.</li>
+     *    <li>A method to execute, passed as <code>array('ClassName', 'MethodName')</code>.</li>
+     *    <li>An anonymous function (PHP 5.3+).</li></ul>
+     * @return $this A reference to the current instance.
+     */
+    public function register_streaming_write_callback($callback)
+    {
+        $this->registered_streaming_write_callback = $callback;
+
+        return $this;
+    }
+
+
+    /*%******************************************************************************************%*/
+    // PREPARE, SEND, AND PROCESS REQUEST
+
+    /**
+     * A callback function that is invoked by cURL for streaming up.
+     *
+     * @param resource $curl_handle (Required) The cURL handle for the request.
+     * @param resource $file_handle (Required) The open file handle resource.
+     * @param integer $length (Required) The maximum number of bytes to read.
+     * @return binary Binary data from a stream.
+     */
+    public function streaming_read_callback($curl_handle, $file_handle, $length)
+    {
+        // Once we've sent as much as we're supposed to send...
+        if ($this->read_stream_read >= $this->read_stream_size) {
+            // Send EOF
+            return '';
+        }
+
+        // If we're at the beginning of an upload and need to seek...
+        if ($this->read_stream_read == 0 && isset($this->seek_position) && $this->seek_position !== ftell($this->read_stream)) {
+            if (fseek($this->read_stream, $this->seek_position) !== 0) {
+                throw new RequestCore_Exception('The stream does not support seeking and is either not at the requested position or the position is unknown.');
+            }
+        }
+
+        $read = fread($this->read_stream, min($this->read_stream_size - $this->read_stream_read, $length)); // Remaining upload data or cURL's requested chunk size
+        $this->read_stream_read += strlen($read);
+
+        $out = $read === false ? '' : $read;
+
+        // Execute callback function
+        if ($this->registered_streaming_read_callback) {
+            call_user_func($this->registered_streaming_read_callback, $curl_handle, $file_handle, $out);
+        }
+
+        return $out;
+    }
+
+    /**
+     * A callback function that is invoked by cURL for streaming down.
+     *
+     * @param resource $curl_handle (Required) The cURL handle for the request.
+     * @param binary $data (Required) The data to write.
+     * @return integer The number of bytes written.
+     */
+    public function streaming_write_callback($curl_handle, $data)
+    {
+        $code = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
+        
+        if (intval($code) / 100 != 2)
+        {
+            $this->response_error_body .= $data;
+            return strlen($data);
+        }
+
+        $length = strlen($data);
+        $written_total = 0;
+        $written_last = 0;
+        
+        while ($written_total < $length) {
+            $written_last = fwrite($this->write_stream, substr($data, $written_total));
+
+            if ($written_last === false) {
+                return $written_total;
+            }
+
+            $written_total += $written_last;
+        }
+
+        // Execute callback function
+        if ($this->registered_streaming_write_callback) {
+            call_user_func($this->registered_streaming_write_callback, $curl_handle, $written_total);
+        }
+
+        return $written_total;
+    }
+
+    /**
+     * Prepares and adds the details of the cURL request. This can be passed along to a <php:curl_multi_exec()>
+     * function.
+     *
+     * @return resource The handle for the cURL object.
+     *
+     */
+    public function prep_request()
+    {
+        $curl_handle = curl_init();
+
+        // Set default options.
+        curl_setopt($curl_handle, CURLOPT_URL, $this->request_url);
+        curl_setopt($curl_handle, CURLOPT_FILETIME, true);
+        curl_setopt($curl_handle, CURLOPT_FRESH_CONNECT, false);
+//		curl_setopt($curl_handle, CURLOPT_CLOSEPOLICY, CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
+        curl_setopt($curl_handle, CURLOPT_MAXREDIRS, 5);
+        curl_setopt($curl_handle, CURLOPT_HEADER, true);
+        curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
+        curl_setopt($curl_handle, CURLOPT_TIMEOUT, $this->timeout);
+        curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, $this->connect_timeout);
+        curl_setopt($curl_handle, CURLOPT_NOSIGNAL, true);
+        curl_setopt($curl_handle, CURLOPT_REFERER, $this->request_url);
+        curl_setopt($curl_handle, CURLOPT_USERAGENT, $this->useragent);
+        curl_setopt($curl_handle, CURLOPT_HEADERFUNCTION, array($this, 'streaming_header_callback'));
+        curl_setopt($curl_handle, CURLOPT_READFUNCTION, array($this, 'streaming_read_callback'));
+
+        // Verification of the SSL cert
+        if ($this->ssl_verification) {
+            curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, true);
+            curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, 2);
+        } else {
+            curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
+            curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, false);
+        }
+
+        // chmod the file as 0755
+        if ($this->cacert_location === true) {
+            curl_setopt($curl_handle, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
+        } elseif (is_string($this->cacert_location)) {
+            curl_setopt($curl_handle, CURLOPT_CAINFO, $this->cacert_location);
+        }
+
+        // Debug mode
+        if ($this->debug_mode) {
+            curl_setopt($curl_handle, CURLOPT_VERBOSE, true);
+        }
+
+        // Handle open_basedir & safe mode
+        if (!ini_get('safe_mode') && !ini_get('open_basedir')) {
+            curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);
+        }
+
+        // Enable a proxy connection if requested.
+        if ($this->proxy) {
+
+            $host = $this->proxy['host'];
+            $host .= ($this->proxy['port']) ? ':' . $this->proxy['port'] : '';
+            curl_setopt($curl_handle, CURLOPT_PROXY, $host);
+
+            if (isset($this->proxy['user']) && isset($this->proxy['pass'])) {
+                curl_setopt($curl_handle, CURLOPT_PROXYUSERPWD, $this->proxy['user'] . ':' . $this->proxy['pass']);
+            }
+        }
+
+        // Set credentials for HTTP Basic/Digest Authentication.
+        if ($this->username && $this->password) {
+            curl_setopt($curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
+            curl_setopt($curl_handle, CURLOPT_USERPWD, $this->username . ':' . $this->password);
+        }
+
+        // Handle the encoding if we can.
+        if (extension_loaded('zlib')) {
+            curl_setopt($curl_handle, CURLOPT_ENCODING, '');
+        }
+
+        // Process custom headers
+        if (isset($this->request_headers) && count($this->request_headers)) {
+            $temp_headers = array();
+
+            foreach ($this->request_headers as $k => $v) {
+                $temp_headers[] = $k . ': ' . $v;
+            }
+
+            curl_setopt($curl_handle, CURLOPT_HTTPHEADER, $temp_headers);
+        }
+
+        switch ($this->method) {
+            case self::HTTP_PUT:
+                //unset($this->read_stream);
+                curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, 'PUT');
+                if (isset($this->read_stream)) {
+                    if (!isset($this->read_stream_size) || $this->read_stream_size < 0) {
+                        throw new RequestCore_Exception('The stream size for the streaming upload cannot be determined.');
+                    }
+                    curl_setopt($curl_handle, CURLOPT_INFILESIZE, $this->read_stream_size);
+                    curl_setopt($curl_handle, CURLOPT_UPLOAD, true);
+                } else {
+                    curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $this->request_body);
+                }
+                break;
+
+            case self::HTTP_POST:
+                curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, 'POST');
+                if (isset($this->read_stream)) {
+                    if (!isset($this->read_stream_size) || $this->read_stream_size < 0) {
+                        throw new RequestCore_Exception('The stream size for the streaming upload cannot be determined.');
+                    }
+                    curl_setopt($curl_handle, CURLOPT_INFILESIZE, $this->read_stream_size);
+                    curl_setopt($curl_handle, CURLOPT_UPLOAD, true);
+                } else {
+                    curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $this->request_body);
+                }
+                break;
+
+            case self::HTTP_HEAD:
+                curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, self::HTTP_HEAD);
+                curl_setopt($curl_handle, CURLOPT_NOBODY, 1);
+                break;
+
+            default: // Assumed GET
+                curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, $this->method);
+                if (isset($this->write_stream) || isset($this->write_file)) {
+                    curl_setopt($curl_handle, CURLOPT_WRITEFUNCTION, array($this, 'streaming_write_callback'));
+                    curl_setopt($curl_handle, CURLOPT_HEADER, false);
+                } else {
+                    curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $this->request_body);
+                }
+                break;
+        }
+
+        // Merge in the CURLOPTs
+        if (isset($this->curlopts) && sizeof($this->curlopts) > 0) {
+            foreach ($this->curlopts as $k => $v) {
+                curl_setopt($curl_handle, $k, $v);
+            }
+        }
+
+        return $curl_handle;
+    }
+
+    /**
+     * Take the post-processed cURL data and break it down into useful header/body/info chunks. Uses the
+     * data stored in the `curl_handle` and `response` properties unless replacement data is passed in via
+     * parameters.
+     *
+     * @param resource $curl_handle (Optional) The reference to the already executed cURL request.
+     * @param string $response (Optional) The actual response content itself that needs to be parsed.
+     * @return ResponseCore A <ResponseCore> object containing a parsed HTTP response.
+     */
+    public function process_response($curl_handle = null, $response = null)
+    {
+        // Accept a custom one if it's passed.
+        if ($curl_handle && $response) {
+            $this->response = $response;
+        }
+
+        // As long as this came back as a valid resource...
+        if (is_resource($curl_handle)) {
+            // Determine what's what.
+            $header_size = curl_getinfo($curl_handle, CURLINFO_HEADER_SIZE);
+            $this->response_headers = substr($this->response, 0, $header_size);
+            $this->response_body = substr($this->response, $header_size);
+            $this->response_code = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
+            $this->response_info = curl_getinfo($curl_handle);
+            
+            if (intval($this->response_code) / 100 != 2 && isset($this->write_file))
+            {
+                $this->response_headers = $this->response_raw_headers;
+                $this->response_body = $this->response_error_body;
+            }
+
+            // Parse out the headers
+            $this->response_headers = explode("\r\n\r\n", trim($this->response_headers));
+            $this->response_headers = array_pop($this->response_headers);
+            $this->response_headers = explode("\r\n", $this->response_headers);
+            array_shift($this->response_headers);
+
+            // Loop through and split up the headers.
+            $header_assoc = array();
+            foreach ($this->response_headers as $header) {
+                $kv = explode(': ', $header);
+                $header_assoc[strtolower($kv[0])] = isset($kv[1]) ? $kv[1] : '';
+            }
+
+            // Reset the headers to the appropriate property.
+            $this->response_headers = $header_assoc;
+            $this->response_headers['info'] = $this->response_info;
+            $this->response_headers['info']['method'] = $this->method;
+            
+            if ($curl_handle && $response) {
+                return new ResponseCore($this->response_headers, $this->response_body, $this->response_code);
+            }
+        }
+
+        // Return false
+        return false;
+    }
+
+    /**
+     * Sends the request, calling necessary utility functions to update built-in properties.
+     *
+     * @param boolean $parse (Optional) Whether to parse the response with ResponseCore or not.
+     * @return string The resulting unparsed data from the request.
+     */
+    public function send_request($parse = false)
+    {
+        set_time_limit(0);
+
+        $curl_handle = $this->prep_request();
+        $this->response = curl_exec($curl_handle);
+
+        if ($this->response === false) {
+            throw new RequestCore_Exception('cURL resource: ' . (string)$curl_handle . '; cURL error: ' . curl_error($curl_handle) . ' (' . curl_errno($curl_handle) . ')');
+        }
+
+        $parsed_response = $this->process_response($curl_handle, $this->response);
+
+        curl_close($curl_handle);
+
+        if ($parse) {
+            return $parsed_response;
+        }
+
+        return $this->response;
+    }
+
+    /*%******************************************************************************************%*/
+    // RESPONSE METHODS
+
+    /**
+     * Get the HTTP response headers from the request.
+     *
+     * @param string $header (Optional) A specific header value to return. Defaults to all headers.
+     * @return string|array All or selected header values.
+     */
+    public function get_response_header($header = null)
+    {
+        if ($header) {
+            return $this->response_headers[strtolower($header)];
+        }
+        return $this->response_headers;
+    }
+
+    /**
+     * Get the HTTP response body from the request.
+     *
+     * @return string The response body.
+     */
+    public function get_response_body()
+    {
+        return $this->response_body;
+    }
+
+    /**
+     * Get the HTTP response code from the request.
+     *
+     * @return string The HTTP response code.
+     */
+    public function get_response_code()
+    {
+        return $this->response_code;
+    }
+}

+ 8 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Http/RequestCore_Exception.php

@@ -0,0 +1,8 @@
+<?php
+
+namespace OSS\Http;
+
+class RequestCore_Exception extends \Exception
+{
+
+}

+ 56 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Http/ResponseCore.php

@@ -0,0 +1,56 @@
+<?php
+
+namespace OSS\Http;
+
+/**
+ * Container for all response-related methods.
+ */
+class ResponseCore
+{
+    /**
+     * Stores the HTTP header information.
+     */
+    public $header;
+
+    /**
+     * Stores the SimpleXML response.
+     */
+    public $body;
+
+    /**
+     * Stores the HTTP response code.
+     */
+    public $status;
+
+    /**
+     * Constructs a new instance of this class.
+     *
+     * @param array $header (Required) Associative array of HTTP headers (typically returned by <RequestCore::get_response_header()>).
+     * @param string $body (Required) XML-formatted response from AWS.
+     * @param integer $status (Optional) HTTP response status code from the request.
+     * @return Mixed Contains an <php:array> `header` property (HTTP headers as an associative array), a <php:SimpleXMLElement> or <php:string> `body` property, and an <php:integer> `status` code.
+     */
+    public function __construct($header, $body, $status = null)
+    {
+        $this->header = $header;
+        $this->body = $body;
+        $this->status = $status;
+
+        return $this;
+    }
+
+    /**
+     * Did we receive the status code we expected?
+     *
+     * @param integer|array $codes (Optional) The status code(s) to expect. Pass an <php:integer> for a single acceptable value, or an <php:array> of integers for multiple acceptable values.
+     * @return boolean Whether we received the expected status code or not.
+     */
+    public function isOK($codes = array(200, 201, 204, 206))
+    {
+        if (is_array($codes)) {
+            return in_array($this->status, $codes);
+        }
+
+        return $this->status === $codes;
+    }
+}

+ 78 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/BucketInfo.php

@@ -0,0 +1,78 @@
+<?php
+
+namespace OSS\Model;
+
+
+/**
+ * Bucket信息,ListBuckets接口返回数据
+ *
+ * Class BucketInfo
+ * @package OSS\Model
+ */
+class BucketInfo
+{
+    /**
+     * BucketInfo constructor.
+     *
+     * @param string $location
+     * @param string $name
+     * @param string $createDate
+     */
+    public function __construct($location, $name, $createDate)
+    {
+        $this->location = $location;
+        $this->name = $name;
+        $this->createDate = $createDate;
+    }
+
+    /**
+     * 得到bucket所在的region
+     *
+     * @return string
+     */
+    public function getLocation()
+    {
+        return $this->location;
+    }
+
+    /**
+     * 得到bucket的名称
+     *
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * 得到bucket的创建时间
+     *
+     * @return string
+     */
+    public function getCreateDate()
+    {
+        return $this->createDate;
+    }
+
+    /**
+     * bucket所在的region
+     *
+     * @var string
+     */
+    private $location;
+    /**
+     * bucket的名称
+     *
+     * @var string
+     */
+    private $name;
+
+    /**
+     * bucket的创建事件
+     *
+     * @var string
+     */
+    private $createDate;
+
+}

+ 39 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/BucketListInfo.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class BucketListInfo
+ *
+ * ListBuckets接口返回的数据类型
+ *
+ * @package OSS\Model
+ */
+class BucketListInfo
+{
+    /**
+     * BucketListInfo constructor.
+     * @param array $bucketList
+     */
+    public function __construct(array $bucketList)
+    {
+        $this->bucketList = $bucketList;
+    }
+
+    /**
+     * 得到BucketInfo列表
+     *
+     * @return BucketInfo[]
+     */
+    public function getBucketList()
+    {
+        return $this->bucketList;
+    }
+
+    /**
+     * BucketInfo信息列表
+     *
+     * @var array
+     */
+    private $bucketList = array();
+}

+ 99 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/CnameConfig.php

@@ -0,0 +1,99 @@
+<?php
+
+namespace OSS\Model;
+
+
+use OSS\Core\OssException;
+
+/**
+ * Class CnameConfig
+ * @package OSS\Model
+ *
+ * TODO: fix link
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/cors/PutBucketcors.html
+ */
+class CnameConfig implements XmlConfig
+{
+    public function __construct()
+    {
+        $this->cnameList = array();
+    }
+
+    /**
+     * @return array
+     * @example
+     *  array(2) {
+     *    [0]=>
+     *    array(3) {
+     *      ["Domain"]=>
+     *      string(11) "www.foo.com"
+     *      ["Status"]=>
+     *      string(7) "enabled"
+     *      ["LastModified"]=>
+     *      string(8) "20150101"
+     *    }
+     *    [1]=>
+     *    array(3) {
+     *      ["Domain"]=>
+     *      string(7) "bar.com"
+     *      ["Status"]=>
+     *      string(8) "disabled"
+     *      ["LastModified"]=>
+     *      string(8) "20160101"
+     *    }
+     *  }
+     */
+    public function getCnames()
+    {
+        return $this->cnameList;
+    }
+
+
+    public function addCname($cname)
+    {
+        if (count($this->cnameList) >= self::OSS_MAX_RULES) {
+            throw new OssException(
+                "num of cname in the config exceeds self::OSS_MAX_RULES: " . strval(self::OSS_MAX_RULES));
+        }
+        $this->cnameList[] = array('Domain' => $cname);
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        if (!isset($xml->Cname)) return;
+        foreach ($xml->Cname as $entry) {
+            $cname = array();
+            foreach ($entry as $key => $value) {
+                $cname[strval($key)] = strval($value);
+            }
+            $this->cnameList[] = $cname;
+        }
+    }
+
+    public function serializeToXml()
+    {
+        $strXml = <<<EOF
+<?xml version="1.0" encoding="utf-8"?>
+<BucketCnameConfiguration>
+</BucketCnameConfiguration>
+EOF;
+        $xml = new \SimpleXMLElement($strXml);
+        foreach ($this->cnameList as $cname) {
+            $node = $xml->addChild('Cname');
+            foreach ($cname as $key => $value) {
+                $node->addChild($key, $value);
+            }
+        }
+        return $xml->asXML();
+    }
+
+    public function __toString()
+    {
+        return $this->serializeToXml();
+    }
+
+    const OSS_MAX_RULES = 10;
+
+    private $cnameList = array();
+}

+ 113 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/CorsConfig.php

@@ -0,0 +1,113 @@
+<?php
+
+namespace OSS\Model;
+
+
+use OSS\Core\OssException;
+
+/**
+ * Class CorsConfig
+ * @package OSS\Model
+ *
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/cors/PutBucketcors.html
+ */
+class CorsConfig implements XmlConfig
+{
+    /**
+     * CorsConfig constructor.
+     */
+    public function __construct()
+    {
+        $this->rules = array();
+    }
+
+    /**
+     * 得到CorsRule列表
+     *
+     * @return CorsRule[]
+     */
+    public function getRules()
+    {
+        return $this->rules;
+    }
+
+
+    /**
+     * 添加一条CorsRule
+     *
+     * @param CorsRule $rule
+     * @throws OssException
+     */
+    public function addRule($rule)
+    {
+        if (count($this->rules) >= self::OSS_MAX_RULES) {
+            throw new OssException("num of rules in the config exceeds self::OSS_MAX_RULES: " . strval(self::OSS_MAX_RULES));
+        }
+        $this->rules[] = $rule;
+    }
+
+    /**
+     * 从xml数据中解析出CorsConfig
+     *
+     * @param string $strXml
+     * @throws OssException
+     * @return null
+     */
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        if (!isset($xml->CORSRule)) return;
+        foreach ($xml->CORSRule as $rule) {
+            $corsRule = new CorsRule();
+            foreach ($rule as $key => $value) {
+                if ($key === self::OSS_CORS_ALLOWED_HEADER) {
+                    $corsRule->addAllowedHeader(strval($value));
+                } elseif ($key === self::OSS_CORS_ALLOWED_METHOD) {
+                    $corsRule->addAllowedMethod(strval($value));
+                } elseif ($key === self::OSS_CORS_ALLOWED_ORIGIN) {
+                    $corsRule->addAllowedOrigin(strval($value));
+                } elseif ($key === self::OSS_CORS_EXPOSE_HEADER) {
+                    $corsRule->addExposeHeader(strval($value));
+                } elseif ($key === self::OSS_CORS_MAX_AGE_SECONDS) {
+                    $corsRule->setMaxAgeSeconds(strval($value));
+                }
+            }
+            $this->addRule($corsRule);
+        }
+        return;
+    }
+
+    /**
+     * 生成xml字符串
+     *
+     * @return string
+     */
+    public function serializeToXml()
+    {
+        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><CORSConfiguration></CORSConfiguration>');
+        foreach ($this->rules as $rule) {
+            $xmlRule = $xml->addChild('CORSRule');
+            $rule->appendToXml($xmlRule);
+        }
+        return $xml->asXML();
+    }
+
+    public function __toString()
+    {
+        return $this->serializeToXml();
+    }
+
+    const OSS_CORS_ALLOWED_ORIGIN = 'AllowedOrigin';
+    const OSS_CORS_ALLOWED_METHOD = 'AllowedMethod';
+    const OSS_CORS_ALLOWED_HEADER = 'AllowedHeader';
+    const OSS_CORS_EXPOSE_HEADER = 'ExposeHeader';
+    const OSS_CORS_MAX_AGE_SECONDS = 'MaxAgeSeconds';
+    const OSS_MAX_RULES = 10;
+
+    /**
+     * orsRule列表
+     *
+     * @var CorsRule[]
+     */
+    private $rules = array();
+}

+ 150 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/CorsRule.php

@@ -0,0 +1,150 @@
+<?php
+
+namespace OSS\Model;
+
+use OSS\Core\OssException;
+
+
+/**
+ * Class CorsRule
+ * @package OSS\Model
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/cors/PutBucketcors.html
+ */
+class CorsRule
+{
+    /**
+     * Rule中增加一条allowedOrigin
+     *
+     * @param string $allowedOrigin
+     */
+    public function addAllowedOrigin($allowedOrigin)
+    {
+        if (!empty($allowedOrigin)) {
+            $this->allowedOrigins[] = $allowedOrigin;
+        }
+    }
+
+    /**
+     * Rule中增加一条allowedMethod
+     *
+     * @param string $allowedMethod
+     */
+    public function addAllowedMethod($allowedMethod)
+    {
+        if (!empty($allowedMethod)) {
+            $this->allowedMethods[] = $allowedMethod;
+        }
+    }
+
+    /**
+     * Rule中增加一条allowedHeader
+     *
+     * @param string $allowedHeader
+     */
+    public function addAllowedHeader($allowedHeader)
+    {
+        if (!empty($allowedHeader)) {
+            $this->allowedHeaders[] = $allowedHeader;
+        }
+    }
+
+    /**
+     * Rule中增加一条exposeHeader
+     *
+     * @param string $exposeHeader
+     */
+    public function addExposeHeader($exposeHeader)
+    {
+        if (!empty($exposeHeader)) {
+            $this->exposeHeaders[] = $exposeHeader;
+        }
+    }
+
+    /**
+     * @return int
+     */
+    public function getMaxAgeSeconds()
+    {
+        return $this->maxAgeSeconds;
+    }
+
+    /**
+     * @param int $maxAgeSeconds
+     */
+    public function setMaxAgeSeconds($maxAgeSeconds)
+    {
+        $this->maxAgeSeconds = $maxAgeSeconds;
+    }
+
+    /**
+     * 得到AllowedHeaders列表
+     *
+     * @return string[]
+     */
+    public function getAllowedHeaders()
+    {
+        return $this->allowedHeaders;
+    }
+
+    /**
+     * 得到AllowedOrigins列表
+     *
+     * @return string[]
+     */
+    public function getAllowedOrigins()
+    {
+        return $this->allowedOrigins;
+    }
+
+    /**
+     * 得到AllowedMethods列表
+     *
+     * @return string[]
+     */
+    public function getAllowedMethods()
+    {
+        return $this->allowedMethods;
+    }
+
+    /**
+     * 得到ExposeHeaders列表
+     *
+     * @return string[]
+     */
+    public function getExposeHeaders()
+    {
+        return $this->exposeHeaders;
+    }
+
+    /**
+     * 根据提供的xmlRule, 把this按照一定的规则插入到$xmlRule中
+     *
+     * @param \SimpleXMLElement $xmlRule
+     * @throws OssException
+     */
+    public function appendToXml(&$xmlRule)
+    {
+        if (!isset($this->maxAgeSeconds)) {
+            throw new OssException("maxAgeSeconds is not set in the Rule");
+        }
+        foreach ($this->allowedOrigins as $allowedOrigin) {
+            $xmlRule->addChild(CorsConfig::OSS_CORS_ALLOWED_ORIGIN, $allowedOrigin);
+        }
+        foreach ($this->allowedMethods as $allowedMethod) {
+            $xmlRule->addChild(CorsConfig::OSS_CORS_ALLOWED_METHOD, $allowedMethod);
+        }
+        foreach ($this->allowedHeaders as $allowedHeader) {
+            $xmlRule->addChild(CorsConfig::OSS_CORS_ALLOWED_HEADER, $allowedHeader);
+        }
+        foreach ($this->exposeHeaders as $exposeHeader) {
+            $xmlRule->addChild(CorsConfig::OSS_CORS_EXPOSE_HEADER, $exposeHeader);
+        }
+        $xmlRule->addChild(CorsConfig::OSS_CORS_MAX_AGE_SECONDS, strval($this->maxAgeSeconds));
+    }
+
+    private $allowedHeaders = array();
+    private $allowedOrigins = array();
+    private $allowedMethods = array();
+    private $exposeHeaders = array();
+    private $maxAgeSeconds = null;
+}

+ 34 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/GetLiveChannelHistory.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace OSS\Model;
+/**
+ * Class GetLiveChannelHistory
+ * @package OSS\Model
+ */
+class GetLiveChannelHistory implements XmlConfig
+{
+     public function getLiveRecordList()
+    {
+        return $this->liveRecordList;
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+
+        if (isset($xml->LiveRecord)) {
+            foreach ($xml->LiveRecord as $record) {
+            $liveRecord = new LiveChannelHistory();
+            $liveRecord->parseFromXmlNode($record);
+            $this->liveRecordList[] = $liveRecord;
+           }
+        }
+    }
+
+    public function serializeToXml()
+    {
+        throw new OssException("Not implemented.");
+    }
+    
+    private $liveRecordList = array();
+}

+ 68 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/GetLiveChannelInfo.php

@@ -0,0 +1,68 @@
+<?php
+
+namespace OSS\Model;
+/**
+ * Class GetLiveChannelInfo
+ * @package OSS\Model
+ */
+class GetLiveChannelInfo implements XmlConfig
+{
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    public function getType()
+    {
+        return $this->type;
+    }
+  
+    public function getFragDuration()
+    {
+        return $this->fragDuration;
+    }
+   
+    public function getFragCount()
+    {
+        return $this->fragCount;
+    }
+   
+    public function getPlayListName()
+    {
+        return $this->playlistName;
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+
+        $this->description = strval($xml->Description);
+        $this->status = strval($xml->Status);
+
+        if (isset($xml->Target)) {
+            foreach ($xml->Target as $target) {
+            $this->type = strval($target->Type);
+            $this->fragDuration = strval($target->FragDuration);
+            $this->fragCount = strval($target->FragCount);
+            $this->playlistName = strval($target->PlaylistName);
+           }
+        }
+    }
+
+    public function serializeToXml()
+    {
+        throw new OssException("Not implemented.");
+    }
+    
+    private $description;
+    private $status;
+    private $type;
+    private $fragDuration;
+    private $fragCount;
+    private $playlistName;
+}

+ 107 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/GetLiveChannelStatus.php

@@ -0,0 +1,107 @@
+<?php
+
+namespace OSS\Model;
+/**
+ * Class GetLiveChannelStatus
+ * @package OSS\Model
+ */
+class GetLiveChannelStatus implements XmlConfig
+{
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    public function getConnectedTime()
+    {
+        return $this->connectedTime;
+    }
+
+    public function getRemoteAddr()
+    {
+        return $this->remoteAddr;
+    }
+
+    public function getVideoWidth()
+    {
+        return $this->videoWidth;
+    }
+    public function getVideoHeight()
+    {
+        return $this->videoHeight;
+    }
+    public function getVideoFrameRate()
+    {
+        return $this->videoFrameRate;
+    }
+    public function getVideoBandwidth()
+    {
+        return $this->videoBandwidth;
+    }
+    public function getVideoCodec()
+    {
+        return $this->videoCodec;
+    }
+
+    public function getAudioBandwidth()
+    {
+        return $this->audioBandwidth;
+    }
+    public function getAudioSampleRate()
+    {
+        return $this->audioSampleRate;
+    }
+    public function getAudioCodec()
+    {
+        return $this->audioCodec;
+    }
+
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        $this->status = strval($xml->Status);
+        $this->connectedTime = strval($xml->ConnectedTime);
+        $this->remoteAddr = strval($xml->RemoteAddr);
+
+        if (isset($xml->Video)) {
+            foreach ($xml->Video as $video) {
+            $this->videoWidth = intval($video->Width);
+            $this->videoHeight = intval($video->Height);
+            $this->videoFrameRate = intval($video->FrameRate);
+            $this->videoBandwidth = intval($video->Bandwidth);
+            $this->videoCodec = strval($video->Codec);
+           }
+        }
+        
+        if (isset($xml->Video)) {
+            foreach ($xml->Audio as $audio) {
+            $this->audioBandwidth = intval($audio->Bandwidth);
+            $this->audioSampleRate = intval($audio->SampleRate);
+            $this->audioCodec = strval($audio->Codec);
+           }
+        }
+
+    }
+
+    public function serializeToXml()
+    {
+        throw new OssException("Not implemented.");
+    }
+    
+    private $status;
+    private $connectedTime;
+    private $remoteAddr;
+
+    private $videoWidth;
+    private $videoHeight;
+    private $videoFrameRate;
+    private $videoBandwidth;
+    private $videoCodec;
+
+    private $audioBandwidth;
+    private $audioSampleRate;
+    private $audioCodec;
+    
+
+}

+ 88 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LifecycleAction.php

@@ -0,0 +1,88 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class LifecycleAction
+ * @package OSS\Model
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketLifecycle.html
+ */
+class LifecycleAction
+{
+    /**
+     * LifecycleAction constructor.
+     * @param string $action
+     * @param string $timeSpec
+     * @param string $timeValue
+     */
+    public function __construct($action, $timeSpec, $timeValue)
+    {
+        $this->action = $action;
+        $this->timeSpec = $timeSpec;
+        $this->timeValue = $timeValue;
+    }
+
+    /**
+     * @return LifecycleAction
+     */
+    public function getAction()
+    {
+        return $this->action;
+    }
+
+    /**
+     * @param string $action
+     */
+    public function setAction($action)
+    {
+        $this->action = $action;
+    }
+
+    /**
+     * @return string
+     */
+    public function getTimeSpec()
+    {
+        return $this->timeSpec;
+    }
+
+    /**
+     * @param string $timeSpec
+     */
+    public function setTimeSpec($timeSpec)
+    {
+        $this->timeSpec = $timeSpec;
+    }
+
+    /**
+     * @return string
+     */
+    public function getTimeValue()
+    {
+        return $this->timeValue;
+    }
+
+    /**
+     * @param string $timeValue
+     */
+    public function setTimeValue($timeValue)
+    {
+        $this->timeValue = $timeValue;
+    }
+
+    /**
+     * appendToXml 把actions插入到xml中
+     *
+     * @param \SimpleXMLElement $xmlRule
+     */
+    public function appendToXml(&$xmlRule)
+    {
+        $xmlAction = $xmlRule->addChild($this->action);
+        $xmlAction->addChild($this->timeSpec, $this->timeValue);
+    }
+
+    private $action;
+    private $timeSpec;
+    private $timeValue;
+
+}

+ 107 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LifecycleConfig.php

@@ -0,0 +1,107 @@
+<?php
+
+namespace OSS\Model;
+
+use OSS\Core\OssException;
+
+
+/**
+ * Class BucketLifecycleConfig
+ * @package OSS\Model
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketLifecycle.html
+ */
+class LifecycleConfig implements XmlConfig
+{
+    /**
+     * 从xml数据中解析出LifecycleConfig
+     *
+     * @param string $strXml
+     * @throws OssException
+     * @return null
+     */
+    public function parseFromXml($strXml)
+    {
+        $this->rules = array();
+        $xml = simplexml_load_string($strXml);
+        if (!isset($xml->Rule)) return;
+        $this->rules = array();
+        foreach ($xml->Rule as $rule) {
+            $id = strval($rule->ID);
+            $prefix = strval($rule->Prefix);
+            $status = strval($rule->Status);
+            $actions = array();
+            foreach ($rule as $key => $value) {
+                if ($key === 'ID' || $key === 'Prefix' || $key === 'Status') continue;
+                $action = $key;
+                $timeSpec = null;
+                $timeValue = null;
+                foreach ($value as $timeSpecKey => $timeValueValue) {
+                    $timeSpec = $timeSpecKey;
+                    $timeValue = strval($timeValueValue);
+                }
+                $actions[] = new LifecycleAction($action, $timeSpec, $timeValue);
+            }
+            $this->rules[] = new LifecycleRule($id, $prefix, $status, $actions);
+        }
+        return;
+    }
+
+
+    /**
+     * 生成xml字符串
+     *
+     * @return string
+     */
+    public function serializeToXml()
+    {
+
+        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><LifecycleConfiguration></LifecycleConfiguration>');
+        foreach ($this->rules as $rule) {
+            $xmlRule = $xml->addChild('Rule');
+            $rule->appendToXml($xmlRule);
+        }
+        return $xml->asXML();
+    }
+
+    /**
+     *
+     * 添加LifecycleRule
+     *
+     * @param LifecycleRule $lifecycleRule
+     * @throws OssException
+     */
+    public function addRule($lifecycleRule)
+    {
+        if (!isset($lifecycleRule)) {
+            throw new OssException("lifecycleRule is null");
+        }
+        $this->rules[] = $lifecycleRule;
+    }
+
+    /**
+     *  将配置转换成字符串,便于用户查看
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return $this->serializeToXml();
+    }
+
+    /**
+     * 得到所有的生命周期规则
+     *
+     * @return LifecycleRule[]
+     */
+    public function getRules()
+    {
+        return $this->rules;
+    }
+
+    /**
+     * @var LifecycleRule[]
+     */
+    private $rules;
+}
+
+

+ 126 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LifecycleRule.php

@@ -0,0 +1,126 @@
+<?php
+
+namespace OSS\Model;
+
+
+/**
+ * Class LifecycleRule
+ * @package OSS\Model
+ *
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketLifecycle.html
+ */
+class LifecycleRule
+{
+    /**
+     * 得到规则ID
+     *
+     * @return string
+     */
+    public function getId()
+    {
+        return $this->id;
+    }
+
+    /**
+     * @param string $id 规则ID
+     */
+    public function setId($id)
+    {
+        $this->id = $id;
+    }
+
+    /**
+     * 得到文件前缀
+     *
+     * @return string
+     */
+    public function getPrefix()
+    {
+        return $this->prefix;
+    }
+
+    /**
+     * 设置文件前缀
+     *
+     * @param string $prefix 文件前缀
+     */
+    public function setPrefix($prefix)
+    {
+        $this->prefix = $prefix;
+    }
+
+    /**
+     * Lifecycle规则的状态
+     *
+     * @return string
+     */
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    /**
+     * 设置Lifecycle规则状态
+     *
+     * @param string $status
+     */
+    public function setStatus($status)
+    {
+        $this->status = $status;
+    }
+
+    /**
+     *
+     * @return LifecycleAction[]
+     */
+    public function getActions()
+    {
+        return $this->actions;
+    }
+
+    /**
+     * @param LifecycleAction[] $actions
+     */
+    public function setActions($actions)
+    {
+        $this->actions = $actions;
+    }
+
+
+    /**
+     * LifecycleRule constructor.
+     *
+     * @param string $id 规则ID
+     * @param string $prefix 文件前缀
+     * @param string $status 规则状态,可选[self::LIFECYCLE_STATUS_ENABLED, self::LIFECYCLE_STATUS_DISABLED]
+     * @param LifecycleAction[] $actions
+     */
+    public function __construct($id, $prefix, $status, $actions)
+    {
+        $this->id = $id;
+        $this->prefix = $prefix;
+        $this->status = $status;
+        $this->actions = $actions;
+    }
+
+    /**
+     * @param \SimpleXMLElement $xmlRule
+     */
+    public function appendToXml(&$xmlRule)
+    {
+        $xmlRule->addChild('ID', $this->id);
+        $xmlRule->addChild('Prefix', $this->prefix);
+        $xmlRule->addChild('Status', $this->status);
+        foreach ($this->actions as $action) {
+            $action->appendToXml($xmlRule);
+        }
+    }
+
+    private $id;
+    private $prefix;
+    private $status;
+    private $actions = array();
+
+    const LIFECYCLE_STATUS_ENABLED = 'Enabled';
+    const LIFECYCLE_STATUS_DISABLED = 'Disabled';
+}

+ 134 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/ListMultipartUploadInfo.php

@@ -0,0 +1,134 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class ListMultipartUploadInfo
+ * @package OSS\Model
+ *
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/multipart-upload/ListMultipartUploads.html
+ */
+class ListMultipartUploadInfo
+{
+    /**
+     * ListMultipartUploadInfo constructor.
+     *
+     * @param string $bucket
+     * @param string $keyMarker
+     * @param string $uploadIdMarker
+     * @param string $nextKeyMarker
+     * @param string $nextUploadIdMarker
+     * @param string $delimiter
+     * @param string $prefix
+     * @param int $maxUploads
+     * @param string $isTruncated
+     * @param array $uploads
+     */
+    public function __construct($bucket, $keyMarker, $uploadIdMarker, $nextKeyMarker, $nextUploadIdMarker, $delimiter, $prefix, $maxUploads, $isTruncated, array $uploads)
+    {
+        $this->bucket = $bucket;
+        $this->keyMarker = $keyMarker;
+        $this->uploadIdMarker = $uploadIdMarker;
+        $this->nextKeyMarker = $nextKeyMarker;
+        $this->nextUploadIdMarker = $nextUploadIdMarker;
+        $this->delimiter = $delimiter;
+        $this->prefix = $prefix;
+        $this->maxUploads = $maxUploads;
+        $this->isTruncated = $isTruncated;
+        $this->uploads = $uploads;
+    }
+
+    /**
+     * 得到bucket名称
+     *
+     * @return string
+     */
+    public function getBucket()
+    {
+        return $this->bucket;
+    }
+
+    /**
+     * @return string
+     */
+    public function getKeyMarker()
+    {
+        return $this->keyMarker;
+    }
+
+    /**
+     *
+     * @return string
+     */
+    public function getUploadIdMarker()
+    {
+        return $this->uploadIdMarker;
+    }
+
+    /**
+     * @return string
+     */
+    public function getNextKeyMarker()
+    {
+        return $this->nextKeyMarker;
+    }
+
+    /**
+     * @return string
+     */
+    public function getNextUploadIdMarker()
+    {
+        return $this->nextUploadIdMarker;
+    }
+
+    /**
+     * @return string
+     */
+    public function getDelimiter()
+    {
+        return $this->delimiter;
+    }
+
+    /**
+     * @return string
+     */
+    public function getPrefix()
+    {
+        return $this->prefix;
+    }
+
+    /**
+     * @return int
+     */
+    public function getMaxUploads()
+    {
+        return $this->maxUploads;
+    }
+
+    /**
+     * @return string
+     */
+    public function getIsTruncated()
+    {
+        return $this->isTruncated;
+    }
+
+    /**
+     * @return UploadInfo[]
+     */
+    public function getUploads()
+    {
+        return $this->uploads;
+    }
+
+    private $bucket = "";
+    private $keyMarker = "";
+    private $uploadIdMarker = "";
+    private $nextKeyMarker = "";
+    private $nextUploadIdMarker = "";
+    private $delimiter = "";
+    private $prefix = "";
+    private $maxUploads = 0;
+    private $isTruncated = "false";
+    private $uploads = array();
+}

+ 97 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/ListPartsInfo.php

@@ -0,0 +1,97 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class ListPartsInfo
+ * @package OSS\Model
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/multipart-upload/ListParts.html
+ */
+class ListPartsInfo
+{
+
+    /**
+     * ListPartsInfo constructor.
+     * @param string $bucket
+     * @param string $key
+     * @param string $uploadId
+     * @param int $nextPartNumberMarker
+     * @param int $maxParts
+     * @param string $isTruncated
+     * @param array $listPart
+     */
+    public function __construct($bucket, $key, $uploadId, $nextPartNumberMarker, $maxParts, $isTruncated, array $listPart)
+    {
+        $this->bucket = $bucket;
+        $this->key = $key;
+        $this->uploadId = $uploadId;
+        $this->nextPartNumberMarker = $nextPartNumberMarker;
+        $this->maxParts = $maxParts;
+        $this->isTruncated = $isTruncated;
+        $this->listPart = $listPart;
+    }
+
+    /**
+     * @return string
+     */
+    public function getBucket()
+    {
+        return $this->bucket;
+    }
+
+    /**
+     * @return string
+     */
+    public function getKey()
+    {
+        return $this->key;
+    }
+
+    /**
+     * @return string
+     */
+    public function getUploadId()
+    {
+        return $this->uploadId;
+    }
+
+    /**
+     * @return int
+     */
+    public function getNextPartNumberMarker()
+    {
+        return $this->nextPartNumberMarker;
+    }
+
+    /**
+     * @return int
+     */
+    public function getMaxParts()
+    {
+        return $this->maxParts;
+    }
+
+    /**
+     * @return string
+     */
+    public function getIsTruncated()
+    {
+        return $this->isTruncated;
+    }
+
+    /**
+     * @return array
+     */
+    public function getListPart()
+    {
+        return $this->listPart;
+    }
+
+    private $bucket = "";
+    private $key = "";
+    private $uploadId = "";
+    private $nextPartNumberMarker = 0;
+    private $maxParts = 0;
+    private $isTruncated = "";
+    private $listPart = array();
+}

+ 121 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LiveChannelConfig.php

@@ -0,0 +1,121 @@
+<?php
+
+namespace OSS\Model;
+
+
+/**
+ * Class LiveChannelConfig
+ * @package OSS\Model
+ */
+class LiveChannelConfig implements XmlConfig
+{
+    public function __construct($option = array())
+    {
+        if (isset($option['description'])) {
+            $this->description = $option['description'];
+        }
+        if (isset($option['status'])) {
+            $this->status = $option['status'];
+        }
+        if (isset($option['type'])) {
+            $this->type = $option['type'];
+        }
+        if (isset($option['fragDuration'])) {
+            $this->fragDuration = $option['fragDuration'];
+        }
+        if (isset($option['fragCount'])) {
+            $this->fragCount = $option['fragCount'];
+        }
+        if (isset($option['playListName'])) {
+            $this->playListName = $option['playListName'];
+        }
+    }
+
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    public function getType()
+    {
+        return $this->type;
+    }
+
+    public function getFragDuration()
+    {
+        return $this->fragDuration;
+    }
+
+    public function getFragCount()
+    {
+        return $this->fragCount;
+    }
+
+    public function getPlayListName()
+    {
+        return $this->playListName;
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        $this->description = strval($xml->Description);
+        $this->status = strval($xml->Status);
+        $target = $xml->Target;
+        $this->type = strval($target->Type);
+        $this->fragDuration = intval($target->FragDuration);
+        $this->fragCount = intval($target->FragCount);
+        $this->playListName = strval($target->PlayListName);
+    }
+
+    public function serializeToXml()
+    {
+        $strXml = <<<EOF
+<?xml version="1.0" encoding="utf-8"?>
+<LiveChannelConfiguration>
+</LiveChannelConfiguration>
+EOF;
+        $xml = new \SimpleXMLElement($strXml);
+        if (isset($this->description)) {
+            $xml->addChild('Description', $this->description);
+        }
+
+        if (isset($this->status)) {
+            $xml->addChild('Status', $this->status);
+        }
+
+        $node = $xml->addChild('Target');
+        $node->addChild('Type', $this->type);
+
+        if (isset($this->fragDuration)) {
+            $node->addChild('FragDuration', $this->fragDuration);
+        }
+
+        if (isset($this->fragCount)) {
+            $node->addChild('FragCount', $this->fragCount);
+        }
+
+        if (isset($this->playListName)) {
+            $node->addChild('PlayListName', $this->playListName);
+        }
+
+        return $xml->asXML();
+    }
+
+    public function __toString()
+    {
+        return $this->serializeToXml();
+    }
+    
+    private $description;
+    private $status = "enabled";
+    private $type;
+    private $fragDuration = 5;
+    private $fragCount = 3;
+    private $playListName = "playlist.m3u8";
+}

+ 59 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LiveChannelHistory.php

@@ -0,0 +1,59 @@
+<?php
+
+namespace OSS\Model;
+/**
+ * Class LiveChannelHistory
+ * @package OSS\Model
+ *
+ */
+class LiveChannelHistory implements XmlConfig
+{
+    public function __construct()
+    {
+    }
+
+    public function getStartTime()
+    {
+        return $this->startTime;
+    }
+
+    public function getEndTime()
+    {
+        return $this->endTime;
+    }
+
+    public function getRemoteAddr()
+    {
+        return $this->remoteAddr;
+    }
+
+    public function parseFromXmlNode($xml)
+    {
+        if (isset($xml->StartTime)) {
+            $this->startTime = strval($xml->StartTime);
+        }
+
+        if (isset($xml->EndTime)) {
+            $this->endTime = strval($xml->EndTime);
+        }
+
+        if (isset($xml->RemoteAddr)) {
+            $this->remoteAddr = strval($xml->RemoteAddr);
+        }
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        $this->parseFromXmlNode($xml);
+    }
+
+    public function serializeToXml()
+    {
+        throw new OssException("Not implemented.");
+    }
+    
+    private $startTime;
+    private $endTime;
+    private $remoteAddr;
+}

+ 107 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LiveChannelInfo.php

@@ -0,0 +1,107 @@
+<?php
+
+namespace OSS\Model;
+/**
+ * Class LiveChannelInfo
+ * @package OSS\Model
+ *
+ */
+class LiveChannelInfo implements XmlConfig
+{
+    public function __construct($name = null, $description = null)
+    {
+        $this->name = $name;
+        $this->description = $description;
+        $this->publishUrls = array();
+        $this->playUrls = array();
+    }
+
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    public function setName($name)
+    {
+        $this->name = $name;
+    }
+
+    public function getPublishUrls()
+    {
+        return $this->publishUrls;
+    }
+
+    public function getPlayUrls()
+    {
+        return $this->playUrls;
+    }
+
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    public function getLastModified()
+    {
+        return $this->lastModified;
+    }
+
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    public function setDescription($description)
+    {
+        $this->description = $description;
+    }
+
+    public function parseFromXmlNode($xml)
+    {
+        if (isset($xml->Name)) {
+            $this->name = strval($xml->Name);
+        }
+
+        if (isset($xml->Description)) {
+            $this->description = strval($xml->Description);
+        }
+
+        if (isset($xml->Status)) {
+            $this->status = strval($xml->Status);
+        }
+
+        if (isset($xml->LastModified)) {
+            $this->lastModified = strval($xml->LastModified);
+        }
+
+        if (isset($xml->PublishUrls)) {
+            foreach ($xml->PublishUrls as $url) {
+                $this->publishUrls[] = strval($url->Url);
+            }
+        }
+
+        if (isset($xml->PlayUrls)) {
+            foreach ($xml->PlayUrls as $url) {
+                $this->playUrls[] = strval($url->Url);
+            }
+        }
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        $this->parseFromXmlNode($xml);
+    }
+
+    public function serializeToXml()
+    {
+        throw new OssException("Not implemented.");
+    }
+    
+    private $name;
+    private $description;
+    private $publishUrls;
+    private $playUrls;
+    private $status;
+    private $lastModified;
+}

+ 107 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LiveChannelListInfo.php

@@ -0,0 +1,107 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class LiveChannelListInfo
+ *
+ * ListBucketLiveChannels接口返回数据
+ *
+ * @package OSS\Model
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html
+ */
+class LiveChannelListInfo implements XmlConfig
+{
+    /**
+     * @return string
+     */
+    public function getBucketName()
+    {
+        return $this->bucket;
+    }
+
+    public function setBucketName($name)
+    {
+        $this->bucket = $name;
+    }
+
+    /**
+     * @return string
+     */
+    public function getPrefix()
+    {
+        return $this->prefix;
+    }
+
+    /**
+     * @return string
+     */
+    public function getMarker()
+    {
+        return $this->marker;
+    }
+
+    /**
+     * @return int
+     */
+    public function getMaxKeys()
+    {
+        return $this->maxKeys;
+    }
+
+    /**
+     * @return mixed
+     */
+    public function getIsTruncated()
+    {
+        return $this->isTruncated;
+    }
+
+    /**
+     * @return LiveChannelInfo[]
+     */
+    public function getChannelList()
+    {
+        return $this->channelList;
+    }
+
+    /**
+     * @return string
+     */
+    public function getNextMarker()
+    {
+        return $this->nextMarker;
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+
+        $this->prefix = strval($xml->Prefix);
+        $this->marker = strval($xml->Marker);
+        $this->maxKeys = intval($xml->MaxKeys);
+        $this->isTruncated = (strval($xml->IsTruncated) == 'true');
+        $this->nextMarker = strval($xml->NextMarker);
+
+        if (isset($xml->LiveChannel)) {
+            foreach ($xml->LiveChannel as $chan) {
+                $channel = new LiveChannelInfo();
+                $channel->parseFromXmlNode($chan);
+                $this->channelList[] = $channel;
+            }
+        }
+    }
+
+    public function serializeToXml()
+    {
+        throw new OssException("Not implemented.");
+    }
+    
+    private $bucket = '';
+    private $prefix = '';
+    private $marker = '';
+    private $nextMarker = '';
+    private $maxKeys = 100;
+    private $isTruncated = 'false';
+    private $channelList = array();
+}

+ 86 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LoggingConfig.php

@@ -0,0 +1,86 @@
+<?php
+
+namespace OSS\Model;
+
+
+/**
+ * Class LoggingConfig
+ * @package OSS\Model
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketLogging.html
+ */
+class LoggingConfig implements XmlConfig
+{
+    /**
+     * LoggingConfig constructor.
+     * @param null $targetBucket
+     * @param null $targetPrefix
+     */
+    public function __construct($targetBucket = null, $targetPrefix = null)
+    {
+        $this->targetBucket = $targetBucket;
+        $this->targetPrefix = $targetPrefix;
+    }
+
+    /**
+     * @param $strXml
+     * @return null
+     */
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        if (!isset($xml->LoggingEnabled)) return;
+        foreach ($xml->LoggingEnabled as $status) {
+            foreach ($status as $key => $value) {
+                if ($key === 'TargetBucket') {
+                    $this->targetBucket = strval($value);
+                } elseif ($key === 'TargetPrefix') {
+                    $this->targetPrefix = strval($value);
+                }
+            }
+            break;
+        }
+    }
+
+    /**
+     *  序列化成xml字符串
+     *
+     */
+    public function serializeToXml()
+    {
+        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><BucketLoggingStatus></BucketLoggingStatus>');
+        if (isset($this->targetBucket) && isset($this->targetPrefix)) {
+            $loggingEnabled = $xml->addChild('LoggingEnabled');
+            $loggingEnabled->addChild('TargetBucket', $this->targetBucket);
+            $loggingEnabled->addChild('TargetPrefix', $this->targetPrefix);
+        }
+        return $xml->asXML();
+    }
+
+    /**
+     * @return string
+     */
+    public function __toString()
+    {
+        return $this->serializeToXml();
+    }
+
+    /**
+     * @return string
+     */
+    public function getTargetBucket()
+    {
+        return $this->targetBucket;
+    }
+
+    /**
+     * @return string
+     */
+    public function getTargetPrefix()
+    {
+        return $this->targetPrefix;
+    }
+
+    private $targetBucket = "";
+    private $targetPrefix = "";
+
+}

+ 93 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/ObjectInfo.php

@@ -0,0 +1,93 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ *
+ * Class ObjectInfo
+ *
+ * listObjects接口中返回的Object列表中的类
+ *
+ * listObjects接口返回数据中包含两个Array
+ * 一个是拿到的Object列表【可以理解成对应文件系统中的文件列表】
+ * 一个是拿到的Prefix列表【可以理解成对应文件系统中的目录列表】
+ *
+ * @package OSS\Model
+ */
+class ObjectInfo
+{
+    /**
+     * ObjectInfo constructor.
+     *
+     * @param string $key
+     * @param string $lastModified
+     * @param string $eTag
+     * @param string $type
+     * @param int $size
+     * @param string $storageClass
+     */
+    public function __construct($key, $lastModified, $eTag, $type, $size, $storageClass)
+    {
+        $this->key = $key;
+        $this->lastModified = $lastModified;
+        $this->eTag = $eTag;
+        $this->type = $type;
+        $this->size = $size;
+        $this->storageClass = $storageClass;
+    }
+
+    /**
+     * @return string
+     */
+    public function getKey()
+    {
+        return $this->key;
+    }
+
+    /**
+     * @return string
+     */
+    public function getLastModified()
+    {
+        return $this->lastModified;
+    }
+
+    /**
+     * @return string
+     */
+    public function getETag()
+    {
+        return $this->eTag;
+    }
+
+    /**
+     * @return string
+     */
+    public function getType()
+    {
+        return $this->type;
+    }
+
+    /**
+     * @return int
+     */
+    public function getSize()
+    {
+        return $this->size;
+    }
+
+    /**
+     * @return string
+     */
+    public function getStorageClass()
+    {
+        return $this->storageClass;
+    }
+
+    private $key = "";
+    private $lastModified = "";
+    private $eTag = "";
+    private $type = "";
+    private $size = 0;
+    private $storageClass = "";
+}

+ 126 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/ObjectListInfo.php

@@ -0,0 +1,126 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class ObjectListInfo
+ *
+ * ListObjects接口返回数据
+ *
+ * @package OSS\Model
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html
+ */
+class ObjectListInfo
+{
+    /**
+     * ObjectListInfo constructor.
+     *
+     * @param string $bucketName
+     * @param string $prefix
+     * @param string $marker
+     * @param string $nextMarker
+     * @param string $maxKeys
+     * @param string $delimiter
+     * @param null $isTruncated
+     * @param array $objectList
+     * @param array $prefixList
+     */
+    public function __construct($bucketName, $prefix, $marker, $nextMarker, $maxKeys, $delimiter, $isTruncated, array $objectList, array $prefixList)
+    {
+        $this->bucketName = $bucketName;
+        $this->prefix = $prefix;
+        $this->marker = $marker;
+        $this->nextMarker = $nextMarker;
+        $this->maxKeys = $maxKeys;
+        $this->delimiter = $delimiter;
+        $this->isTruncated = $isTruncated;
+        $this->objectList = $objectList;
+        $this->prefixList = $prefixList;
+    }
+
+    /**
+     * @return string
+     */
+    public function getBucketName()
+    {
+        return $this->bucketName;
+    }
+
+    /**
+     * @return string
+     */
+    public function getPrefix()
+    {
+        return $this->prefix;
+    }
+
+    /**
+     * @return string
+     */
+    public function getMarker()
+    {
+        return $this->marker;
+    }
+
+    /**
+     * @return int
+     */
+    public function getMaxKeys()
+    {
+        return $this->maxKeys;
+    }
+
+    /**
+     * @return string
+     */
+    public function getDelimiter()
+    {
+        return $this->delimiter;
+    }
+
+    /**
+     * @return mixed
+     */
+    public function getIsTruncated()
+    {
+        return $this->isTruncated;
+    }
+
+    /**
+     * 返回ListObjects接口返回数据中的ObjectInfo列表
+     *
+     * @return ObjectInfo[]
+     */
+    public function getObjectList()
+    {
+        return $this->objectList;
+    }
+
+    /**
+     * 返回ListObjects接口返回数据中的PrefixInfo列表
+     *
+     * @return PrefixInfo[]
+     */
+    public function getPrefixList()
+    {
+        return $this->prefixList;
+    }
+
+    /**
+     * @return string
+     */
+    public function getNextMarker()
+    {
+        return $this->nextMarker;
+    }
+
+    private $bucketName = "";
+    private $prefix = "";
+    private $marker = "";
+    private $nextMarker = "";
+    private $maxKeys = 0;
+    private $delimiter = "";
+    private $isTruncated = null;
+    private $objectList = array();
+    private $prefixList = array();
+}

+ 63 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/PartInfo.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class PartInfo
+ * @package OSS\Model
+ */
+class PartInfo
+{
+    /**
+     * PartInfo constructor.
+     *
+     * @param int $partNumber
+     * @param string $lastModified
+     * @param string $eTag
+     * @param int $size
+     */
+    public function __construct($partNumber, $lastModified, $eTag, $size)
+    {
+        $this->partNumber = $partNumber;
+        $this->lastModified = $lastModified;
+        $this->eTag = $eTag;
+        $this->size = $size;
+    }
+
+    /**
+     * @return int
+     */
+    public function getPartNumber()
+    {
+        return $this->partNumber;
+    }
+
+    /**
+     * @return string
+     */
+    public function getLastModified()
+    {
+        return $this->lastModified;
+    }
+
+    /**
+     * @return string
+     */
+    public function getETag()
+    {
+        return $this->eTag;
+    }
+
+    /**
+     * @return int
+     */
+    public function getSize()
+    {
+        return $this->size;
+    }
+
+    private $partNumber = 0;
+    private $lastModified = "";
+    private $eTag = "";
+    private $size = 0;
+}

+ 36 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/PrefixInfo.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class PrefixInfo
+ *
+ * listObjects接口中返回的Prefix列表中的类
+ * listObjects接口返回数据中包含两个Array:
+ * 一个是拿到的Object列表【可以理解成对应文件系统中的文件列表】
+ * 一个是拿到的Prefix列表【可以理解成对应文件系统中的目录列表】
+ *
+ * @package OSS\Model
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html
+ */
+class PrefixInfo
+{
+    /**
+     * PrefixInfo constructor.
+     * @param string $prefix
+     */
+    public function __construct($prefix)
+    {
+        $this->prefix = $prefix;
+    }
+
+    /**
+     * @return string
+     */
+    public function getPrefix()
+    {
+        return $this->prefix;
+    }
+
+    private $prefix;
+}

+ 93 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/RefererConfig.php

@@ -0,0 +1,93 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class RefererConfig
+ *
+ * @package OSS\Model
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketReferer.html
+ */
+class RefererConfig implements XmlConfig
+{
+    /**
+     * @param string $strXml
+     * @return null
+     */
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        if (!isset($xml->AllowEmptyReferer)) return;
+        if (!isset($xml->RefererList)) return;
+        $this->allowEmptyReferer =
+            (strval($xml->AllowEmptyReferer) === 'TRUE' || strval($xml->AllowEmptyReferer) === 'true') ? true : false;
+
+        foreach ($xml->RefererList->Referer as $key => $refer) {
+            $this->refererList[] = strval($refer);
+        }
+    }
+
+
+    /**
+     * 把RefererConfig序列化成xml
+     *
+     * @return string
+     */
+    public function serializeToXml()
+    {
+        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><RefererConfiguration></RefererConfiguration>');
+        if ($this->allowEmptyReferer) {
+            $xml->addChild('AllowEmptyReferer', 'true');
+        } else {
+            $xml->addChild('AllowEmptyReferer', 'false');
+        }
+        $refererList = $xml->addChild('RefererList');
+        foreach ($this->refererList as $referer) {
+            $refererList->addChild('Referer', $referer);
+        }
+        return $xml->asXML();
+    }
+
+    /**
+     * @return string
+     */
+    function __toString()
+    {
+        return $this->serializeToXml();
+    }
+
+    /**
+     * @param boolean $allowEmptyReferer
+     */
+    public function setAllowEmptyReferer($allowEmptyReferer)
+    {
+        $this->allowEmptyReferer = $allowEmptyReferer;
+    }
+
+    /**
+     * @param string $referer
+     */
+    public function addReferer($referer)
+    {
+        $this->refererList[] = $referer;
+    }
+
+    /**
+     * @return boolean
+     */
+    public function isAllowEmptyReferer()
+    {
+        return $this->allowEmptyReferer;
+    }
+
+    /**
+     * @return array
+     */
+    public function getRefererList()
+    {
+        return $this->refererList;
+    }
+
+    private $allowEmptyReferer = true;
+    private $refererList = array();
+}

+ 74 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/StorageCapacityConfig.php

@@ -0,0 +1,74 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class StorageCapacityConfig
+ *
+ * @package OSS\Model
+ * @link http://docs.alibaba-inc.com/pages/viewpage.action?pageId=271614763
+ */
+class StorageCapacityConfig implements XmlConfig
+{
+    /**
+     * StorageCapacityConfig constructor.
+     *
+     * @param int $storageCapacity            
+     */
+    public function __construct($storageCapacity)
+    {
+        $this->storageCapacity = $storageCapacity;
+    }
+
+    /**
+     * Not implemented
+     */
+    public function parseFromXml($strXml)
+    {
+        throw new OssException("Not implemented.");
+    }
+
+    /**
+     * 把StorageCapacityConfig序列化成xml
+     *
+     * @return string
+     */
+    public function serializeToXml()
+    {
+        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><BucketUserQos></BucketUserQos>');
+        $xml->addChild('StorageCapacity', strval($this->storageCapacity));
+        return $xml->asXML();
+    }
+
+    /**
+     * To string
+     *
+     * @return string
+     */
+    function __toString()
+    {
+        return $this->serializeToXml();
+    }
+
+    /**
+     * Set storage capacity
+     *
+     * @param int $storageCapacity            
+     */
+    public function setStorageCapacity($storageCapacity)
+    {
+        $this->storageCapacity = $storageCapacity;
+    }
+
+    /**
+     * Get storage capacity
+     * 
+     * @return int
+     */
+    public function getStorageCapacity()
+    {
+        return $this->storageCapacity;
+    }
+
+    private $storageCapacity = 0;
+}

+ 55 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/UploadInfo.php

@@ -0,0 +1,55 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class UploadInfo
+ *
+ * ListMultipartUpload接口得到的UploadInfo
+ *
+ * @package OSS\Model
+ */
+class UploadInfo
+{
+    /**
+     * UploadInfo constructor.
+     *
+     * @param string $key
+     * @param string $uploadId
+     * @param string $initiated
+     */
+    public function __construct($key, $uploadId, $initiated)
+    {
+        $this->key = $key;
+        $this->uploadId = $uploadId;
+        $this->initiated = $initiated;
+    }
+
+    /**
+     * @return string
+     */
+    public function getKey()
+    {
+        return $this->key;
+    }
+
+    /**
+     * @return string
+     */
+    public function getUploadId()
+    {
+        return $this->uploadId;
+    }
+
+    /**
+     * @return string
+     */
+    public function getInitiated()
+    {
+        return $this->initiated;
+    }
+
+    private $key = "";
+    private $uploadId = "";
+    private $initiated = "";
+}

+ 76 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/WebsiteConfig.php

@@ -0,0 +1,76 @@
+<?php
+
+namespace OSS\Model;
+
+
+use OSS\Core\OssException;
+
+
+/**
+ * Class WebsiteConfig
+ * @package OSS\Model
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketWebsite.html
+ */
+class WebsiteConfig implements XmlConfig
+{
+    /**
+     * WebsiteConfig constructor.
+     * @param  string $indexDocument
+     * @param  string $errorDocument
+     */
+    public function __construct($indexDocument = "", $errorDocument = "")
+    {
+        $this->indexDocument = $indexDocument;
+        $this->errorDocument = $errorDocument;
+    }
+
+    /**
+     * @param string $strXml
+     * @return null
+     */
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        if (isset($xml->IndexDocument) && isset($xml->IndexDocument->Suffix)) {
+            $this->indexDocument = strval($xml->IndexDocument->Suffix);
+        }
+        if (isset($xml->ErrorDocument) && isset($xml->ErrorDocument->Key)) {
+            $this->errorDocument = strval($xml->ErrorDocument->Key);
+        }
+    }
+
+    /**
+     * 把WebsiteConfig序列化成xml
+     *
+     * @return string
+     * @throws OssException
+     */
+    public function serializeToXml()
+    {
+        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><WebsiteConfiguration></WebsiteConfiguration>');
+        $index_document_part = $xml->addChild('IndexDocument');
+        $error_document_part = $xml->addChild('ErrorDocument');
+        $index_document_part->addChild('Suffix', $this->indexDocument);
+        $error_document_part->addChild('Key', $this->errorDocument);
+        return $xml->asXML();
+    }
+
+    /**
+     * @return string
+     */
+    public function getIndexDocument()
+    {
+        return $this->indexDocument;
+    }
+
+    /**
+     * @return string
+     */
+    public function getErrorDocument()
+    {
+        return $this->errorDocument;
+    }
+
+    private $indexDocument = "";
+    private $errorDocument = "";
+}

+ 27 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/XmlConfig.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Interface XmlConfig
+ * @package OSS\Model
+ */
+interface XmlConfig
+{
+
+    /**
+     * 接口定义,实现此接口的类都需要实现从xml数据解析的函数
+     *
+     * @param string $strXml
+     * @return null
+     */
+    public function parseFromXml($strXml);
+
+    /**
+     * 接口定义,实现此接口的类,都需要实现把子类序列化成xml字符串的接口
+     *
+     * @return string
+     */
+    public function serializeToXml();
+
+}

File diff suppressed because it is too large
+ 2739 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/OssClient.php


+ 32 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/AclResult.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace OSS\Result;
+
+use OSS\Core\OssException;
+
+/**
+ * Class AclResult getBucketAcl接口返回结果类,封装了
+ * 返回的xml数据的解析
+ *
+ * @package OSS\Result
+ */
+class AclResult extends Result
+{
+    /**
+     * @return string
+     * @throws OssException
+     */
+    protected function parseDataFromResponse()
+    {
+        $content = $this->rawResponse->body;
+        if (empty($content)) {
+            throw new OssException("body is null");
+        }
+        $xml = simplexml_load_string($content);
+        if (isset($xml->AccessControlList->Grant)) {
+            return strval($xml->AccessControlList->Grant);
+        } else {
+            throw new OssException("xml format exception");
+        }
+    }
+}

+ 27 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/AppendResult.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace OSS\Result;
+
+use OSS\Core\OssException;
+
+/**
+ * Class AppendResult
+ * @package OSS\Result
+ */
+class AppendResult extends Result
+{
+    /**
+     * 结果中part的next-append-position
+     *
+     * @return int
+     * @throws OssException
+     */
+    protected function parseDataFromResponse()
+    {
+        $header = $this->rawResponse->header;
+        if (isset($header["x-oss-next-append-position"])) {
+            return intval($header["x-oss-next-append-position"]);
+        }
+        throw new OssException("cannot get next-append-position");
+    }
+}

+ 19 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/BodyResult.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace OSS\Result;
+
+
+/**
+ * Class BodyResult
+ * @package OSS\Result
+ */
+class BodyResult extends Result
+{
+    /**
+     * @return string
+     */
+    protected function parseDataFromResponse()
+    {
+        return empty($this->rawResponse->body) ? "" : $this->rawResponse->body;
+    }
+}

+ 21 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/CallbackResult.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace OSS\Result;
+
+
+/**
+ * Class CallbackResult
+ * @package OSS\Result
+ */
+class CallbackResult extends PutSetDeleteResult
+{
+    protected function isResponseOk()
+    {
+        $status = $this->rawResponse->status;
+        if ((int)(intval($status) / 100) == 2 && (int)(intval($status)) !== 203) {
+            return true;
+        }
+        return false;
+    }
+
+}

+ 30 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/CopyObjectResult.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace OSS\Result;
+
+
+/**
+ * Class CopyObjectResult
+ * @package OSS\Result
+ */
+class CopyObjectResult extends Result
+{
+    /**
+     * @return array()
+     */
+    protected function parseDataFromResponse()
+    {
+        $body = $this->rawResponse->body;
+        $xml = simplexml_load_string($body); 
+        $result = array();
+        
+        if (isset($xml->LastModified)) {
+            $result[] = $xml->LastModified;
+        }
+        if (isset($xml->ETag)) {
+            $result[] = $xml->ETag;
+        }
+
+         return $result;
+    }
+}

+ 27 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/DeleteObjectsResult.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace OSS\Result;
+
+
+/**
+ * Class DeleteObjectsResult
+ * @package OSS\Result
+ */
+class DeleteObjectsResult extends Result
+{
+    /**
+     * @return array()
+     */
+    protected function parseDataFromResponse()
+    {
+        $body = $this->rawResponse->body;
+        $xml = simplexml_load_string($body); 
+        $objects = array();
+
+        if (isset($xml->Deleted)) {
+            foreach($xml->Deleted as $deleteKey)
+                $objects[] = $deleteKey->Key;
+        }
+        return $objects;
+    }
+}

+ 35 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/ExistResult.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace OSS\Result;
+
+/**
+ * Class ExistResult 检查bucket和object是否存在的返回结果,
+ * 根据返回response的http status判断
+ * @package OSS\Result
+ */
+class ExistResult extends Result
+{
+    /**
+     * @return bool
+     */
+    protected function parseDataFromResponse()
+    {
+        return intval($this->rawResponse->status) === 200 ? true : false;
+    }
+
+    /**
+     * 根据返回http状态码判断,[200-299]即认为是OK, 判断是否存在的接口,404也认为是一种
+     * 有效响应
+     *
+     * @return bool
+     */
+    protected function isResponseOk()
+    {
+        $status = $this->rawResponse->status;
+        if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
+            return true;
+        }
+        return false;
+    }
+
+}

+ 0 - 0
data/api/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetCnameResult.php


Some files were not shown because too many files changed in this diff