├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── app ├── action │ ├── getSignedUrlForGettingObject.action.php │ ├── index.html │ └── listObjects.action.php ├── class │ ├── index.html │ └── oss.class.php ├── function │ ├── app.function.php │ └── index.html ├── index.html ├── init.php └── sdk │ ├── aliyun-oss-php-sdk-2.3.0 │ ├── .gitignore │ ├── LICENSE.md │ ├── README-CN.md │ ├── README.md │ ├── autoload.php │ ├── index.html │ └── src │ │ ├── OSS │ │ ├── Core │ │ │ ├── MimeTypes.php │ │ │ ├── OssException.php │ │ │ ├── OssUtil.php │ │ │ └── index.html │ │ ├── Http │ │ │ ├── LICENSE │ │ │ ├── RequestCore.php │ │ │ ├── RequestCore_Exception.php │ │ │ ├── ResponseCore.php │ │ │ └── index.html │ │ ├── Model │ │ │ ├── BucketInfo.php │ │ │ ├── BucketListInfo.php │ │ │ ├── CnameConfig.php │ │ │ ├── CorsConfig.php │ │ │ ├── CorsRule.php │ │ │ ├── GetLiveChannelHistory.php │ │ │ ├── GetLiveChannelInfo.php │ │ │ ├── GetLiveChannelStatus.php │ │ │ ├── LifecycleAction.php │ │ │ ├── LifecycleConfig.php │ │ │ ├── LifecycleRule.php │ │ │ ├── ListMultipartUploadInfo.php │ │ │ ├── ListPartsInfo.php │ │ │ ├── LiveChannelConfig.php │ │ │ ├── LiveChannelHistory.php │ │ │ ├── LiveChannelInfo.php │ │ │ ├── LiveChannelListInfo.php │ │ │ ├── LoggingConfig.php │ │ │ ├── ObjectInfo.php │ │ │ ├── ObjectListInfo.php │ │ │ ├── PartInfo.php │ │ │ ├── PrefixInfo.php │ │ │ ├── RefererConfig.php │ │ │ ├── StorageCapacityConfig.php │ │ │ ├── UploadInfo.php │ │ │ ├── WebsiteConfig.php │ │ │ ├── XmlConfig.php │ │ │ └── index.html │ │ ├── OssClient.php │ │ ├── Result │ │ │ ├── AclResult.php │ │ │ ├── AppendResult.php │ │ │ ├── BodyResult.php │ │ │ ├── CallbackResult.php │ │ │ ├── CopyObjectResult.php │ │ │ ├── DeleteObjectsResult.php │ │ │ ├── ExistResult.php │ │ │ ├── GetCnameResult.php │ │ │ ├── GetCorsResult.php │ │ │ ├── GetLifecycleResult.php │ │ │ ├── GetLiveChannelHistoryResult.php │ │ │ ├── GetLiveChannelInfoResult.php │ │ │ ├── GetLiveChannelStatusResult.php │ │ │ ├── GetLocationResult.php │ │ │ ├── GetLoggingResult.php │ │ │ ├── GetRefererResult.php │ │ │ ├── GetStorageCapacityResult.php │ │ │ ├── GetWebsiteResult.php │ │ │ ├── HeaderResult.php │ │ │ ├── InitiateMultipartUploadResult.php │ │ │ ├── ListBucketsResult.php │ │ │ ├── ListLiveChannelResult.php │ │ │ ├── ListMultipartUploadResult.php │ │ │ ├── ListObjectsResult.php │ │ │ ├── ListPartsResult.php │ │ │ ├── PutLiveChannelResult.php │ │ │ ├── PutSetDeleteResult.php │ │ │ ├── Result.php │ │ │ ├── SymlinkResult.php │ │ │ ├── UploadPartResult.php │ │ │ └── index.html │ │ └── index.html │ │ └── index.html │ └── index.html ├── config ├── app.config_example.php ├── index.html ├── oss.config_example.php └── static.config_example.json ├── ext └── DPlayer │ ├── DPlayer.min.css │ ├── DPlayer.min.js │ ├── README.md │ └── index.html ├── index.html └── static ├── h5ai ├── README.md └── public │ ├── css │ └── styles.css │ ├── font │ ├── poppin.eot │ └── poppin.ttf │ └── images │ ├── ext │ └── playvideo.svg │ ├── fallback │ ├── file.png │ ├── folder-parent.png │ └── folder.png │ ├── favicon │ ├── favicon-152.png │ ├── favicon-16-32.ico │ ├── favicon-16.png │ ├── favicon-32.png │ └── favicon.svg │ ├── themes │ ├── .editorconfig │ ├── README.md │ ├── comity │ │ ├── ar-apk.svg │ │ ├── ar-deb.svg │ │ ├── ar-rpm.svg │ │ ├── txt-css.svg │ │ ├── txt-go.svg │ │ ├── txt-html.svg │ │ ├── txt-js.svg │ │ ├── txt-less.svg │ │ ├── txt-md.svg │ │ ├── txt-php.svg │ │ ├── txt-py.svg │ │ ├── txt-rb.svg │ │ ├── txt-rust.svg │ │ ├── txt-script.svg │ │ └── x-pdf.svg │ └── h5ai-0.27 │ │ ├── ar.svg │ │ ├── aud.svg │ │ ├── bin.svg │ │ ├── file.svg │ │ ├── folder-page.svg │ │ ├── folder-parent.svg │ │ ├── folder.svg │ │ ├── img.svg │ │ ├── txt.svg │ │ ├── vid.svg │ │ └── x.svg │ └── ui │ ├── back.svg │ ├── crumb.svg │ ├── download.svg │ ├── filter.svg │ ├── info-toggle.svg │ ├── paypal.svg │ ├── preview-close.svg │ ├── preview-fullscreen.svg │ ├── preview-next.svg │ ├── preview-no-fullscreen.svg │ ├── preview-prev.svg │ ├── preview-raw.svg │ ├── search.svg │ ├── selected.svg │ ├── sidebar.svg │ ├── sort.svg │ ├── spinner.svg │ ├── tree-indicator.svg │ ├── tree-toggle.svg │ ├── view-details.svg │ ├── view-grid.svg │ └── view-icons.svg └── script ├── jquery-3.3.1.min.js ├── jquery.cookie.js └── main.js /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /config/app.config.php 2 | /config/oss.config.php 3 | /config/static.config.json 4 | /dev/ -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # hfs4OSS 2 | 3 | ## 更新日志/ChangeLog 4 | ### version 2.4.1 2019-03-26 5 | ``` 6 | [修复] 全站验证开关无效的问题 7 | [优化] 视频播放功能调用细节 8 | ``` 9 | ### version 2.4.1 2018-11-28 10 | ``` 11 | [修复] 导致IE下无法使用的部分问题 12 | ``` 13 | ### version 2.4.0 2018-06-17 14 | ``` 15 | [新增] 视频在线播放 16 | [优化] 前端运行逻辑 17 | [优化] 前端显示细节,修改默认字体 18 | ``` 19 | ### version 2.3.1 2018-06-05 20 | ``` 21 | [新增] 为每个路径/文件单独设置密码 22 | [优化] 密码验证逻辑 23 | [优化] 前后端变量命名 24 | [修改] 重设check_var()判定逻辑 25 | [修改] 修改配置文件结构 26 | [优化] 前端显示细节 27 | ``` 28 | ATTENTION: app.config.php有更新 29 | ### version 2.3.0 2018-05-23 30 | ``` 31 | [修复] 顶部crumbbar最后一级指向出错, 32 | [优化] 统一前后端命名 33 | [优化] 异常捕获逻辑 34 | [优化] 配置文件结构 35 | [优化] 配置文件引入逻辑 36 | [优化] action输出结构 37 | [优化] 前端显示细节 38 | ``` 39 | ATTENTION: app.config.php、oss.config.php有更新 40 | ### version 2.2.2 2018-05-18 41 | ``` 42 | [修复] 进入新目录时排序方式出错的问题 43 | [修复] 时区报错问题 44 | [修复] 部分图标无法显示的问题 45 | [修改] 前端显示细节 46 | [优化] 后端运行逻辑 47 | ``` 48 | ### version 2.2.1 2018-05-12 49 | ``` 50 | [新增] 列表排序,可以根据名称、修改时间、大小来升降序排列 51 | [优化] 数据格式化逻辑 52 | ``` 53 | ### version 2.2.0 2018-05-04 54 | ``` 55 | [新增] 简单的访问验证功能 56 | [优化] 减小程序体积,去除无用文件 57 | ATTENTION: app.config.php有更新 58 | ``` 59 | ### version 2.1.0 2018-04-22 60 | ``` 61 | [新增] 根据文件后缀名显示不同的图标 62 | [修复] 前端ajax异步请求导致的错误 63 | ``` 64 | ### version 2.0.4 2018-04-20 65 | ``` 66 | [修复] 懒惰导致的列表中与路径同名的名称无法被正常裁剪 67 | [优化] 前端部分显示细节 68 | [项目] 弃用直接拼合方式生成文件下载URL 69 | ``` 70 | ### version 2.0.3 2018-04-17 71 | ``` 72 | [新增] 文件最后修改时间显示 73 | [优化] 前端部分显示细节 74 | [项目] 优化项目逻辑结构和config参数、文件名称 75 | ``` 76 | ### version 2.0.2 2018-04-16 77 | ``` 78 | [新增] 文件大小显示 79 | [优化] encodeURL()入参的路径,防止出现莫名其妙的Bug 80 | [优化] 前端点击文件下载体验,简单防止恶意请求 81 | [优化] 前端部分显示细节 82 | ``` 83 | ### version 2.0.1 2018-04-13 84 | ``` 85 | [优化] JavaScirpt代码运行逻辑 86 | [优化] 前端部分显示细节 87 | [修复] 文件URL带特殊符号时下载不正常 88 | ``` 89 | ### version 2.0.0 2018-04-12 90 | ``` 91 | [项目] 代码完全重构 92 | ``` 93 | ### version 1.0.4 2017-09-30 94 | ``` 95 | [优化] 上方crumbbar路径多级显示 96 | [优化] 页面标题只显示当前目录名称 97 | ``` 98 | ### version 1.0.3 2017-08-12 99 | ``` 100 | [优化] 获得上层目录名称和上层目录路径的算法 101 | [修复] 路径层级到某一数量后上一级文件夹名称显示不正常 102 | ``` 103 | ### version 1.0.2 2017-06-17 104 | ``` 105 | [修复] folder或item不存在时遍历数组产生报错信息 106 | ``` 107 | ### version 1.0.1 2017-06-17 108 | ``` 109 | [新增] 底部程序版本信息 110 | [修复] items链接指向错误 111 | [修复] 底部时间错误,tips:date('Y-m-d H:i:s') 112 | ``` 113 | ### version 1.0.0 2017-06-17 114 | ``` 115 | [项目] 破壳。 116 | ``` -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-2018 YXuuan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hfs4OSS 2 | 在具备PHP代码执行环境和OSS对象存储服务的条件下,作为云HTTP文件服务器,提供简单的文件列表、上传下载、管理等功能。 3 | 相较于将文件直接存放在本地,无存储总量限制、传输速率限制、低可靠数据安全等问题。 4 | 对于移动终端也有良好的支持性。 5 | 6 | SDK:aliyun-oss-php-[sdk](https://promotion.aliyun.com/ntms/act/ossdoclist.html)-2.3.0 7 | 样式:[h5ai](https://larsjung.de/h5ai/) v0.29.0 8 | 9 | ## 预览/Demo 10 | ![image](https://yxuuan.github.io/hfs4oss-demo/v2.2.0.png) 11 | 12 | ## 部署/Build 13 | * 环境: 14 | PHP 5 >= 5.3,cURL()支持 15 | * 下载: 16 | Releases:[https://github.com/YXuuan/hfs4OSS/releases/](https://github.com/YXuuan/hfs4OSS/releases/), 17 | 或使用git: 18 | ~~~ 19 | # git clone https://github.com/YXuuan/hfs4OSS.git 20 | ~~~ 21 | * 更新: 22 | Releases:[https://github.com/YXuuan/hfs4OSS/releases/](https://github.com/YXuuan/hfs4OSS/releases/), 23 | 或使用git 24 | * 配置OSS服务: 25 | 1. 开通OSS服务、新建存储空间、上传文件:[OSS新手入门](https://promotion.aliyun.com/ntms/ossedu2.html) 26 | 2. 了解基本的OSS属性信息,得到Endpoint 27 | 3. 申请具有对应访问权限的AccessKey 28 | * 配置: 29 | 填写APP配置文件config/app.config.php 30 | ``` 31 | ROOT_DIR :(str)根目录路径,类似于FTP服务器的虚拟目录显示(例如此项为"photo/"则会将photo文件夹下的内容当作根目录显示),为空则为不设置; 32 | 注意:必须以"/"结尾且开头无需用"/"表示根目录 33 | SIGNEDURL_TIMEOUT :(int)每次下载文件时请求的签名URL有效期时长(秒)。缺省值:3600; 34 | SHOW_FILEDATE :(bool)是否显示文件修改时间; 35 | ROOT_AUTH :(arr)全站访问验证: 36 | [ 37 | ENABLED :(bool)是否开启, 38 | PASSWORD :(str)访问密码,程序将在首次访问时要求输入,为空则为不设置, 39 | FIRSTMET :(str)首次时提示的信息, 40 | IFWRONG :(str)密码错误的提示信息; 41 | ]; 42 | AUTH :(arr)目录访问验证: 43 | [ :一个数组设置一个路径,详见example 44 | PATH :(str)需要验证的路径(包含ROOT_DIR的绝对路径), 45 | ENABLED :(bool)是否开启, 46 | PASSWORD :(str)访问密码,程序将在首次访问时要求输入,为空则为不设置, 47 | FIRSTMET :(str)首次时提示的信息, 48 | IFWRONG :(str)密码错误的提示信息; 49 | ], 50 | [ 51 | ... 52 | ], 53 | ...; 54 | ``` 55 | 填写OSS配置文件config/oss.config.json: 56 | ``` 57 | ACCESS_ID :(str)AccessKey ID值; 58 | ACCESS_KEY :(str)AccessKey Key值; 59 | ENDPOINT :(str)Endpoint值; 60 | 注意:必须带前缀http://或https:// 61 | ENDPOINT_IS_CNAME :(bool)如果Endpoint为自定义域名,此项为true; 62 | BUCKET :(str)存储空间(Bucket)名; 63 | ``` 64 | 前端配置文件config/static.config.json: 65 | ``` 66 | SITE_NAME :(str)站点名称; 67 | SHOW_STATS :(bool)底部是否显示状态信息,缺省值为true; 68 | FOOTER :(str)底部Footer的HTML代码; 69 | ``` 70 | * 文件结构: 71 | ``` 72 | / 73 | ├──app/ --后端目录 74 | ├──action/ --后端入口目录 75 | ├──class/ --类库 76 | ├──function/ --函数库 77 | └──sdk/ --SDK目录 78 | ├──config/ --配置文件目录 79 | ├──app.config.php --后端配置文件 80 | ├──oss.config.php --OSS配置文件 81 | └──static.config.json --前端配置文件 82 | ├──static/ --前端目录 83 | ├──_h5ai/ --h5ai目录 84 | └──script/ --前端脚本 85 | └──index.html 86 | ``` 87 | ## 更新日志/ChangeLog 88 | ``` 89 | version 2.4.1 2019-03-26 90 | [修复] 全站验证开关无效的问题 91 | [优化] 视频播放功能调用细节 92 | ``` 93 | 更多:[CHANGELOG.md](https://github.com/YXuuan/hfs4OSS/blob/master/CHANGELOG.md) 94 | 95 | ## 使用到的开源项目/Reference 96 | * lrsjng/h5ai(MIT) 97 | https://github.com/lrsjng/h5ai 98 | * MoePlayer/DPlayer(MIT) 99 | https://github.com/MoePlayer/DPlayer 100 | 101 | ## 已知的问题/Problems 102 | ``` 103 | 顶部crumbbar过长时无法展示也无法收缩 104 | :歇菜 105 | [已解决]直接通过url锚值入参访问某级目录时,父目录和当前目录共包含有两个及以上密码配置时无法正确请求 106 | :尽量避免父目录和子目录同时包含有密码或将子目录密码配置居于AUTH数组中较上的位置 107 | ``` 108 | 109 | ## 后续可能的改动/Preview 110 | ``` 111 | [划掉]给不同类型的文件不一样的图标 112 | [划掉]输出item的大小 113 | 批量下载(非压缩闭包) 114 | 简单的object管理功能(上传,重命名等) 115 | [划掉]列表排序 116 | [划掉]不同的路径不同的密码 117 | 前端多国语言支持 118 | 前端自定义文本支持 119 | 多站点配置支持 120 | 安装向导 121 | ``` 122 | 123 | ## 开源协议/License 124 | ``` 125 | MIT License 126 | 127 | Copyright (c) 2017-2018 YXuuan 128 | 129 | Permission is hereby granted, free of charge, to any person obtaining a copy 130 | of this software and associated documentation files (the "Software"), to deal 131 | in the Software without restriction, including without limitation the rights 132 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 133 | copies of the Software, and to permit persons to whom the Software is 134 | furnished to do so, subject to the following conditions: 135 | 136 | The above copyright notice and this permission notice shall be included in all 137 | copies or substantial portions of the Software. 138 | 139 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 140 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 141 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 142 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 143 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 144 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 145 | SOFTWARE. 146 | ``` 147 | -------------------------------------------------------------------------------- /app/action/getSignedUrlForGettingObject.action.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/action/listObjects.action.php: -------------------------------------------------------------------------------- 1 | @check_var($_POST['prefix']) ? $APPConfig['ROOT_DIR'] . $_POST['prefix'] : $APPConfig['ROOT_DIR'], 43 | 'delimiter' => @check_var($_POST['delimiter']) ? $_POST['delimiter'] : '/', 44 | //delimiter为“/”时仅获取当前目录下内容 45 | 'max-keys' => @check_var($_POST['maxkeys']) ? $_POST['maxkeys'] : 1000, 46 | 'marker' => @check_var($_POST['marker']) ? $_POST['marker'] : '', 47 | ); 48 | $sortBy = @check_var($_POST['sortBy']) ? $_POST['sortBy'] : "name"; 49 | $descending = @check_var($_POST['descending']) ? ($_POST['descending'] == "true" ? SORT_ASC : SORT_DESC) : SORT_ASC; 50 | 51 | $ossClient = OSS::getOssClient(); 52 | $listObjectResult = OSS::listObjects($ossClient, $bucket, $options); 53 | $objectList = $listObjectResult->getObjectList(); 54 | $prefixList = $listObjectResult->getPrefixList(); 55 | if (!empty($objectList)) { 56 | if($APPConfig['SHOW_FILEDATE'] == true){ 57 | foreach($objectList as $objectInfo){ 58 | $resultToSendBack["fileList"][] = array( 59 | 'name' => substr($objectInfo->getKey(), strlen($options['prefix'])), //并去掉父级路径 60 | 'time' => strtotime($objectInfo->getLastModified()), 61 | 'size' =>$objectInfo->getSize(), 62 | ); 63 | } 64 | }else{ 65 | foreach($objectList as $objectInfo){ 66 | $resultToSendBack["fileList"][] = array( 67 | 'name' => substr($objectInfo->getKey(), strlen($options['prefix'])), //并去掉父级路径 68 | 'time' => "", 69 | 'size' =>$objectInfo->getSize(), 70 | ); 71 | } 72 | } 73 | if($options['prefix'] !== ''){ 74 | @array_shift($resultToSendBack['fileList']); //$fileList第一个object为当前目录,忽略 75 | } 76 | } 77 | if (!empty($prefixList)) { 78 | foreach ($prefixList as $prefixInfo) { 79 | $resultToSendBack["folderList"][] = array( 80 | 'name' => substr($prefixInfo->getPrefix(), strlen($options['prefix'])), //去掉父级路径放入 81 | ); 82 | } 83 | } 84 | //排序相关 85 | switch($sortBy){ 86 | case "time": 87 | @array_multisort(@array_column($resultToSendBack['fileList'], 'time'), SORT_NUMERIC, $descending, $resultToSendBack['fileList']); 88 | break; 89 | case "size": 90 | @array_multisort(@array_column($resultToSendBack['fileList'], 'size'), SORT_NUMERIC, $descending, $resultToSendBack['fileList']); 91 | break; 92 | case "name": 93 | @array_multisort(@array_column($resultToSendBack['fileList'], 'name'), SORT_STRING, $descending, $resultToSendBack['fileList']); 94 | @array_multisort(@array_column($resultToSendBack['folderList'], 'name'), SORT_STRING, $descending, $resultToSendBack['folderList']); 95 | //@array_multisort($resultToSendBack['folderList'], $descending, $resultToSendBack['folderList']); 96 | break; 97 | } 98 | $resultToSendBack['fileCount'] = @count($resultToSendBack["fileList"]); 99 | $resultToSendBack['folderCount'] = @count($resultToSendBack["folderList"]); 100 | $resultToSendBack['takes'] = floor((microtime(true) - $_SERVER['REQUEST_TIME']) * 1000); 101 | $resultToSendBack['memUsed'] = memory_get_usage(); 102 | 103 | $resultToSendBack['stat'] = $APPConfig['SHOW_FILEDATE'] == true ? 100 : 111; 104 | 105 | print(json_encode($resultToSendBack)); -------------------------------------------------------------------------------- /app/class/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/class/oss.class.php: -------------------------------------------------------------------------------- 1 | getMessage() . "\n"); 13 | return null; 14 | } 15 | return $ossClient; 16 | } 17 | public static function listObjects($ossClient, $bucket, $options){ 18 | try { 19 | $listObjectInfo = $ossClient->listObjects($bucket, $options); 20 | } catch (OssException $e) { 21 | printf(__FUNCTION__ . ": FAILED\n"); 22 | printf($e->getMessage() . "\n"); 23 | return; 24 | } 25 | return $listObjectInfo; 26 | } 27 | public static function getSignedUrlForGettingObject($ossClient, $bucket, $object, $timeout){ 28 | try{ 29 | $signedUrl = $ossClient->signUrl($bucket, $object, $timeout); 30 | } catch(OssException $e) { 31 | printf(__FUNCTION__ . ": FAILED\n"); 32 | printf($e->getMessage() . "\n"); 33 | return; 34 | } 35 | return $signedUrl; 36 | } 37 | } -------------------------------------------------------------------------------- /app/function/app.function.php: -------------------------------------------------------------------------------- 1 | $v) { 12 | $search[$k] = '`'.preg_quote($search[$k], '`').'`'; 13 | } 14 | }else{ 15 | $search = '`'.preg_quote($search, '`').'`'; 16 | } 17 | // replacement 18 | return preg_replace($search, $replace, $subject, $limit); 19 | } -------------------------------------------------------------------------------- /app/function/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/init.php: -------------------------------------------------------------------------------- 1 | "; ; 63 | $accessKeySecret = "<您从OSS获得的AccessKeySecret>"; 64 | $endpoint = "<您选定的OSS数据中心访问域名,例如oss-cn-hangzhou.aliyuncs.com>"; 65 | try { 66 | $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint); 67 | } catch (OssException $e) { 68 | print $e->getMessage(); 69 | } 70 | ``` 71 | 72 | ### 文件操作 73 | 74 | 文件(又称对象,Object)是OSS中最基本的数据单元,您可以把它简单地理解为文件,用下面代码可以实现一个Object的上传: 75 | 76 | ```php 77 | "; 79 | $object = "<您使用的Object名字,注意命名规范>"; 80 | $content = "Hello, OSS!"; // 上传的文件内容 81 | try { 82 | $ossClient->putObject($bucket, $object, $content); 83 | } catch (OssException $e) { 84 | print $e->getMessage(); 85 | } 86 | ``` 87 | 88 | ### 存储空间操作 89 | 90 | 存储空间(又称Bucket)是一个用户用来管理所存储Object的存储空间,对于用户来说是一个管理Object的单元,所有的Object都必须隶属于某个Bucket。您可以按照下面的代码新建一个Bucket: 91 | 92 | ```php 93 | "; 95 | try { 96 | $ossClient->createBucket($bucket); 97 | } catch (OssException $e) { 98 | print $e->getMessage(); 99 | } 100 | ``` 101 | 102 | ### 返回结果处理 103 | 104 | OssClient提供的接口返回返回数据分为两种: 105 | 106 | * Put,Delete类接口,接口返回null,如果没有OssException,即可认为操作成功 107 | * Get,List类接口,接口返回对应的数据,如果没有OssException,即可认为操作成功,举个例子: 108 | 109 | ```php 110 | listBuckets(); 112 | $bucketList = $bucketListInfo->getBucketList(); 113 | foreach($bucketList as $bucket) { 114 | print($bucket->getLocation() . "\t" . $bucket->getName() . "\t" . $bucket->getCreatedate() . "\n"); 115 | } 116 | ``` 117 | 上面代码中的$bucketListInfo的数据类型是 `OSS\Model\BucketListInfo` 118 | 119 | 120 | ### 运行Sample程序 121 | 122 | 1. 修改 `samples/Config.php`, 补充配置信息 123 | 2. 执行 `cd samples/ && php RunAll.php` 124 | 125 | ### 运行单元测试 126 | 127 | 1. 执行`composer install`下载依赖的库 128 | 2. 设置环境变量 129 | 130 | export OSS_ACCESS_KEY_ID=access-key-id 131 | export OSS_ACCESS_KEY_SECRET=access-key-secret 132 | export OSS_ENDPOINT=endpoint 133 | export OSS_BUCKET=bucket-name 134 | 135 | 3. 执行 `php vendor/bin/phpunit` 136 | 137 | ## License 138 | 139 | - MIT 140 | 141 | ## 联系我们 142 | 143 | - [阿里云OSS官方网站](http://oss.aliyun.com) 144 | - [阿里云OSS官方论坛](http://bbs.aliyun.com) 145 | - [阿里云OSS官方文档中心](http://www.aliyun.com/product/oss#Docs) 146 | - 阿里云官方技术支持:[提交工单](https://workorder.console.aliyun.com/#/ticket/createIndex) 147 | 148 | [releases-page]: https://github.com/aliyun/aliyun-oss-php-sdk/releases 149 | [phar-composer]: https://github.com/clue/phar-composer 150 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/README.md: -------------------------------------------------------------------------------- 1 | # Alibaba Cloud OSS SDK for PHP 2 | 3 | [![Latest Stable Version](https://poser.pugx.org/aliyuncs/oss-sdk-php/v/stable)](https://packagist.org/packages/aliyuncs/oss-sdk-php) 4 | [![Build Status](https://travis-ci.org/aliyun/aliyun-oss-php-sdk.svg?branch=master)](https://travis-ci.org/aliyun/aliyun-oss-php-sdk) 5 | [![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) 6 | 7 | ## [README of Chinese](https://github.com/aliyun/aliyun-oss-php-sdk/blob/master/README-CN.md) 8 | 9 | ## Overview 10 | 11 | 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. 12 | 13 | 14 | ## Run environment 15 | - PHP 5.3+. 16 | - cURL extension. 17 | 18 | Tips: 19 | 20 | - In Ubuntu, you can use the ***apt-get*** package manager to install the *PHP cURL extension*: `sudo apt-get install php5-curl`. 21 | 22 | ## Install OSS PHP SDK 23 | 24 | - If you use the ***composer*** to manage project dependencies, run the following command in your project's root directory: 25 | 26 | composer require aliyuncs/oss-sdk-php 27 | 28 | You can also declare the dependency on Alibaba Cloud OSS SDK for PHP in the `composer.json` file. 29 | 30 | "require": { 31 | "aliyuncs/oss-sdk-php": "~2.0" 32 | } 33 | 34 | Then run `composer install` to install the dependency. After the Composer Dependency Manager is installed, import the dependency in your PHP code: 35 | 36 | require_once __DIR__ . '/vendor/autoload.php'; 37 | 38 | - You can also directly download the packaged [PHAR File][releases-page], and 39 | introduce the file to your code: 40 | 41 | require_once '/path/to/oss-sdk-php.phar'; 42 | 43 | - Download the SDK source code, and introduce the `autoload.php` file under the SDK directory to your code: 44 | 45 | require_once '/path/to/oss-sdk/autoload.php'; 46 | 47 | ## Quick use 48 | 49 | ### Common classes 50 | 51 | | Class | Explanation | 52 | |:------------------|:------------------------------------| 53 | |OSS\OSSClient | OSS client class. An OSSClient instance can be used to call the interface. | 54 | |OSS\Core\OSSException |OSS Exception class . You only need to pay attention to this exception when you use the OSSClient. | 55 | 56 | ### Initialize an OSSClient 57 | 58 | The SDK's operations for the OSS are performed through the OSSClient class. The code below creates an OSSClient object: 59 | 60 | ```php 61 | "; 63 | $accessKeySecret = ""; 64 | $endpoint = ""; 65 | try { 66 | $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint); 67 | } catch (OssException $e) { 68 | print $e->getMessage(); 69 | } 70 | ``` 71 | 72 | ### Operations on objects 73 | 74 | Objects are the most basic data units on the OSS. You can simply consider objects as files. The following code uploads an object: 75 | 76 | ```php 77 | "; 79 | $object = ""; 80 | $content = "Hello, OSS!"; // Content of the uploaded file 81 | try { 82 | $ossClient->putObject($bucket, $object, $content); 83 | } catch (OssException $e) { 84 | print $e->getMessage(); 85 | } 86 | ``` 87 | 88 | ### Operations on buckets 89 | 90 | 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: 91 | 92 | ```php 93 | "; 95 | try { 96 | $ossClient->createBucket($bucket); 97 | } catch (OssException $e) { 98 | print $e->getMessage(); 99 | } 100 | ``` 101 | 102 | ### Handle returned results 103 | 104 | The OSSClient provides the following two types of returned data from interfaces: 105 | 106 | - Put and Delete interfaces: The *PUT* and *DELETE* operations are deemed successful if *null* is returned by the interfaces without *OSSException*. 107 | - 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, 108 | 109 | ```php 110 | listBuckets(); 112 | $bucketList = $bucketListInfo->getBucketList(); 113 | foreach($bucketList as $bucket) { 114 | print($bucket->getLocation() . "\t" . $bucket->getName() . "\t" . $bucket->getCreatedate() . "\n"); 115 | } 116 | ``` 117 | In the above code, $bucketListInfo falls into the 'OSS\Model\BucketListInfo' data type. 118 | 119 | 120 | ### Run a sample project 121 | 122 | - Modify `samples/Config.php` to complete the configuration information. 123 | - Run `cd samples/ && php RunAll.php`. 124 | 125 | ### Run a unit test 126 | 127 | - Run `composer install` to download the dependent libraries. 128 | - Set the environment variable. 129 | 130 | export OSS_ACCESS_KEY_ID=access-key-id 131 | export OSS_ACCESS_KEY_SECRET=access-key-secret 132 | export OSS_ENDPOINT=endpoint 133 | export OSS_BUCKET=bucket-name 134 | 135 | - Run `php vendor/bin/phpunit` 136 | 137 | ## License 138 | 139 | - MIT 140 | 141 | ## Contact us 142 | 143 | - [Alibaba Cloud OSS official website](http://oss.aliyun.com). 144 | - [Alibaba Cloud OSS official forum](http://bbs.aliyun.com). 145 | - [Alibaba Cloud OSS official documentation center](http://www.aliyun.com/product/oss#Docs). 146 | - Alibaba Cloud official technical support: [Submit a ticket](https://workorder.console.aliyun.com/#/ticket/createIndex). 147 | 148 | [releases-page]: https://github.com/aliyun/aliyun-oss-php-sdk/releases 149 | [phar-composer]: https://github.com/clue/phar-composer 150 | 151 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/autoload.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Core/OssException.php: -------------------------------------------------------------------------------- 1 | details = $details; 24 | } else { 25 | $message = $details; 26 | parent::__construct($message); 27 | } 28 | } 29 | 30 | public function getHTTPStatus() 31 | { 32 | return isset($this->details['status']) ? $this->details['status'] : ''; 33 | } 34 | 35 | public function getRequestId() 36 | { 37 | return isset($this->details['request-id']) ? $this->details['request-id'] : ''; 38 | } 39 | 40 | public function getErrorCode() 41 | { 42 | return isset($this->details['code']) ? $this->details['code'] : ''; 43 | } 44 | 45 | public function getErrorMessage() 46 | { 47 | return isset($this->details['message']) ? $this->details['message'] : ''; 48 | } 49 | 50 | public function getDetails() 51 | { 52 | return isset($this->details['body']) ? $this->details['body'] : ''; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Http/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006-2010 Ryan Parman, Foleeo Inc., and contributors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are 4 | permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of 7 | conditions and the following disclaimer. 8 | 9 | * Redistributions in binary form must reproduce the above copyright notice, this list 10 | of conditions and the following disclaimer in the documentation and/or other materials 11 | provided with the distribution. 12 | 13 | * Neither the name of Ryan Parman, Foleeo Inc. nor the names of its contributors may be used to 14 | endorse or promote products derived from this software without specific prior written 15 | permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 18 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 19 | AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS 20 | AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Http/RequestCore_Exception.php: -------------------------------------------------------------------------------- 1 | ). 29 | * @param string $body (Required) XML-formatted response from AWS. 30 | * @param integer $status (Optional) HTTP response status code from the request. 31 | * @return Mixed Contains an `header` property (HTTP headers as an associative array), a or `body` property, and an `status` code. 32 | */ 33 | public function __construct($header, $body, $status = null) 34 | { 35 | $this->header = $header; 36 | $this->body = $body; 37 | $this->status = $status; 38 | 39 | return $this; 40 | } 41 | 42 | /** 43 | * Did we receive the status code we expected? 44 | * 45 | * @param integer|array $codes (Optional) The status code(s) to expect. Pass an for a single acceptable value, or an of integers for multiple acceptable values. 46 | * @return boolean Whether we received the expected status code or not. 47 | */ 48 | public function isOK($codes = array(200, 201, 204, 206)) 49 | { 50 | if (is_array($codes)) { 51 | return in_array($this->status, $codes); 52 | } 53 | 54 | return $this->status === $codes; 55 | } 56 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Http/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/BucketInfo.php: -------------------------------------------------------------------------------- 1 | location = $location; 24 | $this->name = $name; 25 | $this->createDate = $createDate; 26 | } 27 | 28 | /** 29 | * 得到bucket所在的region 30 | * 31 | * @return string 32 | */ 33 | public function getLocation() 34 | { 35 | return $this->location; 36 | } 37 | 38 | /** 39 | * 得到bucket的名称 40 | * 41 | * @return string 42 | */ 43 | public function getName() 44 | { 45 | return $this->name; 46 | } 47 | 48 | /** 49 | * 得到bucket的创建时间 50 | * 51 | * @return string 52 | */ 53 | public function getCreateDate() 54 | { 55 | return $this->createDate; 56 | } 57 | 58 | /** 59 | * bucket所在的region 60 | * 61 | * @var string 62 | */ 63 | private $location; 64 | /** 65 | * bucket的名称 66 | * 67 | * @var string 68 | */ 69 | private $name; 70 | 71 | /** 72 | * bucket的创建事件 73 | * 74 | * @var string 75 | */ 76 | private $createDate; 77 | 78 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/BucketListInfo.php: -------------------------------------------------------------------------------- 1 | bucketList = $bucketList; 21 | } 22 | 23 | /** 24 | * 得到BucketInfo列表 25 | * 26 | * @return BucketInfo[] 27 | */ 28 | public function getBucketList() 29 | { 30 | return $this->bucketList; 31 | } 32 | 33 | /** 34 | * BucketInfo信息列表 35 | * 36 | * @var array 37 | */ 38 | private $bucketList = array(); 39 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/CnameConfig.php: -------------------------------------------------------------------------------- 1 | cnameList = array(); 20 | } 21 | 22 | /** 23 | * @return array 24 | * @example 25 | * array(2) { 26 | * [0]=> 27 | * array(3) { 28 | * ["Domain"]=> 29 | * string(11) "www.foo.com" 30 | * ["Status"]=> 31 | * string(7) "enabled" 32 | * ["LastModified"]=> 33 | * string(8) "20150101" 34 | * } 35 | * [1]=> 36 | * array(3) { 37 | * ["Domain"]=> 38 | * string(7) "bar.com" 39 | * ["Status"]=> 40 | * string(8) "disabled" 41 | * ["LastModified"]=> 42 | * string(8) "20160101" 43 | * } 44 | * } 45 | */ 46 | public function getCnames() 47 | { 48 | return $this->cnameList; 49 | } 50 | 51 | 52 | public function addCname($cname) 53 | { 54 | if (count($this->cnameList) >= self::OSS_MAX_RULES) { 55 | throw new OssException( 56 | "num of cname in the config exceeds self::OSS_MAX_RULES: " . strval(self::OSS_MAX_RULES)); 57 | } 58 | $this->cnameList[] = array('Domain' => $cname); 59 | } 60 | 61 | public function parseFromXml($strXml) 62 | { 63 | $xml = simplexml_load_string($strXml); 64 | if (!isset($xml->Cname)) return; 65 | foreach ($xml->Cname as $entry) { 66 | $cname = array(); 67 | foreach ($entry as $key => $value) { 68 | $cname[strval($key)] = strval($value); 69 | } 70 | $this->cnameList[] = $cname; 71 | } 72 | } 73 | 74 | public function serializeToXml() 75 | { 76 | $strXml = << 78 | 79 | 80 | EOF; 81 | $xml = new \SimpleXMLElement($strXml); 82 | foreach ($this->cnameList as $cname) { 83 | $node = $xml->addChild('Cname'); 84 | foreach ($cname as $key => $value) { 85 | $node->addChild($key, $value); 86 | } 87 | } 88 | return $xml->asXML(); 89 | } 90 | 91 | public function __toString() 92 | { 93 | return $this->serializeToXml(); 94 | } 95 | 96 | const OSS_MAX_RULES = 10; 97 | 98 | private $cnameList = array(); 99 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/CorsConfig.php: -------------------------------------------------------------------------------- 1 | rules = array(); 22 | } 23 | 24 | /** 25 | * 得到CorsRule列表 26 | * 27 | * @return CorsRule[] 28 | */ 29 | public function getRules() 30 | { 31 | return $this->rules; 32 | } 33 | 34 | 35 | /** 36 | * 添加一条CorsRule 37 | * 38 | * @param CorsRule $rule 39 | * @throws OssException 40 | */ 41 | public function addRule($rule) 42 | { 43 | if (count($this->rules) >= self::OSS_MAX_RULES) { 44 | throw new OssException("num of rules in the config exceeds self::OSS_MAX_RULES: " . strval(self::OSS_MAX_RULES)); 45 | } 46 | $this->rules[] = $rule; 47 | } 48 | 49 | /** 50 | * 从xml数据中解析出CorsConfig 51 | * 52 | * @param string $strXml 53 | * @throws OssException 54 | * @return null 55 | */ 56 | public function parseFromXml($strXml) 57 | { 58 | $xml = simplexml_load_string($strXml); 59 | if (!isset($xml->CORSRule)) return; 60 | foreach ($xml->CORSRule as $rule) { 61 | $corsRule = new CorsRule(); 62 | foreach ($rule as $key => $value) { 63 | if ($key === self::OSS_CORS_ALLOWED_HEADER) { 64 | $corsRule->addAllowedHeader(strval($value)); 65 | } elseif ($key === self::OSS_CORS_ALLOWED_METHOD) { 66 | $corsRule->addAllowedMethod(strval($value)); 67 | } elseif ($key === self::OSS_CORS_ALLOWED_ORIGIN) { 68 | $corsRule->addAllowedOrigin(strval($value)); 69 | } elseif ($key === self::OSS_CORS_EXPOSE_HEADER) { 70 | $corsRule->addExposeHeader(strval($value)); 71 | } elseif ($key === self::OSS_CORS_MAX_AGE_SECONDS) { 72 | $corsRule->setMaxAgeSeconds(strval($value)); 73 | } 74 | } 75 | $this->addRule($corsRule); 76 | } 77 | return; 78 | } 79 | 80 | /** 81 | * 生成xml字符串 82 | * 83 | * @return string 84 | */ 85 | public function serializeToXml() 86 | { 87 | $xml = new \SimpleXMLElement(''); 88 | foreach ($this->rules as $rule) { 89 | $xmlRule = $xml->addChild('CORSRule'); 90 | $rule->appendToXml($xmlRule); 91 | } 92 | return $xml->asXML(); 93 | } 94 | 95 | public function __toString() 96 | { 97 | return $this->serializeToXml(); 98 | } 99 | 100 | const OSS_CORS_ALLOWED_ORIGIN = 'AllowedOrigin'; 101 | const OSS_CORS_ALLOWED_METHOD = 'AllowedMethod'; 102 | const OSS_CORS_ALLOWED_HEADER = 'AllowedHeader'; 103 | const OSS_CORS_EXPOSE_HEADER = 'ExposeHeader'; 104 | const OSS_CORS_MAX_AGE_SECONDS = 'MaxAgeSeconds'; 105 | const OSS_MAX_RULES = 10; 106 | 107 | /** 108 | * orsRule列表 109 | * 110 | * @var CorsRule[] 111 | */ 112 | private $rules = array(); 113 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/CorsRule.php: -------------------------------------------------------------------------------- 1 | allowedOrigins[] = $allowedOrigin; 24 | } 25 | } 26 | 27 | /** 28 | * Rule中增加一条allowedMethod 29 | * 30 | * @param string $allowedMethod 31 | */ 32 | public function addAllowedMethod($allowedMethod) 33 | { 34 | if (!empty($allowedMethod)) { 35 | $this->allowedMethods[] = $allowedMethod; 36 | } 37 | } 38 | 39 | /** 40 | * Rule中增加一条allowedHeader 41 | * 42 | * @param string $allowedHeader 43 | */ 44 | public function addAllowedHeader($allowedHeader) 45 | { 46 | if (!empty($allowedHeader)) { 47 | $this->allowedHeaders[] = $allowedHeader; 48 | } 49 | } 50 | 51 | /** 52 | * Rule中增加一条exposeHeader 53 | * 54 | * @param string $exposeHeader 55 | */ 56 | public function addExposeHeader($exposeHeader) 57 | { 58 | if (!empty($exposeHeader)) { 59 | $this->exposeHeaders[] = $exposeHeader; 60 | } 61 | } 62 | 63 | /** 64 | * @return int 65 | */ 66 | public function getMaxAgeSeconds() 67 | { 68 | return $this->maxAgeSeconds; 69 | } 70 | 71 | /** 72 | * @param int $maxAgeSeconds 73 | */ 74 | public function setMaxAgeSeconds($maxAgeSeconds) 75 | { 76 | $this->maxAgeSeconds = $maxAgeSeconds; 77 | } 78 | 79 | /** 80 | * 得到AllowedHeaders列表 81 | * 82 | * @return string[] 83 | */ 84 | public function getAllowedHeaders() 85 | { 86 | return $this->allowedHeaders; 87 | } 88 | 89 | /** 90 | * 得到AllowedOrigins列表 91 | * 92 | * @return string[] 93 | */ 94 | public function getAllowedOrigins() 95 | { 96 | return $this->allowedOrigins; 97 | } 98 | 99 | /** 100 | * 得到AllowedMethods列表 101 | * 102 | * @return string[] 103 | */ 104 | public function getAllowedMethods() 105 | { 106 | return $this->allowedMethods; 107 | } 108 | 109 | /** 110 | * 得到ExposeHeaders列表 111 | * 112 | * @return string[] 113 | */ 114 | public function getExposeHeaders() 115 | { 116 | return $this->exposeHeaders; 117 | } 118 | 119 | /** 120 | * 根据提供的xmlRule, 把this按照一定的规则插入到$xmlRule中 121 | * 122 | * @param \SimpleXMLElement $xmlRule 123 | * @throws OssException 124 | */ 125 | public function appendToXml(&$xmlRule) 126 | { 127 | if (!isset($this->maxAgeSeconds)) { 128 | throw new OssException("maxAgeSeconds is not set in the Rule"); 129 | } 130 | foreach ($this->allowedOrigins as $allowedOrigin) { 131 | $xmlRule->addChild(CorsConfig::OSS_CORS_ALLOWED_ORIGIN, $allowedOrigin); 132 | } 133 | foreach ($this->allowedMethods as $allowedMethod) { 134 | $xmlRule->addChild(CorsConfig::OSS_CORS_ALLOWED_METHOD, $allowedMethod); 135 | } 136 | foreach ($this->allowedHeaders as $allowedHeader) { 137 | $xmlRule->addChild(CorsConfig::OSS_CORS_ALLOWED_HEADER, $allowedHeader); 138 | } 139 | foreach ($this->exposeHeaders as $exposeHeader) { 140 | $xmlRule->addChild(CorsConfig::OSS_CORS_EXPOSE_HEADER, $exposeHeader); 141 | } 142 | $xmlRule->addChild(CorsConfig::OSS_CORS_MAX_AGE_SECONDS, strval($this->maxAgeSeconds)); 143 | } 144 | 145 | private $allowedHeaders = array(); 146 | private $allowedOrigins = array(); 147 | private $allowedMethods = array(); 148 | private $exposeHeaders = array(); 149 | private $maxAgeSeconds = null; 150 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/GetLiveChannelHistory.php: -------------------------------------------------------------------------------- 1 | liveRecordList; 13 | } 14 | 15 | public function parseFromXml($strXml) 16 | { 17 | $xml = simplexml_load_string($strXml); 18 | 19 | if (isset($xml->LiveRecord)) { 20 | foreach ($xml->LiveRecord as $record) { 21 | $liveRecord = new LiveChannelHistory(); 22 | $liveRecord->parseFromXmlNode($record); 23 | $this->liveRecordList[] = $liveRecord; 24 | } 25 | } 26 | } 27 | 28 | public function serializeToXml() 29 | { 30 | throw new OssException("Not implemented."); 31 | } 32 | 33 | private $liveRecordList = array(); 34 | } 35 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/GetLiveChannelInfo.php: -------------------------------------------------------------------------------- 1 | description; 13 | } 14 | 15 | public function getStatus() 16 | { 17 | return $this->status; 18 | } 19 | 20 | public function getType() 21 | { 22 | return $this->type; 23 | } 24 | 25 | public function getFragDuration() 26 | { 27 | return $this->fragDuration; 28 | } 29 | 30 | public function getFragCount() 31 | { 32 | return $this->fragCount; 33 | } 34 | 35 | public function getPlayListName() 36 | { 37 | return $this->playlistName; 38 | } 39 | 40 | public function parseFromXml($strXml) 41 | { 42 | $xml = simplexml_load_string($strXml); 43 | 44 | $this->description = strval($xml->Description); 45 | $this->status = strval($xml->Status); 46 | 47 | if (isset($xml->Target)) { 48 | foreach ($xml->Target as $target) { 49 | $this->type = strval($target->Type); 50 | $this->fragDuration = strval($target->FragDuration); 51 | $this->fragCount = strval($target->FragCount); 52 | $this->playlistName = strval($target->PlaylistName); 53 | } 54 | } 55 | } 56 | 57 | public function serializeToXml() 58 | { 59 | throw new OssException("Not implemented."); 60 | } 61 | 62 | private $description; 63 | private $status; 64 | private $type; 65 | private $fragDuration; 66 | private $fragCount; 67 | private $playlistName; 68 | } 69 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/GetLiveChannelStatus.php: -------------------------------------------------------------------------------- 1 | status; 13 | } 14 | 15 | public function getConnectedTime() 16 | { 17 | return $this->connectedTime; 18 | } 19 | 20 | public function getRemoteAddr() 21 | { 22 | return $this->remoteAddr; 23 | } 24 | 25 | public function getVideoWidth() 26 | { 27 | return $this->videoWidth; 28 | } 29 | public function getVideoHeight() 30 | { 31 | return $this->videoHeight; 32 | } 33 | public function getVideoFrameRate() 34 | { 35 | return $this->videoFrameRate; 36 | } 37 | public function getVideoBandwidth() 38 | { 39 | return $this->videoBandwidth; 40 | } 41 | public function getVideoCodec() 42 | { 43 | return $this->videoCodec; 44 | } 45 | 46 | public function getAudioBandwidth() 47 | { 48 | return $this->audioBandwidth; 49 | } 50 | public function getAudioSampleRate() 51 | { 52 | return $this->audioSampleRate; 53 | } 54 | public function getAudioCodec() 55 | { 56 | return $this->audioCodec; 57 | } 58 | 59 | 60 | public function parseFromXml($strXml) 61 | { 62 | $xml = simplexml_load_string($strXml); 63 | $this->status = strval($xml->Status); 64 | $this->connectedTime = strval($xml->ConnectedTime); 65 | $this->remoteAddr = strval($xml->RemoteAddr); 66 | 67 | if (isset($xml->Video)) { 68 | foreach ($xml->Video as $video) { 69 | $this->videoWidth = intval($video->Width); 70 | $this->videoHeight = intval($video->Height); 71 | $this->videoFrameRate = intval($video->FrameRate); 72 | $this->videoBandwidth = intval($video->Bandwidth); 73 | $this->videoCodec = strval($video->Codec); 74 | } 75 | } 76 | 77 | if (isset($xml->Video)) { 78 | foreach ($xml->Audio as $audio) { 79 | $this->audioBandwidth = intval($audio->Bandwidth); 80 | $this->audioSampleRate = intval($audio->SampleRate); 81 | $this->audioCodec = strval($audio->Codec); 82 | } 83 | } 84 | 85 | } 86 | 87 | public function serializeToXml() 88 | { 89 | throw new OssException("Not implemented."); 90 | } 91 | 92 | private $status; 93 | private $connectedTime; 94 | private $remoteAddr; 95 | 96 | private $videoWidth; 97 | private $videoHeight; 98 | private $videoFrameRate; 99 | private $videoBandwidth; 100 | private $videoCodec; 101 | 102 | private $audioBandwidth; 103 | private $audioSampleRate; 104 | private $audioCodec; 105 | 106 | 107 | } 108 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LifecycleAction.php: -------------------------------------------------------------------------------- 1 | action = $action; 21 | $this->timeSpec = $timeSpec; 22 | $this->timeValue = $timeValue; 23 | } 24 | 25 | /** 26 | * @return LifecycleAction 27 | */ 28 | public function getAction() 29 | { 30 | return $this->action; 31 | } 32 | 33 | /** 34 | * @param string $action 35 | */ 36 | public function setAction($action) 37 | { 38 | $this->action = $action; 39 | } 40 | 41 | /** 42 | * @return string 43 | */ 44 | public function getTimeSpec() 45 | { 46 | return $this->timeSpec; 47 | } 48 | 49 | /** 50 | * @param string $timeSpec 51 | */ 52 | public function setTimeSpec($timeSpec) 53 | { 54 | $this->timeSpec = $timeSpec; 55 | } 56 | 57 | /** 58 | * @return string 59 | */ 60 | public function getTimeValue() 61 | { 62 | return $this->timeValue; 63 | } 64 | 65 | /** 66 | * @param string $timeValue 67 | */ 68 | public function setTimeValue($timeValue) 69 | { 70 | $this->timeValue = $timeValue; 71 | } 72 | 73 | /** 74 | * appendToXml 把actions插入到xml中 75 | * 76 | * @param \SimpleXMLElement $xmlRule 77 | */ 78 | public function appendToXml(&$xmlRule) 79 | { 80 | $xmlAction = $xmlRule->addChild($this->action); 81 | $xmlAction->addChild($this->timeSpec, $this->timeValue); 82 | } 83 | 84 | private $action; 85 | private $timeSpec; 86 | private $timeValue; 87 | 88 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LifecycleConfig.php: -------------------------------------------------------------------------------- 1 | rules = array(); 25 | $xml = simplexml_load_string($strXml); 26 | if (!isset($xml->Rule)) return; 27 | $this->rules = array(); 28 | foreach ($xml->Rule as $rule) { 29 | $id = strval($rule->ID); 30 | $prefix = strval($rule->Prefix); 31 | $status = strval($rule->Status); 32 | $actions = array(); 33 | foreach ($rule as $key => $value) { 34 | if ($key === 'ID' || $key === 'Prefix' || $key === 'Status') continue; 35 | $action = $key; 36 | $timeSpec = null; 37 | $timeValue = null; 38 | foreach ($value as $timeSpecKey => $timeValueValue) { 39 | $timeSpec = $timeSpecKey; 40 | $timeValue = strval($timeValueValue); 41 | } 42 | $actions[] = new LifecycleAction($action, $timeSpec, $timeValue); 43 | } 44 | $this->rules[] = new LifecycleRule($id, $prefix, $status, $actions); 45 | } 46 | return; 47 | } 48 | 49 | 50 | /** 51 | * 生成xml字符串 52 | * 53 | * @return string 54 | */ 55 | public function serializeToXml() 56 | { 57 | 58 | $xml = new \SimpleXMLElement(''); 59 | foreach ($this->rules as $rule) { 60 | $xmlRule = $xml->addChild('Rule'); 61 | $rule->appendToXml($xmlRule); 62 | } 63 | return $xml->asXML(); 64 | } 65 | 66 | /** 67 | * 68 | * 添加LifecycleRule 69 | * 70 | * @param LifecycleRule $lifecycleRule 71 | * @throws OssException 72 | */ 73 | public function addRule($lifecycleRule) 74 | { 75 | if (!isset($lifecycleRule)) { 76 | throw new OssException("lifecycleRule is null"); 77 | } 78 | $this->rules[] = $lifecycleRule; 79 | } 80 | 81 | /** 82 | * 将配置转换成字符串,便于用户查看 83 | * 84 | * @return string 85 | */ 86 | public function __toString() 87 | { 88 | return $this->serializeToXml(); 89 | } 90 | 91 | /** 92 | * 得到所有的生命周期规则 93 | * 94 | * @return LifecycleRule[] 95 | */ 96 | public function getRules() 97 | { 98 | return $this->rules; 99 | } 100 | 101 | /** 102 | * @var LifecycleRule[] 103 | */ 104 | private $rules; 105 | } 106 | 107 | 108 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LifecycleRule.php: -------------------------------------------------------------------------------- 1 | id; 22 | } 23 | 24 | /** 25 | * @param string $id 规则ID 26 | */ 27 | public function setId($id) 28 | { 29 | $this->id = $id; 30 | } 31 | 32 | /** 33 | * 得到文件前缀 34 | * 35 | * @return string 36 | */ 37 | public function getPrefix() 38 | { 39 | return $this->prefix; 40 | } 41 | 42 | /** 43 | * 设置文件前缀 44 | * 45 | * @param string $prefix 文件前缀 46 | */ 47 | public function setPrefix($prefix) 48 | { 49 | $this->prefix = $prefix; 50 | } 51 | 52 | /** 53 | * Lifecycle规则的状态 54 | * 55 | * @return string 56 | */ 57 | public function getStatus() 58 | { 59 | return $this->status; 60 | } 61 | 62 | /** 63 | * 设置Lifecycle规则状态 64 | * 65 | * @param string $status 66 | */ 67 | public function setStatus($status) 68 | { 69 | $this->status = $status; 70 | } 71 | 72 | /** 73 | * 74 | * @return LifecycleAction[] 75 | */ 76 | public function getActions() 77 | { 78 | return $this->actions; 79 | } 80 | 81 | /** 82 | * @param LifecycleAction[] $actions 83 | */ 84 | public function setActions($actions) 85 | { 86 | $this->actions = $actions; 87 | } 88 | 89 | 90 | /** 91 | * LifecycleRule constructor. 92 | * 93 | * @param string $id 规则ID 94 | * @param string $prefix 文件前缀 95 | * @param string $status 规则状态,可选[self::LIFECYCLE_STATUS_ENABLED, self::LIFECYCLE_STATUS_DISABLED] 96 | * @param LifecycleAction[] $actions 97 | */ 98 | public function __construct($id, $prefix, $status, $actions) 99 | { 100 | $this->id = $id; 101 | $this->prefix = $prefix; 102 | $this->status = $status; 103 | $this->actions = $actions; 104 | } 105 | 106 | /** 107 | * @param \SimpleXMLElement $xmlRule 108 | */ 109 | public function appendToXml(&$xmlRule) 110 | { 111 | $xmlRule->addChild('ID', $this->id); 112 | $xmlRule->addChild('Prefix', $this->prefix); 113 | $xmlRule->addChild('Status', $this->status); 114 | foreach ($this->actions as $action) { 115 | $action->appendToXml($xmlRule); 116 | } 117 | } 118 | 119 | private $id; 120 | private $prefix; 121 | private $status; 122 | private $actions = array(); 123 | 124 | const LIFECYCLE_STATUS_ENABLED = 'Enabled'; 125 | const LIFECYCLE_STATUS_DISABLED = 'Disabled'; 126 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/ListMultipartUploadInfo.php: -------------------------------------------------------------------------------- 1 | bucket = $bucket; 30 | $this->keyMarker = $keyMarker; 31 | $this->uploadIdMarker = $uploadIdMarker; 32 | $this->nextKeyMarker = $nextKeyMarker; 33 | $this->nextUploadIdMarker = $nextUploadIdMarker; 34 | $this->delimiter = $delimiter; 35 | $this->prefix = $prefix; 36 | $this->maxUploads = $maxUploads; 37 | $this->isTruncated = $isTruncated; 38 | $this->uploads = $uploads; 39 | } 40 | 41 | /** 42 | * 得到bucket名称 43 | * 44 | * @return string 45 | */ 46 | public function getBucket() 47 | { 48 | return $this->bucket; 49 | } 50 | 51 | /** 52 | * @return string 53 | */ 54 | public function getKeyMarker() 55 | { 56 | return $this->keyMarker; 57 | } 58 | 59 | /** 60 | * 61 | * @return string 62 | */ 63 | public function getUploadIdMarker() 64 | { 65 | return $this->uploadIdMarker; 66 | } 67 | 68 | /** 69 | * @return string 70 | */ 71 | public function getNextKeyMarker() 72 | { 73 | return $this->nextKeyMarker; 74 | } 75 | 76 | /** 77 | * @return string 78 | */ 79 | public function getNextUploadIdMarker() 80 | { 81 | return $this->nextUploadIdMarker; 82 | } 83 | 84 | /** 85 | * @return string 86 | */ 87 | public function getDelimiter() 88 | { 89 | return $this->delimiter; 90 | } 91 | 92 | /** 93 | * @return string 94 | */ 95 | public function getPrefix() 96 | { 97 | return $this->prefix; 98 | } 99 | 100 | /** 101 | * @return int 102 | */ 103 | public function getMaxUploads() 104 | { 105 | return $this->maxUploads; 106 | } 107 | 108 | /** 109 | * @return string 110 | */ 111 | public function getIsTruncated() 112 | { 113 | return $this->isTruncated; 114 | } 115 | 116 | /** 117 | * @return UploadInfo[] 118 | */ 119 | public function getUploads() 120 | { 121 | return $this->uploads; 122 | } 123 | 124 | private $bucket = ""; 125 | private $keyMarker = ""; 126 | private $uploadIdMarker = ""; 127 | private $nextKeyMarker = ""; 128 | private $nextUploadIdMarker = ""; 129 | private $delimiter = ""; 130 | private $prefix = ""; 131 | private $maxUploads = 0; 132 | private $isTruncated = "false"; 133 | private $uploads = array(); 134 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/ListPartsInfo.php: -------------------------------------------------------------------------------- 1 | bucket = $bucket; 26 | $this->key = $key; 27 | $this->uploadId = $uploadId; 28 | $this->nextPartNumberMarker = $nextPartNumberMarker; 29 | $this->maxParts = $maxParts; 30 | $this->isTruncated = $isTruncated; 31 | $this->listPart = $listPart; 32 | } 33 | 34 | /** 35 | * @return string 36 | */ 37 | public function getBucket() 38 | { 39 | return $this->bucket; 40 | } 41 | 42 | /** 43 | * @return string 44 | */ 45 | public function getKey() 46 | { 47 | return $this->key; 48 | } 49 | 50 | /** 51 | * @return string 52 | */ 53 | public function getUploadId() 54 | { 55 | return $this->uploadId; 56 | } 57 | 58 | /** 59 | * @return int 60 | */ 61 | public function getNextPartNumberMarker() 62 | { 63 | return $this->nextPartNumberMarker; 64 | } 65 | 66 | /** 67 | * @return int 68 | */ 69 | public function getMaxParts() 70 | { 71 | return $this->maxParts; 72 | } 73 | 74 | /** 75 | * @return string 76 | */ 77 | public function getIsTruncated() 78 | { 79 | return $this->isTruncated; 80 | } 81 | 82 | /** 83 | * @return array 84 | */ 85 | public function getListPart() 86 | { 87 | return $this->listPart; 88 | } 89 | 90 | private $bucket = ""; 91 | private $key = ""; 92 | private $uploadId = ""; 93 | private $nextPartNumberMarker = 0; 94 | private $maxParts = 0; 95 | private $isTruncated = ""; 96 | private $listPart = array(); 97 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LiveChannelConfig.php: -------------------------------------------------------------------------------- 1 | description = $option['description']; 16 | } 17 | if (isset($option['status'])) { 18 | $this->status = $option['status']; 19 | } 20 | if (isset($option['type'])) { 21 | $this->type = $option['type']; 22 | } 23 | if (isset($option['fragDuration'])) { 24 | $this->fragDuration = $option['fragDuration']; 25 | } 26 | if (isset($option['fragCount'])) { 27 | $this->fragCount = $option['fragCount']; 28 | } 29 | if (isset($option['playListName'])) { 30 | $this->playListName = $option['playListName']; 31 | } 32 | } 33 | 34 | public function getDescription() 35 | { 36 | return $this->description; 37 | } 38 | 39 | public function getStatus() 40 | { 41 | return $this->status; 42 | } 43 | 44 | public function getType() 45 | { 46 | return $this->type; 47 | } 48 | 49 | public function getFragDuration() 50 | { 51 | return $this->fragDuration; 52 | } 53 | 54 | public function getFragCount() 55 | { 56 | return $this->fragCount; 57 | } 58 | 59 | public function getPlayListName() 60 | { 61 | return $this->playListName; 62 | } 63 | 64 | public function parseFromXml($strXml) 65 | { 66 | $xml = simplexml_load_string($strXml); 67 | $this->description = strval($xml->Description); 68 | $this->status = strval($xml->Status); 69 | $target = $xml->Target; 70 | $this->type = strval($target->Type); 71 | $this->fragDuration = intval($target->FragDuration); 72 | $this->fragCount = intval($target->FragCount); 73 | $this->playListName = strval($target->PlayListName); 74 | } 75 | 76 | public function serializeToXml() 77 | { 78 | $strXml = << 80 | 81 | 82 | EOF; 83 | $xml = new \SimpleXMLElement($strXml); 84 | if (isset($this->description)) { 85 | $xml->addChild('Description', $this->description); 86 | } 87 | 88 | if (isset($this->status)) { 89 | $xml->addChild('Status', $this->status); 90 | } 91 | 92 | $node = $xml->addChild('Target'); 93 | $node->addChild('Type', $this->type); 94 | 95 | if (isset($this->fragDuration)) { 96 | $node->addChild('FragDuration', $this->fragDuration); 97 | } 98 | 99 | if (isset($this->fragCount)) { 100 | $node->addChild('FragCount', $this->fragCount); 101 | } 102 | 103 | if (isset($this->playListName)) { 104 | $node->addChild('PlayListName', $this->playListName); 105 | } 106 | 107 | return $xml->asXML(); 108 | } 109 | 110 | public function __toString() 111 | { 112 | return $this->serializeToXml(); 113 | } 114 | 115 | private $description; 116 | private $status = "enabled"; 117 | private $type; 118 | private $fragDuration = 5; 119 | private $fragCount = 3; 120 | private $playListName = "playlist.m3u8"; 121 | } 122 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LiveChannelHistory.php: -------------------------------------------------------------------------------- 1 | startTime; 18 | } 19 | 20 | public function getEndTime() 21 | { 22 | return $this->endTime; 23 | } 24 | 25 | public function getRemoteAddr() 26 | { 27 | return $this->remoteAddr; 28 | } 29 | 30 | public function parseFromXmlNode($xml) 31 | { 32 | if (isset($xml->StartTime)) { 33 | $this->startTime = strval($xml->StartTime); 34 | } 35 | 36 | if (isset($xml->EndTime)) { 37 | $this->endTime = strval($xml->EndTime); 38 | } 39 | 40 | if (isset($xml->RemoteAddr)) { 41 | $this->remoteAddr = strval($xml->RemoteAddr); 42 | } 43 | } 44 | 45 | public function parseFromXml($strXml) 46 | { 47 | $xml = simplexml_load_string($strXml); 48 | $this->parseFromXmlNode($xml); 49 | } 50 | 51 | public function serializeToXml() 52 | { 53 | throw new OssException("Not implemented."); 54 | } 55 | 56 | private $startTime; 57 | private $endTime; 58 | private $remoteAddr; 59 | } 60 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LiveChannelInfo.php: -------------------------------------------------------------------------------- 1 | name = $name; 14 | $this->description = $description; 15 | $this->publishUrls = array(); 16 | $this->playUrls = array(); 17 | } 18 | 19 | public function getName() 20 | { 21 | return $this->name; 22 | } 23 | 24 | public function setName($name) 25 | { 26 | $this->name = $name; 27 | } 28 | 29 | public function getPublishUrls() 30 | { 31 | return $this->publishUrls; 32 | } 33 | 34 | public function getPlayUrls() 35 | { 36 | return $this->playUrls; 37 | } 38 | 39 | public function getStatus() 40 | { 41 | return $this->status; 42 | } 43 | 44 | public function getLastModified() 45 | { 46 | return $this->lastModified; 47 | } 48 | 49 | public function getDescription() 50 | { 51 | return $this->description; 52 | } 53 | 54 | public function setDescription($description) 55 | { 56 | $this->description = $description; 57 | } 58 | 59 | public function parseFromXmlNode($xml) 60 | { 61 | if (isset($xml->Name)) { 62 | $this->name = strval($xml->Name); 63 | } 64 | 65 | if (isset($xml->Description)) { 66 | $this->description = strval($xml->Description); 67 | } 68 | 69 | if (isset($xml->Status)) { 70 | $this->status = strval($xml->Status); 71 | } 72 | 73 | if (isset($xml->LastModified)) { 74 | $this->lastModified = strval($xml->LastModified); 75 | } 76 | 77 | if (isset($xml->PublishUrls)) { 78 | foreach ($xml->PublishUrls as $url) { 79 | $this->publishUrls[] = strval($url->Url); 80 | } 81 | } 82 | 83 | if (isset($xml->PlayUrls)) { 84 | foreach ($xml->PlayUrls as $url) { 85 | $this->playUrls[] = strval($url->Url); 86 | } 87 | } 88 | } 89 | 90 | public function parseFromXml($strXml) 91 | { 92 | $xml = simplexml_load_string($strXml); 93 | $this->parseFromXmlNode($xml); 94 | } 95 | 96 | public function serializeToXml() 97 | { 98 | throw new OssException("Not implemented."); 99 | } 100 | 101 | private $name; 102 | private $description; 103 | private $publishUrls; 104 | private $playUrls; 105 | private $status; 106 | private $lastModified; 107 | } 108 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LiveChannelListInfo.php: -------------------------------------------------------------------------------- 1 | bucket; 21 | } 22 | 23 | public function setBucketName($name) 24 | { 25 | $this->bucket = $name; 26 | } 27 | 28 | /** 29 | * @return string 30 | */ 31 | public function getPrefix() 32 | { 33 | return $this->prefix; 34 | } 35 | 36 | /** 37 | * @return string 38 | */ 39 | public function getMarker() 40 | { 41 | return $this->marker; 42 | } 43 | 44 | /** 45 | * @return int 46 | */ 47 | public function getMaxKeys() 48 | { 49 | return $this->maxKeys; 50 | } 51 | 52 | /** 53 | * @return mixed 54 | */ 55 | public function getIsTruncated() 56 | { 57 | return $this->isTruncated; 58 | } 59 | 60 | /** 61 | * @return LiveChannelInfo[] 62 | */ 63 | public function getChannelList() 64 | { 65 | return $this->channelList; 66 | } 67 | 68 | /** 69 | * @return string 70 | */ 71 | public function getNextMarker() 72 | { 73 | return $this->nextMarker; 74 | } 75 | 76 | public function parseFromXml($strXml) 77 | { 78 | $xml = simplexml_load_string($strXml); 79 | 80 | $this->prefix = strval($xml->Prefix); 81 | $this->marker = strval($xml->Marker); 82 | $this->maxKeys = intval($xml->MaxKeys); 83 | $this->isTruncated = (strval($xml->IsTruncated) == 'true'); 84 | $this->nextMarker = strval($xml->NextMarker); 85 | 86 | if (isset($xml->LiveChannel)) { 87 | foreach ($xml->LiveChannel as $chan) { 88 | $channel = new LiveChannelInfo(); 89 | $channel->parseFromXmlNode($chan); 90 | $this->channelList[] = $channel; 91 | } 92 | } 93 | } 94 | 95 | public function serializeToXml() 96 | { 97 | throw new OssException("Not implemented."); 98 | } 99 | 100 | private $bucket = ''; 101 | private $prefix = ''; 102 | private $marker = ''; 103 | private $nextMarker = ''; 104 | private $maxKeys = 100; 105 | private $isTruncated = 'false'; 106 | private $channelList = array(); 107 | } 108 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/LoggingConfig.php: -------------------------------------------------------------------------------- 1 | targetBucket = $targetBucket; 21 | $this->targetPrefix = $targetPrefix; 22 | } 23 | 24 | /** 25 | * @param $strXml 26 | * @return null 27 | */ 28 | public function parseFromXml($strXml) 29 | { 30 | $xml = simplexml_load_string($strXml); 31 | if (!isset($xml->LoggingEnabled)) return; 32 | foreach ($xml->LoggingEnabled as $status) { 33 | foreach ($status as $key => $value) { 34 | if ($key === 'TargetBucket') { 35 | $this->targetBucket = strval($value); 36 | } elseif ($key === 'TargetPrefix') { 37 | $this->targetPrefix = strval($value); 38 | } 39 | } 40 | break; 41 | } 42 | } 43 | 44 | /** 45 | * 序列化成xml字符串 46 | * 47 | */ 48 | public function serializeToXml() 49 | { 50 | $xml = new \SimpleXMLElement(''); 51 | if (isset($this->targetBucket) && isset($this->targetPrefix)) { 52 | $loggingEnabled = $xml->addChild('LoggingEnabled'); 53 | $loggingEnabled->addChild('TargetBucket', $this->targetBucket); 54 | $loggingEnabled->addChild('TargetPrefix', $this->targetPrefix); 55 | } 56 | return $xml->asXML(); 57 | } 58 | 59 | /** 60 | * @return string 61 | */ 62 | public function __toString() 63 | { 64 | return $this->serializeToXml(); 65 | } 66 | 67 | /** 68 | * @return string 69 | */ 70 | public function getTargetBucket() 71 | { 72 | return $this->targetBucket; 73 | } 74 | 75 | /** 76 | * @return string 77 | */ 78 | public function getTargetPrefix() 79 | { 80 | return $this->targetPrefix; 81 | } 82 | 83 | private $targetBucket = ""; 84 | private $targetPrefix = ""; 85 | 86 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/ObjectInfo.php: -------------------------------------------------------------------------------- 1 | key = $key; 32 | $this->lastModified = $lastModified; 33 | $this->eTag = $eTag; 34 | $this->type = $type; 35 | $this->size = $size; 36 | $this->storageClass = $storageClass; 37 | } 38 | 39 | /** 40 | * @return string 41 | */ 42 | public function getKey() 43 | { 44 | return $this->key; 45 | } 46 | 47 | /** 48 | * @return string 49 | */ 50 | public function getLastModified() 51 | { 52 | return $this->lastModified; 53 | } 54 | 55 | /** 56 | * @return string 57 | */ 58 | public function getETag() 59 | { 60 | return $this->eTag; 61 | } 62 | 63 | /** 64 | * @return string 65 | */ 66 | public function getType() 67 | { 68 | return $this->type; 69 | } 70 | 71 | /** 72 | * @return int 73 | */ 74 | public function getSize() 75 | { 76 | return $this->size; 77 | } 78 | 79 | /** 80 | * @return string 81 | */ 82 | public function getStorageClass() 83 | { 84 | return $this->storageClass; 85 | } 86 | 87 | private $key = ""; 88 | private $lastModified = ""; 89 | private $eTag = ""; 90 | private $type = ""; 91 | private $size = 0; 92 | private $storageClass = ""; 93 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/ObjectListInfo.php: -------------------------------------------------------------------------------- 1 | bucketName = $bucketName; 31 | $this->prefix = $prefix; 32 | $this->marker = $marker; 33 | $this->nextMarker = $nextMarker; 34 | $this->maxKeys = $maxKeys; 35 | $this->delimiter = $delimiter; 36 | $this->isTruncated = $isTruncated; 37 | $this->objectList = $objectList; 38 | $this->prefixList = $prefixList; 39 | } 40 | 41 | /** 42 | * @return string 43 | */ 44 | public function getBucketName() 45 | { 46 | return $this->bucketName; 47 | } 48 | 49 | /** 50 | * @return string 51 | */ 52 | public function getPrefix() 53 | { 54 | return $this->prefix; 55 | } 56 | 57 | /** 58 | * @return string 59 | */ 60 | public function getMarker() 61 | { 62 | return $this->marker; 63 | } 64 | 65 | /** 66 | * @return int 67 | */ 68 | public function getMaxKeys() 69 | { 70 | return $this->maxKeys; 71 | } 72 | 73 | /** 74 | * @return string 75 | */ 76 | public function getDelimiter() 77 | { 78 | return $this->delimiter; 79 | } 80 | 81 | /** 82 | * @return mixed 83 | */ 84 | public function getIsTruncated() 85 | { 86 | return $this->isTruncated; 87 | } 88 | 89 | /** 90 | * 返回ListObjects接口返回数据中的ObjectInfo列表 91 | * 92 | * @return ObjectInfo[] 93 | */ 94 | public function getObjectList() 95 | { 96 | return $this->objectList; 97 | } 98 | 99 | /** 100 | * 返回ListObjects接口返回数据中的PrefixInfo列表 101 | * 102 | * @return PrefixInfo[] 103 | */ 104 | public function getPrefixList() 105 | { 106 | return $this->prefixList; 107 | } 108 | 109 | /** 110 | * @return string 111 | */ 112 | public function getNextMarker() 113 | { 114 | return $this->nextMarker; 115 | } 116 | 117 | private $bucketName = ""; 118 | private $prefix = ""; 119 | private $marker = ""; 120 | private $nextMarker = ""; 121 | private $maxKeys = 0; 122 | private $delimiter = ""; 123 | private $isTruncated = null; 124 | private $objectList = array(); 125 | private $prefixList = array(); 126 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/PartInfo.php: -------------------------------------------------------------------------------- 1 | partNumber = $partNumber; 22 | $this->lastModified = $lastModified; 23 | $this->eTag = $eTag; 24 | $this->size = $size; 25 | } 26 | 27 | /** 28 | * @return int 29 | */ 30 | public function getPartNumber() 31 | { 32 | return $this->partNumber; 33 | } 34 | 35 | /** 36 | * @return string 37 | */ 38 | public function getLastModified() 39 | { 40 | return $this->lastModified; 41 | } 42 | 43 | /** 44 | * @return string 45 | */ 46 | public function getETag() 47 | { 48 | return $this->eTag; 49 | } 50 | 51 | /** 52 | * @return int 53 | */ 54 | public function getSize() 55 | { 56 | return $this->size; 57 | } 58 | 59 | private $partNumber = 0; 60 | private $lastModified = ""; 61 | private $eTag = ""; 62 | private $size = 0; 63 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/PrefixInfo.php: -------------------------------------------------------------------------------- 1 | prefix = $prefix; 25 | } 26 | 27 | /** 28 | * @return string 29 | */ 30 | public function getPrefix() 31 | { 32 | return $this->prefix; 33 | } 34 | 35 | private $prefix; 36 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/RefererConfig.php: -------------------------------------------------------------------------------- 1 | AllowEmptyReferer)) return; 21 | if (!isset($xml->RefererList)) return; 22 | $this->allowEmptyReferer = 23 | (strval($xml->AllowEmptyReferer) === 'TRUE' || strval($xml->AllowEmptyReferer) === 'true') ? true : false; 24 | 25 | foreach ($xml->RefererList->Referer as $key => $refer) { 26 | $this->refererList[] = strval($refer); 27 | } 28 | } 29 | 30 | 31 | /** 32 | * 把RefererConfig序列化成xml 33 | * 34 | * @return string 35 | */ 36 | public function serializeToXml() 37 | { 38 | $xml = new \SimpleXMLElement(''); 39 | if ($this->allowEmptyReferer) { 40 | $xml->addChild('AllowEmptyReferer', 'true'); 41 | } else { 42 | $xml->addChild('AllowEmptyReferer', 'false'); 43 | } 44 | $refererList = $xml->addChild('RefererList'); 45 | foreach ($this->refererList as $referer) { 46 | $refererList->addChild('Referer', $referer); 47 | } 48 | return $xml->asXML(); 49 | } 50 | 51 | /** 52 | * @return string 53 | */ 54 | function __toString() 55 | { 56 | return $this->serializeToXml(); 57 | } 58 | 59 | /** 60 | * @param boolean $allowEmptyReferer 61 | */ 62 | public function setAllowEmptyReferer($allowEmptyReferer) 63 | { 64 | $this->allowEmptyReferer = $allowEmptyReferer; 65 | } 66 | 67 | /** 68 | * @param string $referer 69 | */ 70 | public function addReferer($referer) 71 | { 72 | $this->refererList[] = $referer; 73 | } 74 | 75 | /** 76 | * @return boolean 77 | */ 78 | public function isAllowEmptyReferer() 79 | { 80 | return $this->allowEmptyReferer; 81 | } 82 | 83 | /** 84 | * @return array 85 | */ 86 | public function getRefererList() 87 | { 88 | return $this->refererList; 89 | } 90 | 91 | private $allowEmptyReferer = true; 92 | private $refererList = array(); 93 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/StorageCapacityConfig.php: -------------------------------------------------------------------------------- 1 | storageCapacity = $storageCapacity; 21 | } 22 | 23 | /** 24 | * Not implemented 25 | */ 26 | public function parseFromXml($strXml) 27 | { 28 | throw new OssException("Not implemented."); 29 | } 30 | 31 | /** 32 | * 把StorageCapacityConfig序列化成xml 33 | * 34 | * @return string 35 | */ 36 | public function serializeToXml() 37 | { 38 | $xml = new \SimpleXMLElement(''); 39 | $xml->addChild('StorageCapacity', strval($this->storageCapacity)); 40 | return $xml->asXML(); 41 | } 42 | 43 | /** 44 | * To string 45 | * 46 | * @return string 47 | */ 48 | function __toString() 49 | { 50 | return $this->serializeToXml(); 51 | } 52 | 53 | /** 54 | * Set storage capacity 55 | * 56 | * @param int $storageCapacity 57 | */ 58 | public function setStorageCapacity($storageCapacity) 59 | { 60 | $this->storageCapacity = $storageCapacity; 61 | } 62 | 63 | /** 64 | * Get storage capacity 65 | * 66 | * @return int 67 | */ 68 | public function getStorageCapacity() 69 | { 70 | return $this->storageCapacity; 71 | } 72 | 73 | private $storageCapacity = 0; 74 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/UploadInfo.php: -------------------------------------------------------------------------------- 1 | key = $key; 24 | $this->uploadId = $uploadId; 25 | $this->initiated = $initiated; 26 | } 27 | 28 | /** 29 | * @return string 30 | */ 31 | public function getKey() 32 | { 33 | return $this->key; 34 | } 35 | 36 | /** 37 | * @return string 38 | */ 39 | public function getUploadId() 40 | { 41 | return $this->uploadId; 42 | } 43 | 44 | /** 45 | * @return string 46 | */ 47 | public function getInitiated() 48 | { 49 | return $this->initiated; 50 | } 51 | 52 | private $key = ""; 53 | private $uploadId = ""; 54 | private $initiated = ""; 55 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/WebsiteConfig.php: -------------------------------------------------------------------------------- 1 | indexDocument = $indexDocument; 24 | $this->errorDocument = $errorDocument; 25 | } 26 | 27 | /** 28 | * @param string $strXml 29 | * @return null 30 | */ 31 | public function parseFromXml($strXml) 32 | { 33 | $xml = simplexml_load_string($strXml); 34 | if (isset($xml->IndexDocument) && isset($xml->IndexDocument->Suffix)) { 35 | $this->indexDocument = strval($xml->IndexDocument->Suffix); 36 | } 37 | if (isset($xml->ErrorDocument) && isset($xml->ErrorDocument->Key)) { 38 | $this->errorDocument = strval($xml->ErrorDocument->Key); 39 | } 40 | } 41 | 42 | /** 43 | * 把WebsiteConfig序列化成xml 44 | * 45 | * @return string 46 | * @throws OssException 47 | */ 48 | public function serializeToXml() 49 | { 50 | $xml = new \SimpleXMLElement(''); 51 | $index_document_part = $xml->addChild('IndexDocument'); 52 | $error_document_part = $xml->addChild('ErrorDocument'); 53 | $index_document_part->addChild('Suffix', $this->indexDocument); 54 | $error_document_part->addChild('Key', $this->errorDocument); 55 | return $xml->asXML(); 56 | } 57 | 58 | /** 59 | * @return string 60 | */ 61 | public function getIndexDocument() 62 | { 63 | return $this->indexDocument; 64 | } 65 | 66 | /** 67 | * @return string 68 | */ 69 | public function getErrorDocument() 70 | { 71 | return $this->errorDocument; 72 | } 73 | 74 | private $indexDocument = ""; 75 | private $errorDocument = ""; 76 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Model/XmlConfig.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/AclResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 22 | if (empty($content)) { 23 | throw new OssException("body is null"); 24 | } 25 | $xml = simplexml_load_string($content); 26 | if (isset($xml->AccessControlList->Grant)) { 27 | return strval($xml->AccessControlList->Grant); 28 | } else { 29 | throw new OssException("xml format exception"); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/AppendResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->header; 22 | if (isset($header["x-oss-next-append-position"])) { 23 | return intval($header["x-oss-next-append-position"]); 24 | } 25 | throw new OssException("cannot get next-append-position"); 26 | } 27 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/BodyResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body) ? "" : $this->rawResponse->body; 18 | } 19 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/CallbackResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->status; 15 | if ((int)(intval($status) / 100) == 2 && (int)(intval($status)) !== 203) { 16 | return true; 17 | } 18 | return false; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/CopyObjectResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 18 | $xml = simplexml_load_string($body); 19 | $result = array(); 20 | 21 | if (isset($xml->LastModified)) { 22 | $result[] = $xml->LastModified; 23 | } 24 | if (isset($xml->ETag)) { 25 | $result[] = $xml->ETag; 26 | } 27 | 28 | return $result; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/DeleteObjectsResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 18 | $xml = simplexml_load_string($body); 19 | $objects = array(); 20 | 21 | if (isset($xml->Deleted)) { 22 | foreach($xml->Deleted as $deleteKey) 23 | $objects[] = $deleteKey->Key; 24 | } 25 | return $objects; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/ExistResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->status) === 200 ? true : false; 18 | } 19 | 20 | /** 21 | * 根据返回http状态码判断,[200-299]即认为是OK, 判断是否存在的接口,404也认为是一种 22 | * 有效响应 23 | * 24 | * @return bool 25 | */ 26 | protected function isResponseOk() 27 | { 28 | $status = $this->rawResponse->status; 29 | if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) { 30 | return true; 31 | } 32 | return false; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetCnameResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 15 | $config = new CnameConfig(); 16 | $config->parseFromXml($content); 17 | return $config; 18 | } 19 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetCorsResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 15 | $config = new CorsConfig(); 16 | $config->parseFromXml($content); 17 | return $config; 18 | } 19 | 20 | /** 21 | * 根据返回http状态码判断,[200-299]即认为是OK, 获取bucket相关配置的接口,404也认为是一种 22 | * 有效响应 23 | * 24 | * @return bool 25 | */ 26 | protected function isResponseOk() 27 | { 28 | $status = $this->rawResponse->status; 29 | if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) { 30 | return true; 31 | } 32 | return false; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetLifecycleResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 22 | $config = new LifecycleConfig(); 23 | $config->parseFromXml($content); 24 | return $config; 25 | } 26 | 27 | /** 28 | * 根据返回http状态码判断,[200-299]即认为是OK, 获取bucket相关配置的接口,404也认为是一种 29 | * 有效响应 30 | * 31 | * @return bool 32 | */ 33 | protected function isResponseOk() 34 | { 35 | $status = $this->rawResponse->status; 36 | if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) { 37 | return true; 38 | } 39 | return false; 40 | } 41 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetLiveChannelHistoryResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 15 | $channelList = new GetLiveChannelHistory(); 16 | $channelList->parseFromXml($content); 17 | return $channelList; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetLiveChannelInfoResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 15 | $channelList = new GetLiveChannelInfo(); 16 | $channelList->parseFromXml($content); 17 | return $channelList; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetLiveChannelStatusResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 15 | $channelList = new GetLiveChannelStatus(); 16 | $channelList->parseFromXml($content); 17 | return $channelList; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetLocationResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 24 | if (empty($content)) { 25 | throw new OssException("body is null"); 26 | } 27 | $xml = simplexml_load_string($content); 28 | return $xml; 29 | } 30 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetLoggingResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 22 | $config = new LoggingConfig(); 23 | $config->parseFromXml($content); 24 | return $config; 25 | } 26 | 27 | /** 28 | * 根据返回http状态码判断,[200-299]即认为是OK, 获取bucket相关配置的接口,404也认为是一种 29 | * 有效响应 30 | * 31 | * @return bool 32 | */ 33 | protected function isResponseOk() 34 | { 35 | $status = $this->rawResponse->status; 36 | if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) { 37 | return true; 38 | } 39 | return false; 40 | } 41 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetRefererResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 22 | $config = new RefererConfig(); 23 | $config->parseFromXml($content); 24 | return $config; 25 | } 26 | 27 | /** 28 | * 根据返回http状态码判断,[200-299]即认为是OK, 获取bucket相关配置的接口,404也认为是一种 29 | * 有效响应 30 | * 31 | * @return bool 32 | */ 33 | protected function isResponseOk() 34 | { 35 | $status = $this->rawResponse->status; 36 | if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) { 37 | return true; 38 | } 39 | return false; 40 | } 41 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetStorageCapacityResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 24 | if (empty($content)) { 25 | throw new OssException("body is null"); 26 | } 27 | $xml = simplexml_load_string($content); 28 | if (isset($xml->StorageCapacity)) { 29 | return intval($xml->StorageCapacity); 30 | } else { 31 | throw new OssException("xml format exception"); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/GetWebsiteResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 21 | $config = new WebsiteConfig(); 22 | $config->parseFromXml($content); 23 | return $config; 24 | } 25 | 26 | /** 27 | * 根据返回http状态码判断,[200-299]即认为是OK, 获取bucket相关配置的接口,404也认为是一种 28 | * 有效响应 29 | * 30 | * @return bool 31 | */ 32 | protected function isResponseOk() 33 | { 34 | $status = $this->rawResponse->status; 35 | if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) { 36 | return true; 37 | } 38 | return false; 39 | } 40 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/HeaderResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->header) ? array() : $this->rawResponse->header; 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/InitiateMultipartUploadResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 23 | $xml = simplexml_load_string($content); 24 | if (isset($xml->UploadId)) { 25 | return strval($xml->UploadId); 26 | } 27 | throw new OssException("cannot get UploadId"); 28 | } 29 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/ListBucketsResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 22 | $xml = new \SimpleXMLElement($content); 23 | if (isset($xml->Buckets) && isset($xml->Buckets->Bucket)) { 24 | foreach ($xml->Buckets->Bucket as $bucket) { 25 | $bucketInfo = new BucketInfo(strval($bucket->Location), 26 | strval($bucket->Name), 27 | strval($bucket->CreationDate)); 28 | $bucketList[] = $bucketInfo; 29 | } 30 | } 31 | return new BucketListInfo($bucketList); 32 | } 33 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/ListLiveChannelResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 12 | $channelList = new LiveChannelListInfo(); 13 | $channelList->parseFromXml($content); 14 | return $channelList; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/ListMultipartUploadResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 24 | $xml = simplexml_load_string($content); 25 | 26 | $encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : ""; 27 | $bucket = isset($xml->Bucket) ? strval($xml->Bucket) : ""; 28 | $keyMarker = isset($xml->KeyMarker) ? strval($xml->KeyMarker) : ""; 29 | $keyMarker = OssUtil::decodeKey($keyMarker, $encodingType); 30 | $uploadIdMarker = isset($xml->UploadIdMarker) ? strval($xml->UploadIdMarker) : ""; 31 | $nextKeyMarker = isset($xml->NextKeyMarker) ? strval($xml->NextKeyMarker) : ""; 32 | $nextKeyMarker = OssUtil::decodeKey($nextKeyMarker, $encodingType); 33 | $nextUploadIdMarker = isset($xml->NextUploadIdMarker) ? strval($xml->NextUploadIdMarker) : ""; 34 | $delimiter = isset($xml->Delimiter) ? strval($xml->Delimiter) : ""; 35 | $delimiter = OssUtil::decodeKey($delimiter, $encodingType); 36 | $prefix = isset($xml->Prefix) ? strval($xml->Prefix) : ""; 37 | $prefix = OssUtil::decodeKey($prefix, $encodingType); 38 | $maxUploads = isset($xml->MaxUploads) ? intval($xml->MaxUploads) : 0; 39 | $isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : ""; 40 | $listUpload = array(); 41 | 42 | if (isset($xml->Upload)) { 43 | foreach ($xml->Upload as $upload) { 44 | $key = isset($upload->Key) ? strval($upload->Key) : ""; 45 | $key = OssUtil::decodeKey($key, $encodingType); 46 | $uploadId = isset($upload->UploadId) ? strval($upload->UploadId) : ""; 47 | $initiated = isset($upload->Initiated) ? strval($upload->Initiated) : ""; 48 | $listUpload[] = new UploadInfo($key, $uploadId, $initiated); 49 | } 50 | } 51 | return new ListMultipartUploadInfo($bucket, $keyMarker, $uploadIdMarker, 52 | $nextKeyMarker, $nextUploadIdMarker, 53 | $delimiter, $prefix, $maxUploads, $isTruncated, $listUpload); 54 | } 55 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/ListObjectsResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body); 24 | $encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : ""; 25 | $objectList = $this->parseObjectList($xml, $encodingType); 26 | $prefixList = $this->parsePrefixList($xml, $encodingType); 27 | $bucketName = isset($xml->Name) ? strval($xml->Name) : ""; 28 | $prefix = isset($xml->Prefix) ? strval($xml->Prefix) : ""; 29 | $prefix = OssUtil::decodeKey($prefix, $encodingType); 30 | $marker = isset($xml->Marker) ? strval($xml->Marker) : ""; 31 | $marker = OssUtil::decodeKey($marker, $encodingType); 32 | $maxKeys = isset($xml->MaxKeys) ? intval($xml->MaxKeys) : 0; 33 | $delimiter = isset($xml->Delimiter) ? strval($xml->Delimiter) : ""; 34 | $delimiter = OssUtil::decodeKey($delimiter, $encodingType); 35 | $isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : ""; 36 | $nextMarker = isset($xml->NextMarker) ? strval($xml->NextMarker) : ""; 37 | $nextMarker = OssUtil::decodeKey($nextMarker, $encodingType); 38 | return new ObjectListInfo($bucketName, $prefix, $marker, $nextMarker, $maxKeys, $delimiter, $isTruncated, $objectList, $prefixList); 39 | } 40 | 41 | private function parseObjectList($xml, $encodingType) 42 | { 43 | $retList = array(); 44 | if (isset($xml->Contents)) { 45 | foreach ($xml->Contents as $content) { 46 | $key = isset($content->Key) ? strval($content->Key) : ""; 47 | $key = OssUtil::decodeKey($key, $encodingType); 48 | $lastModified = isset($content->LastModified) ? strval($content->LastModified) : ""; 49 | $eTag = isset($content->ETag) ? strval($content->ETag) : ""; 50 | $type = isset($content->Type) ? strval($content->Type) : ""; 51 | $size = isset($content->Size) ? intval($content->Size) : 0; 52 | $storageClass = isset($content->StorageClass) ? strval($content->StorageClass) : ""; 53 | $retList[] = new ObjectInfo($key, $lastModified, $eTag, $type, $size, $storageClass); 54 | } 55 | } 56 | return $retList; 57 | } 58 | 59 | private function parsePrefixList($xml, $encodingType) 60 | { 61 | $retList = array(); 62 | if (isset($xml->CommonPrefixes)) { 63 | foreach ($xml->CommonPrefixes as $commonPrefix) { 64 | $prefix = isset($commonPrefix->Prefix) ? strval($commonPrefix->Prefix) : ""; 65 | $prefix = OssUtil::decodeKey($prefix, $encodingType); 66 | $retList[] = new PrefixInfo($prefix); 67 | } 68 | } 69 | return $retList; 70 | } 71 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/ListPartsResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 23 | $xml = simplexml_load_string($content); 24 | $bucket = isset($xml->Bucket) ? strval($xml->Bucket) : ""; 25 | $key = isset($xml->Key) ? strval($xml->Key) : ""; 26 | $uploadId = isset($xml->UploadId) ? strval($xml->UploadId) : ""; 27 | $nextPartNumberMarker = isset($xml->NextPartNumberMarker) ? intval($xml->NextPartNumberMarker) : ""; 28 | $maxParts = isset($xml->MaxParts) ? intval($xml->MaxParts) : ""; 29 | $isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : ""; 30 | $partList = array(); 31 | if (isset($xml->Part)) { 32 | foreach ($xml->Part as $part) { 33 | $partNumber = isset($part->PartNumber) ? intval($part->PartNumber) : ""; 34 | $lastModified = isset($part->LastModified) ? strval($part->LastModified) : ""; 35 | $eTag = isset($part->ETag) ? strval($part->ETag) : ""; 36 | $size = isset($part->Size) ? intval($part->Size) : ""; 37 | $partList[] = new PartInfo($partNumber, $lastModified, $eTag, $size); 38 | } 39 | } 40 | return new ListPartsInfo($bucket, $key, $uploadId, $nextPartNumberMarker, $maxParts, $isTruncated, $partList); 41 | } 42 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/PutLiveChannelResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->body; 12 | $channel = new LiveChannelInfo(); 13 | $channel->parseFromXml($content); 14 | return $channel; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/PutSetDeleteResult.php: -------------------------------------------------------------------------------- 1 | $this->rawResponse->body); 18 | return array_merge($this->rawResponse->header, $body); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/Result.php: -------------------------------------------------------------------------------- 1 | rawResponse = $response; 28 | $this->parseResponse(); 29 | } 30 | 31 | /** 32 | * 获取requestId 33 | * 34 | * @return string 35 | */ 36 | public function getRequestId() 37 | { 38 | if (isset($this->rawResponse) && 39 | isset($this->rawResponse->header) && 40 | isset($this->rawResponse->header['x-oss-request-id']) 41 | ) { 42 | return $this->rawResponse->header['x-oss-request-id']; 43 | } else { 44 | return ''; 45 | } 46 | } 47 | 48 | /** 49 | * 得到返回数据,不同的请求返回数据格式不同 50 | * 51 | * $return mixed 52 | */ 53 | public function getData() 54 | { 55 | return $this->parsedData; 56 | } 57 | 58 | /** 59 | * 由子类实现,不同的请求返回数据有不同的解析逻辑,由子类实现 60 | * 61 | * @return mixed 62 | */ 63 | abstract protected function parseDataFromResponse(); 64 | 65 | /** 66 | * 操作是否成功 67 | * 68 | * @return mixed 69 | */ 70 | public function isOK() 71 | { 72 | return $this->isOk; 73 | } 74 | 75 | /** 76 | * @throws OssException 77 | */ 78 | public function parseResponse() 79 | { 80 | $this->isOk = $this->isResponseOk(); 81 | if ($this->isOk) { 82 | $this->parsedData = $this->parseDataFromResponse(); 83 | } else { 84 | $httpStatus = strval($this->rawResponse->status); 85 | $requestId = strval($this->getRequestId()); 86 | $code = $this->retrieveErrorCode($this->rawResponse->body); 87 | $message = $this->retrieveErrorMessage($this->rawResponse->body); 88 | $body = $this->rawResponse->body; 89 | 90 | $details = array( 91 | 'status' => $httpStatus, 92 | 'request-id' => $requestId, 93 | 'code' => $code, 94 | 'message' => $message, 95 | 'body' => $body 96 | ); 97 | throw new OssException($details); 98 | } 99 | } 100 | 101 | /** 102 | * 尝试从body中获取错误Message 103 | * 104 | * @param $body 105 | * @return string 106 | */ 107 | private function retrieveErrorMessage($body) 108 | { 109 | if (empty($body) || false === strpos($body, 'Message)) { 114 | return strval($xml->Message); 115 | } 116 | return ''; 117 | } 118 | 119 | /** 120 | * 尝试从body中获取错误Code 121 | * 122 | * @param $body 123 | * @return string 124 | */ 125 | private function retrieveErrorCode($body) 126 | { 127 | if (empty($body) || false === strpos($body, 'Code)) { 132 | return strval($xml->Code); 133 | } 134 | return ''; 135 | } 136 | 137 | /** 138 | * 根据返回http状态码判断,[200-299]即认为是OK 139 | * 140 | * @return bool 141 | */ 142 | protected function isResponseOk() 143 | { 144 | $status = $this->rawResponse->status; 145 | if ((int)(intval($status) / 100) == 2) { 146 | return true; 147 | } 148 | return false; 149 | } 150 | 151 | /** 152 | * 返回原始的返回数据 153 | * 154 | * @return ResponseCore 155 | */ 156 | public function getRawResponse() 157 | { 158 | return $this->rawResponse; 159 | } 160 | 161 | /** 162 | * 标示请求是否成功 163 | */ 164 | protected $isOk = false; 165 | /** 166 | * 由子类解析过的数据 167 | */ 168 | protected $parsedData = null; 169 | /** 170 | * 存放auth函数返回的原始Response 171 | * 172 | * @var ResponseCore 173 | */ 174 | protected $rawResponse; 175 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/SymlinkResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->header[OssClient::OSS_SYMLINK_TARGET] = rawurldecode($this->rawResponse->header[OssClient::OSS_SYMLINK_TARGET]); 21 | return $this->rawResponse->header; 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/UploadPartResult.php: -------------------------------------------------------------------------------- 1 | rawResponse->header; 22 | if (isset($header["etag"])) { 23 | return $header["etag"]; 24 | } 25 | throw new OssException("cannot get ETag"); 26 | 27 | } 28 | } -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/Result/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/OSS/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/sdk/aliyun-oss-php-sdk-2.3.0/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/sdk/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /config/app.config_example.php: -------------------------------------------------------------------------------- 1 | "mydir1/", 5 | 'SIGNEDURL_TIMEOUT' => 3600, 6 | 'SHOW_FILEDATE' => true, 7 | 'ROOT_AUTH' => array( 8 | 'ENABLED' => true, 9 | 'PASSWORD' => '爱', 10 | 'FIRSTMET' => '你爱我嘛?~', 11 | 'IFWRONG' => '你再说一遍???', 12 | ), 13 | 'AUTH' => array( 14 | array( 15 | 'PATH' => 'dir1/', 16 | 'ENABLED' => true, 17 | 'PASSWORD' => '谁他妈需要你的爱\n老子爱你就够了(恶龙咆哮)', 18 | 'FIRSTMET' => '那我不爱了', 19 | 'IFWRONG' => '好 你竟然敢不爱我(恶龙咆哮)', 20 | ), 21 | array( 22 | 'PATH' => 'dir2/1.txt', 23 | 'ENABLED' => false, 24 | 'PASSWORD' => '看啥', 25 | 'FIRSTMET' => '12345678', 26 | 'IFWRONG' => '不给你看!', 27 | ), 28 | array( 29 | 'PATH' => '<需要验证的绝对路径>', 30 | 'ENABLED' => true, 31 | 'PASSWORD' => '<密码>', 32 | 'FIRSTMET' => '<初次见面显示的文本>', 33 | 'IFWRONG' => '<密码错误时显示的文本>', 34 | ), 35 | ), 36 | ); -------------------------------------------------------------------------------- /config/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /config/oss.config_example.php: -------------------------------------------------------------------------------- 1 | oOvOo.site" 5 | } -------------------------------------------------------------------------------- /ext/DPlayer/README.md: -------------------------------------------------------------------------------- 1 |

2 | ADPlayer 3 |

4 |

DPlayer

5 | 6 | > 🍭 Wow, such a lovely HTML5 danmaku video player 7 | 8 | [![npm](https://img.shields.io/npm/v/dplayer.svg?style=flat-square)](https://www.npmjs.com/package/dplayer) 9 | [![npm](https://img.shields.io/npm/l/dplayer.svg?style=flat-square)](https://github.com/MoePlayer/DPlayer/blob/master/LICENSE) 10 | [![npm](https://img.shields.io/npm/dt/dplayer.svg?style=flat-square)](https://www.npmjs.com/package/dplayer) 11 | [![size](https://badge-size.herokuapp.com/MoePlayer/DPlayer/master/dist/DPlayer.min.js?compression=gzip&style=flat-square)](https://github.com/MoePlayer/DPlayer/tree/master/dist) 12 | [![Travis](https://img.shields.io/travis/MoePlayer/DPlayer.svg?style=flat-square)](https://travis-ci.org/MoePlayer/DPlayer) 13 | [![devDependency Status](https://img.shields.io/david/dev/MoePlayer/dplayer.svg?style=flat-square)](https://david-dm.org/MoePlayer/DPlayer#info=devDependencies) 14 | [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?style=flat-square)](https://github.com/MoePlayer/DPlayer#donate) 15 | 16 | ## Introduction 17 | 18 | ![image](http://i.imgur.com/207ch36.jpg) 19 | 20 | DPlayer is a lovely HTML5 danmaku video player to help people build video and danmaku easily. 21 | 22 | **DPlayer supports:** 23 | 24 | - Streaming formats 25 | - [HLS](https://github.com/video-dev/hls.js) 26 | - [FLV](https://github.com/Bilibili/flv.js) 27 | - [MPEG DASH](https://github.com/Dash-Industry-Forum/dash.js) 28 | - [WebTorrent](https://github.com/webtorrent/webtorrent) 29 | - Any other custom streaming formats 30 | - Media formats 31 | - MP4 H.264 32 | - WebM 33 | - Ogg Theora Vorbis 34 | - Features 35 | - Danmaku 36 | - Screenshot 37 | - Hotkeys 38 | - Quality switching 39 | - Thumbnails 40 | - Subtitle 41 | 42 | Using DPlayer on your project? [Let me know!](https://github.com/DIYgod/DPlayer/issues/31) 43 | 44 | **[Docs](http://dplayer.js.org)** 45 | 46 | **[中文文档](http://dplayer.js.org/#/zh-Hans/)** 47 | 48 | ## Join the Discussion 49 | 50 | - [Telegram Group](https://t.me/adplayer) 51 | 52 | ## Related Projects 53 | 54 | Feel free to submit yours in [`Let me know!`](https://github.com/MoePlayer/DPlayer/issues/31) 55 | 56 | ### Tooling 57 | 58 | - [DPlayer-thumbnails](https://github.com/MoePlayer/DPlayer-thumbnails): generate video thumbnails 59 | 60 | ### Danmaku api 61 | 62 | - [DPlayer-node](https://github.com/MoePlayer/DPlayer-node): Node.js 63 | - [laravel-danmaku](https://github.com/MoePlayer/laravel-danmaku): PHP 64 | - [dplayer-live-backend](https://github.com/Izumi-kun/dplayer-live-backend): Node.js, WebSocket live backend 65 | - [RailsGun](https://github.com/MoePlayer/RailsGun): Ruby 66 | 67 | ### Plugins 68 | 69 | - [DPlayer-for-typecho](https://github.com/volio/DPlayer-for-typecho): Typecho 70 | - [Hexo-tag-dplayer](https://github.com/NextMoe/hexo-tag-dplayer): Hexo 71 | - [DPlayer_for_Z-BlogPHP](https://github.com/fghrsh/DPlayer_for_Z-BlogPHP): Z-BlogPHP 72 | - [DPlayer for Discuz!](https://coding.net/u/Click_04/p/video/git): Discuz! 73 | - [DPlayer for WordPress](https://github.com/BlueCocoa/DPlayer-WordPress): WordPress 74 | - [DPlayerHandle](https://github.com/kn007/DPlayerHandle): WordPress 75 | - [Vue-DPlayer](https://github.com/sinchang/vue-dplayer): Vue 76 | - [react-dplayer](https://github.com/hnsylitao/react-dplayer): React 77 | 78 | ### Other 79 | 80 | - [DPlayer-Lite](https://github.com/kn007/DPlayer-Lite): lite version 81 | - [hlsjs-p2p-engine](https://github.com/cdnbye/hlsjs-p2p-engine) 82 | - Feel free to submit yours in [`Let me know!`](https://github.com/MoePlayer/DPlayer/issues/31) 83 | 84 | ## Who use DPlayer? 85 | 86 | - [小红书](https://www.xiaohongshu.com/): 中国最大的生活社区分享平台,同时也是发现全球好物的电商平台 87 | - [极客时间](https://time.geekbang.org/): 极客邦科技出品的一款 IT 内容知识服务 App 88 | - [嘀哩嘀哩](http://www.dilidili.wang/): 兴趣使然的无名小站(D站) 89 | - [银色子弹](https://www.sbsub.com/): 银色子弹,简称银弹,由多数柯南热爱者聚集在一起的组织 90 | - [浙江大学CC98论坛](https://zh.wikipedia.org/wiki/CC98%E8%AE%BA%E5%9D%9B): 浙江大学校网内规模最大的论坛,中国各大学中较活跃的BBS之一 91 | - [纸飞机南航青年网络社区](http://my.nuaa.edu.cn/video-video.html): 南京航空航天大学门户网站 92 | - [otomads](https://otomads.com/): 专注于音MAD的视频弹幕网站 93 | - [Cloudreve](https://github.com/HFO4/Cloudreve): 基于ThinkPHP构建的网盘系统 94 | - Feel free to submit yours in [`Let me know!`](https://github.com/MoePlayer/DPlayer/issues/31) 95 | 96 | ## Current Premium Sponsors 97 | 98 | ### Special Sponsors 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | ### OpenCollective backers 108 | 109 | ![](https://opencollective.com/DPlayer/backers.svg?width=890) 110 | 111 | ## Contributors 112 | 113 | This project exists thanks to all the people who contribute. 114 | 115 | 116 | 117 | ## Donate 118 | 119 | DPlayer is an MIT licensed open source project and completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing. 120 | 121 | ## One-time Donations 122 | 123 | We accept donations through these channels: 124 | 125 | - [Paypal](https://www.paypal.me/DIYgod) 126 | - [WeChat Pay](https://i.imgur.com/aq6PtWa.png) 127 | - [Alipay](https://i.imgur.com/wv1Pj2k.png) 128 | - Bitcoin: 13CwQLHzPYm2tewNMSJBeArbbRM5NSmCD1 129 | 130 | ## Recurring Pledges 131 | 132 | Recurring pledges come with exclusive perks, e.g. having your name or your company logo listed in the DPlayer GitHub repository and this website. 133 | 134 | - Become a backer or sponsor via [OpenCollective](https://opencollective.com/dplayer) 135 | - E-mail us: i#html.love 136 | 137 | ## Author 138 | 139 | **DPlayer** © [DIYgod](https://github.com/DIYgod), Released under the [MIT](./LICENSE) License.
140 | Authored and maintained by DIYgod with help from contributors ([list](https://github.com/DIYgod/DPlayer/contributors)). 141 | 142 | > [Blog](https://diygod.me) · GitHub [@DIYgod](https://github.com/DIYgod) · Twitter [@DIYgod](https://twitter.com/DIYgod) · Telegram Channel [@awesomeDIYgod](https://t.me/awesomeDIYgod) 143 | -------------------------------------------------------------------------------- /ext/DPlayer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 21 | 22 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 37 |
38 |
39 |
40 | 62 |
63 | 64 | 65 | Themed by h5ai
66 | Powered by YXuuan/hfs4OSS 67 |
68 |
69 |
70 |
71 |
72 | 73 | 74 | -------------------------------------------------------------------------------- /static/h5ai/README.md: -------------------------------------------------------------------------------- 1 | # h5ai 2 | 3 | [![license][license-img]][github] [![web][web-img]][web] [![github][github-img]][github] 4 | 5 | A modern HTTP web server index for Apache httpd, lighttpd, nginx and Cherokee. 6 | 7 | 8 | ## Important 9 | 10 | * Do **not** install any files from the `src` folder, they need to be 11 | preprocessed to work correctly! 12 | * Find a preprocessed package and detailed install instructions on the 13 | [project page][web]. 14 | * For bug reports and feature requests please use [issues][github-issues]. 15 | 16 | 17 | ## Build 18 | 19 | There are installation ready packages for the latest [releases][release] and 20 | [dev builds][develop]. But to build **h5ai** yourself either `git clone` or 21 | download the repository. From within the root folder run the following 22 | commands to find a fresh zipball in folder `build` (tested on linux only, 23 | requires [`node 6.0+`][node] to be installed). 24 | 25 | ~~~sh 26 | > npm install 27 | > npm run build 28 | ~~~ 29 | 30 | 31 | ## License 32 | 33 | The MIT License (MIT) 34 | 35 | Copyright (c) 2016 Lars Jung (https://larsjung.de) 36 | 37 | Permission is hereby granted, free of charge, to any person obtaining a copy 38 | of this software and associated documentation files (the "Software"), to deal 39 | in the Software without restriction, including without limitation the rights 40 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 41 | copies of the Software, and to permit persons to whom the Software is 42 | furnished to do so, subject to the following conditions: 43 | 44 | The above copyright notice and this permission notice shall be included in 45 | all copies or substantial portions of the Software. 46 | 47 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 48 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 49 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 50 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 51 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 52 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 53 | THE SOFTWARE. 54 | 55 | 56 | ## References 57 | 58 | **h5ai** profits from other projects, all of them licensed under the MIT license 59 | too. Exceptions are some [Material Design icons][material-design-icons] (CC BY 4.0). 60 | 61 | 62 | [web]: https://larsjung.de/h5ai/ 63 | [github]: https://github.com/lrsjng/h5ai 64 | [github-issues]: https://github.com/lrsjng/h5ai/issues 65 | [release]: https://release.larsjung.de/h5ai/ 66 | [develop]: https://release.larsjung.de/h5ai/develop/ 67 | [node]: https://nodejs.org 68 | [material-design-icons]: https://github.com/google/material-design-icons 69 | 70 | [license-img]: https://img.shields.io/badge/license-MIT-a0a060.svg?style=flat-square 71 | [web-img]: https://img.shields.io/badge/web-larsjung.de/h5ai-a0a060.svg?style=flat-square 72 | [github-img]: https://img.shields.io/badge/github-lrsjng/h5ai-a0a060.svg?style=flat-square 73 | -------------------------------------------------------------------------------- /static/h5ai/public/font/poppin.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXuuan/hfs4OSS/57906ef191beda157721c746400794b5809a62db/static/h5ai/public/font/poppin.eot -------------------------------------------------------------------------------- /static/h5ai/public/font/poppin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXuuan/hfs4OSS/57906ef191beda157721c746400794b5809a62db/static/h5ai/public/font/poppin.ttf -------------------------------------------------------------------------------- /static/h5ai/public/images/ext/playvideo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/h5ai/public/images/fallback/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXuuan/hfs4OSS/57906ef191beda157721c746400794b5809a62db/static/h5ai/public/images/fallback/file.png -------------------------------------------------------------------------------- /static/h5ai/public/images/fallback/folder-parent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXuuan/hfs4OSS/57906ef191beda157721c746400794b5809a62db/static/h5ai/public/images/fallback/folder-parent.png -------------------------------------------------------------------------------- /static/h5ai/public/images/fallback/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXuuan/hfs4OSS/57906ef191beda157721c746400794b5809a62db/static/h5ai/public/images/fallback/folder.png -------------------------------------------------------------------------------- /static/h5ai/public/images/favicon/favicon-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXuuan/hfs4OSS/57906ef191beda157721c746400794b5809a62db/static/h5ai/public/images/favicon/favicon-152.png -------------------------------------------------------------------------------- /static/h5ai/public/images/favicon/favicon-16-32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXuuan/hfs4OSS/57906ef191beda157721c746400794b5809a62db/static/h5ai/public/images/favicon/favicon-16-32.ico -------------------------------------------------------------------------------- /static/h5ai/public/images/favicon/favicon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXuuan/hfs4OSS/57906ef191beda157721c746400794b5809a62db/static/h5ai/public/images/favicon/favicon-16.png -------------------------------------------------------------------------------- /static/h5ai/public/images/favicon/favicon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXuuan/hfs4OSS/57906ef191beda157721c746400794b5809a62db/static/h5ai/public/images/favicon/favicon-32.png -------------------------------------------------------------------------------- /static/h5ai/public/images/favicon/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | 6 | [*] 7 | charset = utf-8 8 | indent_style = space 9 | indent_size = 4 10 | end_of_line = lf 11 | insert_final_newline = true 12 | trim_trailing_whitespace = true 13 | 14 | 15 | [package.json] 16 | indent_style = space 17 | indent_size = 2 18 | 19 | 20 | [.travis.yml] 21 | indent_style = space 22 | indent_size = 2 23 | 24 | 25 | [*.md] 26 | trim_trailing_whitespace = false 27 | 28 | 29 | [*.jade] 30 | trim_trailing_whitespace = false 31 | 32 | 33 | [*.svg] 34 | insert_final_newline = false 35 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/README.md: -------------------------------------------------------------------------------- 1 | # Themes 2 | 3 | This directory will contain any themes you add. At the moment there are only 4 | icon themes supported. The folder structure is: `/.`, 5 | with `` one of `svg`, `png` or `jpg`. 6 | 7 | To select a theme use the option `view > theme` in file `conf/options.json`. 8 | 9 | You will find the previously included icon themes [here](https://github.com/lrsjng/h5ai-themes). 10 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/ar-apk.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/ar-deb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/ar-rpm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/txt-css.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/txt-go.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/txt-html.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/txt-js.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/txt-less.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/txt-md.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/txt-php.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/txt-py.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/txt-rb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/txt-rust.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/txt-script.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/comity/x-pdf.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/h5ai-0.27/ar.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/h5ai-0.27/aud.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/h5ai-0.27/bin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/h5ai-0.27/file.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/h5ai-0.27/folder-page.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/h5ai-0.27/folder-parent.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/h5ai-0.27/folder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/h5ai-0.27/img.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/h5ai-0.27/txt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/h5ai-0.27/vid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/themes/h5ai-0.27/x.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/back.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/crumb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/download.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/filter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/info-toggle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/paypal.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/preview-close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/preview-fullscreen.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/preview-next.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/preview-no-fullscreen.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/preview-prev.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/preview-raw.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/selected.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/sidebar.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/sort.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/spinner.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/tree-indicator.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/tree-toggle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/view-details.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/view-grid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/h5ai/public/images/ui/view-icons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/script/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // CommonJS 14 | factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | 21 | var pluses = /\+/g; 22 | 23 | function encode(s) { 24 | return config.raw ? s : encodeURIComponent(s); 25 | } 26 | 27 | function decode(s) { 28 | return config.raw ? s : decodeURIComponent(s); 29 | } 30 | 31 | function stringifyCookieValue(value) { 32 | return encode(config.json ? JSON.stringify(value) : String(value)); 33 | } 34 | 35 | function parseCookieValue(s) { 36 | if (s.indexOf('"') === 0) { 37 | // This is a quoted cookie as according to RFC2068, unescape... 38 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 39 | } 40 | 41 | try { 42 | // Replace server-side written pluses with spaces. 43 | // If we can't decode the cookie, ignore it, it's unusable. 44 | // If we can't parse the cookie, ignore it, it's unusable. 45 | s = decodeURIComponent(s.replace(pluses, ' ')); 46 | return config.json ? JSON.parse(s) : s; 47 | } catch(e) {} 48 | } 49 | 50 | function read(s, converter) { 51 | var value = config.raw ? s : parseCookieValue(s); 52 | return $.isFunction(converter) ? converter(value) : value; 53 | } 54 | 55 | var config = $.cookie = function (key, value, options) { 56 | 57 | // Write 58 | 59 | if (value !== undefined && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setTime(+t + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}; 79 | 80 | // To prevent the for loop in the first place assign an empty array 81 | // in case there are no cookies at all. Also prevents odd result when 82 | // calling $.cookie(). 83 | var cookies = document.cookie ? document.cookie.split('; ') : []; 84 | 85 | for (var i = 0, l = cookies.length; i < l; i++) { 86 | var parts = cookies[i].split('='); 87 | var name = decode(parts.shift()); 88 | var cookie = parts.join('='); 89 | 90 | if (key && key === name) { 91 | // If second argument (value) is a function it's a converter... 92 | result = read(cookie, value); 93 | break; 94 | } 95 | 96 | // Prevent storing a cookie that we couldn't decode. 97 | if (!key && (cookie = read(cookie)) !== undefined) { 98 | result[name] = cookie; 99 | } 100 | } 101 | 102 | return result; 103 | }; 104 | 105 | config.defaults = {}; 106 | 107 | $.removeCookie = function (key, options) { 108 | if ($.cookie(key) === undefined) { 109 | return false; 110 | } 111 | 112 | // Must not alter options, thus extending a fresh object... 113 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 114 | return !$.cookie(key); 115 | }; 116 | 117 | })); 118 | --------------------------------------------------------------------------------