作者 景龙
1 个管道 的构建 通过 耗费 3 秒

修改接口更新数据到七牛云

正在显示 100 个修改的文件 包含 2028 行增加288 行删除

要显示太多修改。

为保证性能只显示 100 of 100+ 个文件。

... ... @@ -637,15 +637,16 @@ class PersonController extends RestBaseController
//上传至七牛云
$url = str_replace('//', '/', str_replace('\\', '/', $info->getSaveName())); //20190602/1214564654.jpg目录
$filePath = $moveUrl.DS.$url;//本地磁盘路径
//上传至七牛云文件路径
$qiniu_file = 'uploads/'.$url;
$storage = new Storage();
$file = 'uploads/'.$url;
// $storage->upload($file, $filePath, 'image');
$arr[$k]['image_url'] = $host.DS.$file;
$storage->upload($qiniu_file, $filePath, 'image');
$arr[$k]['image_url'] = $host.DS.$qiniu_file;
$arr[$k]['file_time'] = time();
$sys = $this->getOperateSys();
// if($sys == 'Linux'){
// unlink($filePath);
// }
if($sys == 'Linux'){
unlink($filePath);//适用于linux
}
}else{
// 上传失败获取错误信息
$this->error($file->getError());
... ...
... ... @@ -31,7 +31,7 @@ return array (
//提示语
'tips' => '质量第一 精心检修 可守合同 永争一流',
//域名
'host' => 'http://xiaofang.w.bronet.cn',
'host' => 'http://app.tianjinhr.cn',
//甲方提交报修流程
'a_step' => ['甲方提交报修信息','乙方确认信息','乙方维修设备','乙方提交维修单','甲方验收维修结果','甲方验收完成'],
... ...
... ... @@ -35,7 +35,7 @@ class CommonController extends RestBaseController
if($res){
// $result['uid'] = $this->userId;
$result['company_name'] = $res['company_name'];
$result['logo'] = $host.'/upload/'.$res['logo'];
$result['logo'] = $host.'/'.$res['logo'];
//查找企业拥有的服务
$rule = $this->getRule($res,1);
$result['service'] = $rule;
... ... @@ -87,7 +87,7 @@ class CommonController extends RestBaseController
$field = 'id c_id,company_name,pid,logo';
$res = $this->getCompany($where,$field);
$result['company_name'] = $res['company_name'];
$result['logo'] = $host.'/upload/'.$res['logo'];
$result['logo'] = $host.'/'.$res['logo'];
// $res['uid'] = $this->userId;
//甲方
//查找企业拥有的服务
... ... @@ -150,7 +150,7 @@ class CommonController extends RestBaseController
if($value['id'] == 3){
$flag = 1;
}
$value['icon'] = $host.'/upload/'.$value['icon'];
$value['icon'] = $host.'/'.$value['icon'];
}
$add = [
'id' => 100,
... ... @@ -1616,11 +1616,11 @@ class CommonController extends RestBaseController
//甲方公司
$a_company = $this->getCompany(['id'=>$project['a_cid']],'id,company_name,logo');
$arr['a_company']['company_name'] = !empty($a_company['company_name'])?$a_company['company_name']:'';
$arr['a_company']['logo'] = !empty($a_company['logo'])?$host.'/upload/'.$a_company['logo']:'';
$arr['a_company']['logo'] = !empty($a_company['logo'])?$host.'/'.$a_company['logo']:'';
//乙方公司
$b_company = $this->getCompany(['id'=>$project['b_cid']],'id,company_name,logo');
$arr['b_company']['company_name'] = !empty($b_company['company_name'])?$b_company['company_name']:'';
$arr['b_company']['logo'] = !empty($b_company['logo'])?$host.'/upload/'.$b_company['logo']:'';
$arr['b_company']['logo'] = !empty($b_company['logo'])?$host.'/'.$b_company['logo']:'';
//报表标题
$arr['title'] = $project['name'].$report_name.'报表';
}
... ... @@ -1665,7 +1665,8 @@ class CommonController extends RestBaseController
$user1 = $this->getIdentity($h_user['identity'],$h_user['id']);
$arr['h_user_login']['party'] = $user1['party'];
}else{
$arr['h_user_login'] = [];
$arr['h_user_login']['user'] = '';
$arr['h_user_login']['party'] = '';
}
//甲方验收人
... ...
... ... @@ -14,6 +14,7 @@ namespace app\portal\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\db\Query;
use app\portal\model\InspectModel;
class AdminPartAController extends AdminBaseController
{
... ... @@ -105,6 +106,8 @@ class AdminPartAController extends AdminBaseController
}
}
$page = $list->render();
$host = new InspectModel();
$this->assign('host',$host::host);
$this->assign('list',$s_user['data']);
$this->assign('page',$page);
// 渲染模板输出
... ...
... ... @@ -14,6 +14,7 @@ namespace app\portal\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\db\Query;
use app\portal\model\InspectModel;
class AdminPartBController extends AdminBaseController
{
... ... @@ -88,6 +89,8 @@ class AdminPartBController extends AdminBaseController
}
}
$page = $list->render();
$host = new InspectModel();
$this->assign('host',$host::host);
$this->assign('list',$s_user['data']);
$this->assign('page',$page);
// 渲染模板输出
... ...
... ... @@ -14,6 +14,7 @@ namespace app\portal\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\db\Query;
use app\portal\model\InspectModel;
class AdminPartCController extends AdminBaseController
{
... ... @@ -84,6 +85,8 @@ class AdminPartCController extends AdminBaseController
}
}
$page = $list->render();
$host = new InspectModel();
$this->assign('host',$host::host);
$this->assign('list',$s_user['data']);
$this->assign('page',$page);
// 渲染模板输出
... ...
... ... @@ -19,6 +19,6 @@ class InspectModel extends Model
'more' => 'array',
];
const host = 'http://xiaofang.w.bronet.cn';
const host = 'http://app.tianjinhr.cn';
}
\ No newline at end of file
... ...
... ... @@ -33,7 +33,8 @@
"jpush/jpush": "^3.5",
"php-ffmpeg/php-ffmpeg": "^0.14.0",
"phpoffice/phpexcel": "^1.8",
"phpoffice/phpspreadsheet": "^1.8"
"phpoffice/phpspreadsheet": "^1.8",
"qiniu/php-sdk": "^7.2"
},
"extra": {
"think-path": "simplewind/thinkphp"
... ...
... ... @@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "eefad7073f8b6b0386400f460262980a",
"content-hash": "adf10b068808ca84c772fda4dcf1592c",
"packages": [
{
"name": "alchemy/binary-driver",
... ... @@ -234,23 +234,23 @@
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.10.0",
"version": "v4.11.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "d85d39da4576a6934b72480be6978fb10c860021"
"reference": "83ab08bc1af7d808a9e0fbf024f1c24bfd73c0a7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d85d39da4576a6934b72480be6978fb10c860021",
"reference": "d85d39da4576a6934b72480be6978fb10c860021",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/83ab08bc1af7d808a9e0fbf024f1c24bfd73c0a7",
"reference": "83ab08bc1af7d808a9e0fbf024f1c24bfd73c0a7",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"require-dev": {
"simpletest/simpletest": "^1.1"
"simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd"
},
"type": "library",
"autoload": {
... ... @@ -263,7 +263,7 @@
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL"
"LGPL-2.1-or-later"
],
"authors": [
{
... ... @@ -277,7 +277,7 @@
"keywords": [
"html"
],
"time": "2018-02-23T01:58:20+00:00"
"time": "2019-07-14T18:58:38+00:00"
},
{
"name": "jpush/jpush",
... ... @@ -881,16 +881,16 @@
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.8.1",
"version": "1.8.2",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "352c7002fefe4e4037d02654d853a1b09520946f"
"reference": "0c1346a1956347590b7db09533966307d20cb7cc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/352c7002fefe4e4037d02654d853a1b09520946f",
"reference": "352c7002fefe4e4037d02654d853a1b09520946f",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/0c1346a1956347590b7db09533966307d20cb7cc",
"reference": "0c1346a1956347590b7db09533966307d20cb7cc",
"shasum": ""
},
"require": {
... ... @@ -971,7 +971,7 @@
"xls",
"xlsx"
],
"time": "2019-07-01T20:46:51+00:00"
"time": "2019-07-08T21:21:25+00:00"
},
{
"name": "psr/log",
... ... @@ -1069,17 +1069,68 @@
"time": "2017-10-23T01:57:42+00:00"
},
{
"name": "qiniu/php-sdk",
"version": "v7.2.9",
"source": {
"type": "git",
"url": "https://github.com/qiniu/php-sdk.git",
"reference": "afe7d8715d8a688b1d8d8cdf031240d2363dad90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/qiniu/php-sdk/zipball/afe7d8715d8a688b1d8d8cdf031240d2363dad90",
"reference": "afe7d8715d8a688b1d8d8cdf031240d2363dad90",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.3"
},
"type": "library",
"autoload": {
"psr-4": {
"Qiniu\\": "src/Qiniu"
},
"files": [
"src/Qiniu/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Qiniu",
"email": "sdk@qiniu.com",
"homepage": "http://www.qiniu.com"
}
],
"description": "Qiniu Resource (Cloud) Storage SDK for PHP",
"homepage": "http://developer.qiniu.com/",
"keywords": [
"cloud",
"qiniu",
"sdk",
"storage"
],
"time": "2019-07-09T07:55:07+00:00"
},
{
"name": "symfony/filesystem",
"version": "v4.3.1",
"version": "v4.3.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "bf2af40d738dec5e433faea7b00daa4431d0a4cf"
"reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/bf2af40d738dec5e433faea7b00daa4431d0a4cf",
"reference": "bf2af40d738dec5e433faea7b00daa4431d0a4cf",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/b9896d034463ad6fd2bf17e2bf9418caecd6313d",
"reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d",
"shasum": ""
},
"require": {
... ... @@ -1116,7 +1167,7 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
"time": "2019-06-03T20:27:40+00:00"
"time": "2019-06-23T08:51:25+00:00"
},
{
"name": "symfony/polyfill-ctype",
... ... @@ -1178,7 +1229,7 @@
},
{
"name": "symfony/process",
"version": "v4.3.1",
"version": "v4.3.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
... ...
... ... @@ -40,7 +40,7 @@
<td>{$vo.position}</td>
<td>
<notempty name="vo.avatar">
<img width="25" height="25" src="{$vo.avatar}"/>
<img width="25" height="25" src="{$host}{$vo.avatar}"/>
<else/>
<img width="25" height="25" src="/themes/admin_simpleboot3/public/assets/images/headicon.png">
</notempty>
... ...
... ... @@ -39,7 +39,7 @@
<td>{$vo.position}</td>
<td>
<notempty name="vo.avatar">
<img width="25" height="25" src="{:cmf_get_image_url($vo.avatar)}"/>
<img width="25" height="25" src="{$host}{$vo.avatar}"/>
<else/>
<img width="25" height="25" src="/themes/admin_simpleboot3/public/assets/images/headicon.png">
</notempty>
... ...
... ... @@ -24,7 +24,6 @@
<th>职称</th>
<th>头像</th>
<th>手机</th>
<th>项目组</th>
<th>公司名称</th>
<th>子公司名称</th>
</tr>
... ... @@ -40,13 +39,12 @@
<td>{$vo.identity_c}</td>
<td>
<notempty name="vo.avatar">
<img width="25" height="25" src="{:cmf_get_image_url($vo.avatar)}"/>
<img width="25" height="25" src="{$host}{$vo.avatar}"/>
<else/>
<img width="25" height="25" src="/themes/admin_simpleboot3/public/assets/images/headicon.png">
</notempty>
</td>
<td>{$vo.mobile}</td>
<td></td>
<td>{$vo.company_name_head}</td>
<td>{$vo.company_name}</td>
</tr>
... ...
... ... @@ -67,6 +67,7 @@ return array(
'75c79eb1b25749b05a47976f32b0d8a2' => $vendorDir . '/markbaker/matrix/classes/src/operations/divideby.php',
'6ab8ad87a734f276a6bcd5a0fe1289be' => $vendorDir . '/markbaker/matrix/classes/src/operations/divideinto.php',
'2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
'841780ea2e1d6545ea3a253239d59c05' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/functions.php',
'1cfd2761b63b0a29ed23657ea394cb2d' => $vendorDir . '/topthink/think-captcha/src/helper.php',
'cc56288302d9df745d97c934d6a6e5f0' => $vendorDir . '/topthink/think-queue/src/common.php',
'644e9cafc67b331e17cc7661548f33d0' => $vendorDir . '/weiwei/api-doc/src/helper.php',
... ...
... ... @@ -14,6 +14,7 @@ return array(
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'),
'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'),
'Qiniu\\' => array($vendorDir . '/qiniu/php-sdk/src/Qiniu'),
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'),
... ...
... ... @@ -68,6 +68,7 @@ class ComposerStaticInit929fb365b9981d29459d58f676689cf7
'75c79eb1b25749b05a47976f32b0d8a2' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/divideby.php',
'6ab8ad87a734f276a6bcd5a0fe1289be' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/divideinto.php',
'2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
'841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php',
'1cfd2761b63b0a29ed23657ea394cb2d' => __DIR__ . '/..' . '/topthink/think-captcha/src/helper.php',
'cc56288302d9df745d97c934d6a6e5f0' => __DIR__ . '/..' . '/topthink/think-queue/src/common.php',
'644e9cafc67b331e17cc7661548f33d0' => __DIR__ . '/..' . '/weiwei/api-doc/src/helper.php',
... ... @@ -91,6 +92,10 @@ class ComposerStaticInit929fb365b9981d29459d58f676689cf7
'Symfony\\Component\\Process\\' => 26,
'Symfony\\Component\\Filesystem\\' => 29,
),
'Q' =>
array (
'Qiniu\\' => 6,
),
'P' =>
array (
'Psr\\SimpleCache\\' => 16,
... ... @@ -155,6 +160,10 @@ class ComposerStaticInit929fb365b9981d29459d58f676689cf7
array (
0 => __DIR__ . '/..' . '/symfony/filesystem',
),
'Qiniu\\' =>
array (
0 => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu',
),
'Psr\\SimpleCache\\' =>
array (
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
... ...
... ... @@ -235,26 +235,26 @@
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.10.0",
"version_normalized": "4.10.0.0",
"version": "v4.11.0",
"version_normalized": "4.11.0.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "d85d39da4576a6934b72480be6978fb10c860021"
"reference": "83ab08bc1af7d808a9e0fbf024f1c24bfd73c0a7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d85d39da4576a6934b72480be6978fb10c860021",
"reference": "d85d39da4576a6934b72480be6978fb10c860021",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/83ab08bc1af7d808a9e0fbf024f1c24bfd73c0a7",
"reference": "83ab08bc1af7d808a9e0fbf024f1c24bfd73c0a7",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"require-dev": {
"simpletest/simpletest": "^1.1"
"simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd"
},
"time": "2018-02-23T01:58:20+00:00",
"time": "2019-07-14T18:58:38+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
... ... @@ -267,7 +267,7 @@
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL"
"LGPL-2.1-or-later"
],
"authors": [
{
... ... @@ -902,17 +902,17 @@
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.8.1",
"version_normalized": "1.8.1.0",
"version": "1.8.2",
"version_normalized": "1.8.2.0",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "352c7002fefe4e4037d02654d853a1b09520946f"
"reference": "0c1346a1956347590b7db09533966307d20cb7cc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/352c7002fefe4e4037d02654d853a1b09520946f",
"reference": "352c7002fefe4e4037d02654d853a1b09520946f",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/0c1346a1956347590b7db09533966307d20cb7cc",
"reference": "0c1346a1956347590b7db09533966307d20cb7cc",
"shasum": ""
},
"require": {
... ... @@ -951,7 +951,7 @@
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
"time": "2019-07-01T20:46:51+00:00",
"time": "2019-07-08T21:21:25+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
... ... @@ -1096,25 +1096,78 @@
]
},
{
"name": "qiniu/php-sdk",
"version": "v7.2.9",
"version_normalized": "7.2.9.0",
"source": {
"type": "git",
"url": "https://github.com/qiniu/php-sdk.git",
"reference": "afe7d8715d8a688b1d8d8cdf031240d2363dad90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/qiniu/php-sdk/zipball/afe7d8715d8a688b1d8d8cdf031240d2363dad90",
"reference": "afe7d8715d8a688b1d8d8cdf031240d2363dad90",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.3"
},
"time": "2019-07-09T07:55:07+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Qiniu\\": "src/Qiniu"
},
"files": [
"src/Qiniu/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Qiniu",
"email": "sdk@qiniu.com",
"homepage": "http://www.qiniu.com"
}
],
"description": "Qiniu Resource (Cloud) Storage SDK for PHP",
"homepage": "http://developer.qiniu.com/",
"keywords": [
"cloud",
"qiniu",
"sdk",
"storage"
]
},
{
"name": "symfony/filesystem",
"version": "v4.3.1",
"version_normalized": "4.3.1.0",
"version": "v4.3.3",
"version_normalized": "4.3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "bf2af40d738dec5e433faea7b00daa4431d0a4cf"
"reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/bf2af40d738dec5e433faea7b00daa4431d0a4cf",
"reference": "bf2af40d738dec5e433faea7b00daa4431d0a4cf",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/b9896d034463ad6fd2bf17e2bf9418caecd6313d",
"reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/polyfill-ctype": "~1.8"
},
"time": "2019-06-03T20:27:40+00:00",
"time": "2019-06-23T08:51:25+00:00",
"type": "library",
"extra": {
"branch-alias": {
... ... @@ -1209,8 +1262,8 @@
},
{
"name": "symfony/process",
"version": "v4.3.1",
"version_normalized": "4.3.1.0",
"version": "v4.3.3",
"version_normalized": "4.3.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
... ...
... ... @@ -15,7 +15,7 @@ with these contents.
---------------------------------------------------------------------------
1. Compatibility
HTML Purifier is PHP 5 and PHP 7, and is actively tested from PHP 5.0.5
HTML Purifier is PHP 5 and PHP 7, and is actively tested from PHP 5.3
and up. It has no core dependencies with other libraries.
These optional extensions can enhance the capabilities of HTML Purifier:
... ... @@ -101,31 +101,6 @@ Autoload compatibility
autoloader, but there are some cases where you will need to change
your own code to accomodate HTML Purifier. These are those cases:
PHP VERSION IS LESS THAN 5.1.2, AND YOU'VE DEFINED __autoload
Because spl_autoload_register() doesn't exist in early versions
of PHP 5, HTML Purifier has no way of adding itself to the autoload
stack. Modify your __autoload function to test
HTMLPurifier_Bootstrap::autoload($class)
For example, suppose your autoload function looks like this:
function __autoload($class) {
require str_replace('_', '/', $class) . '.php';
return true;
}
A modified version with HTML Purifier would look like this:
function __autoload($class) {
if (HTMLPurifier_Bootstrap::autoload($class)) return true;
require str_replace('_', '/', $class) . '.php';
return true;
}
Note that there *is* some custom behavior in our autoloader; the
original autoloader in our example would work for 99% of the time,
but would fail when including language files.
AN __autoload FUNCTION IS DECLARED AFTER OUR AUTOLOADER IS REGISTERED
spl_autoload_register() has the curious behavior of disabling
the existing __autoload() handler. Users need to explicitly
... ... @@ -138,11 +113,6 @@ Autoload compatibility
spl_autoload_register('__autoload')
Users should also be on guard if they use a version of PHP previous
to 5.1.2 without an autoloader--HTML Purifier will define __autoload()
for you, which can collide with an autoloader that was added by *you*
later.
For better performance
----------------------
... ... @@ -204,9 +174,7 @@ For advanced users
HTMLPurifier.autoload.php
Registers our autoload handler HTMLPurifier_Bootstrap::autoload($class).
You can do these operations by yourself--in fact, you must modify your own
autoload handler if you are using a version of PHP earlier than PHP 5.1.2
(See "Autoload compatibility" above).
You can do these operations by yourself, if you like.
---------------------------------------------------------------------------
... ...
... ... @@ -11,7 +11,7 @@ pied de page, mais je recommande de lire le document.
1. Compatibilité
HTML Purifier fonctionne avec PHP 5. PHP 5.0.5 est la dernière version testée.
HTML Purifier fonctionne avec PHP 5. PHP 5.3 est la dernière version testée.
Il ne dépend pas d'autres librairies.
Les extensions optionnelles sont iconv (généralement déjà installée) et tidy
... ...
... ... @@ -9,6 +9,34 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
. Internal change
==========================
4.11.0, released 2019-07-14
# SafeScripting now matches case-sensitively against its whitelist (previously it was
case-insensitive.) Thanks Dimitri Gritsajuk <gritsajuk.dimitri@gmail.com>
for reporting.
! New directive %Core.AllowParseManyTags which allows parsing of many nested tags.
Thanks M. Suzuki <msuzuki1986@gmail.com> for contributing the patch.
! purifyArray now supports multidimensional arrays. Thanks
Sandro Miguel Marques <sandromiguel@sandromiguel.com> for contributing this patch.
! initial and inherit settings available for width, height, and the min-/max-
versions thereof. Thanks Michael Kliewe <info@phpgansta.de> for contributing
this patch.
! More color names are supported. Thanks Daijobou for contributing.
- Compatibility fixes for PHP 7.3, including new CI for PHP 7.3
(thank you Lukas Neumann <lksnmnn@gmail.com>) and removal of
reserved words in our constants (thanks Darko Hrgovic <darko@darkodev.com>
- Compatibility fixes for HHVM. Thanks Mateusz Turcza for contributing
this fix.
- HTML Purifier now never defines __autoload, fixing #196. Thanks
Michael Kliewe for reporting.
- In some situations, Config.php would report an undefined index: class
error; this has been fixed. Thanks DiLong Fa for contributing
this fix.
- We no longer produce <script /> tags; we always explicitly write
out the open and close tag. Thanks Dimitri Gritsajuk
<gritsajuk.dimitri@gmail.com> for contributing this fix.
- Better compatibility when IDNA constants are not present. Thanks
Mateusz Turcza <xemlock@gmail.com> for contributing this fix.
4.10.0, released 2018-02-22
# PHP 5.3 is no longer officially supported by HTML Purifier
(we did not specifically break support, but we are no longer
... ...
... ... @@ -26,4 +26,4 @@ Package available on [Composer](https://packagist.org/packages/ezyang/htmlpurifi
If you're using Composer to manage dependencies, you can use
$ composer require "ezyang/htmlpurifier":"dev-master"
$ composer require ezyang/htmlpurifier
... ...
4.10.0
\ No newline at end of file
4.11.0
\ No newline at end of file
... ...
HTML Purifier 4.9.x is a maintenance release, collecting a year
of accumulated bug fixes plus a few new features. New features
include support for min/max-width/height CSS, and rgba/hsl/hsla
in color specifications. Major bugfixes include improvements
in the Serializer cache to avoid chmod'ing directories, better
entity decoding (we won't accidentally encode entities that occur
in URLs) and rel="noopener" on links with target attributes,
to prevent them from overwriting the original frame.
4.9.3 works around an infinite loop bug in PHP 7.1 with the opcode
cache (and has one other, minor bugfix, avoiding using autoloading
when testing for DOMDocument presence). If these bugs do not
affect you, you do not need to upgrade.
HTML Purifier 4.11.x is a maintenance release, collecting a year
and a half of accumulated bug fixes. Most notable fixes are
compatibility with PHP 7.3, and case-sensitive matching for
the SafeScripting whitelist. There are a number small feature
enhancements, including an expanded supported color list,
initial and inherit support for {min-,max-,}{width,height}
and multidimensional array support for purifyArray.
... ...
... ... @@ -4,7 +4,7 @@
"type": "library",
"keywords": ["html"],
"homepage": "http://htmlpurifier.org/",
"license": "LGPL",
"license": "LGPL-2.1-or-later",
"authors": [
{
"name": "Edward Z. Yang",
... ... @@ -16,7 +16,7 @@
"php": ">=5.2"
},
"require-dev": {
"simpletest/simpletest": "^1.1"
"simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd"
},
"autoload": {
"psr-0": { "HTMLPurifier": "library/" },
... ...
... ... @@ -7,7 +7,7 @@
* primary concern and you are using an opcode cache. PLEASE DO NOT EDIT THIS
* FILE, changes will be overwritten the next time the script is run.
*
* @version 4.10.0
* @version 4.11.0
*
* @warning
* You must *not* include any other HTML Purifier files before this file,
... ...
... ... @@ -19,7 +19,7 @@
*/
/*
HTML Purifier 4.10.0 - Standards Compliant HTML Filtering
HTML Purifier 4.11.0 - Standards Compliant HTML Filtering
Copyright (C) 2006-2008 Edward Z. Yang
This library is free software; you can redistribute it and/or
... ... @@ -58,12 +58,12 @@ class HTMLPurifier
* Version of HTML Purifier.
* @type string
*/
public $version = '4.10.0';
public $version = '4.11.0';
/**
* Constant with version of HTML Purifier.
*/
const VERSION = '4.10.0';
const VERSION = '4.11.0';
/**
* Global configuration object.
... ... @@ -240,12 +240,16 @@ class HTMLPurifier
public function purifyArray($array_of_html, $config = null)
{
$context_array = array();
foreach ($array_of_html as $key => $html) {
$array_of_html[$key] = $this->purify($html, $config);
foreach($array_of_html as $key=>$value){
if (is_array($value)) {
$array[$key] = $this->purifyArray($value, $config);
} else {
$array[$key] = $this->purify($value, $config);
}
$context_array[$key] = $this->context;
}
$this->context = $context_array;
return $array_of_html;
return $array;
}
/**
... ...
... ... @@ -97,7 +97,11 @@ class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef
// PHP 5.3 and later support this functionality natively
if (function_exists('idn_to_ascii')) {
$string = idn_to_ascii($string, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
if (defined('IDNA_NONTRANSITIONAL_TO_ASCII') && defined('INTL_IDNA_VARIANT_UTS46')) {
$string = idn_to_ascii($string, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
} else {
$string = idn_to_ascii($string);
}
// If we have Net_IDNA2 support, we can support IRIs by
// punycoding them. (This is the most portable thing to do,
... ...
... ... @@ -220,15 +220,25 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
array(
new HTMLPurifier_AttrDef_CSS_Length('0'),
new HTMLPurifier_AttrDef_CSS_Percentage(true),
new HTMLPurifier_AttrDef_Enum(array('auto'))
new HTMLPurifier_AttrDef_Enum(array('auto', 'initial', 'inherit'))
)
);
$trusted_min_wh = new HTMLPurifier_AttrDef_CSS_Composite(
array(
new HTMLPurifier_AttrDef_CSS_Length('0'),
new HTMLPurifier_AttrDef_CSS_Percentage(true),
new HTMLPurifier_AttrDef_Enum(array('initial', 'inherit'))
)
);
$trusted_max_wh = new HTMLPurifier_AttrDef_CSS_Composite(
array(
new HTMLPurifier_AttrDef_CSS_Length('0'),
new HTMLPurifier_AttrDef_CSS_Percentage(true),
new HTMLPurifier_AttrDef_Enum(array('none', 'initial', 'inherit'))
)
);
$max = $config->get('CSS.MaxImgLength');
$this->info['min-width'] =
$this->info['max-width'] =
$this->info['min-height'] =
$this->info['max-height'] =
$this->info['width'] =
$this->info['height'] =
$max === null ?
... ... @@ -245,6 +255,38 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
// For everyone else:
$trusted_wh
);
$this->info['min-width'] =
$this->info['min-height'] =
$max === null ?
$trusted_min_wh :
new HTMLPurifier_AttrDef_Switch(
'img',
// For img tags:
new HTMLPurifier_AttrDef_CSS_Composite(
array(
new HTMLPurifier_AttrDef_CSS_Length('0', $max),
new HTMLPurifier_AttrDef_Enum(array('initial', 'inherit'))
)
),
// For everyone else:
$trusted_min_wh
);
$this->info['max-width'] =
$this->info['max-height'] =
$max === null ?
$trusted_max_wh :
new HTMLPurifier_AttrDef_Switch(
'img',
// For img tags:
new HTMLPurifier_AttrDef_CSS_Composite(
array(
new HTMLPurifier_AttrDef_CSS_Length('0', $max),
new HTMLPurifier_AttrDef_Enum(array('none', 'initial', 'inherit'))
)
),
// For everyone else:
$trusted_max_wh
);
$this->info['text-decoration'] = new HTMLPurifier_AttrDef_CSS_TextDecoration();
... ...
... ... @@ -21,7 +21,7 @@ class HTMLPurifier_Config
* HTML Purifier's version
* @type string
*/
public $version = '4.10.0';
public $version = '4.11.0';
/**
* Whether or not to automatically finalize
... ... @@ -890,7 +890,7 @@ class HTMLPurifier_Config
// zip(tail(trace), trace) -- but PHP is not Haskell har har
for ($i = 0, $c = count($trace); $i < $c - 1; $i++) {
// XXX this is not correct on some versions of HTML Purifier
if ($trace[$i + 1]['class'] === 'HTMLPurifier_Config') {
if (isset($trace[$i + 1]['class']) && $trace[$i + 1]['class'] === 'HTMLPurifier_Config') {
continue;
}
$frame = $trace[$i];
... ...
... ... @@ -100,7 +100,7 @@ class HTMLPurifier_ConfigSchema
* @param string $key Name of directive
* @param mixed $default Default value of directive
* @param string $type Allowed type of the directive. See
* HTMLPurifier_DirectiveDef::$type for allowed values
* HTMLPurifier_VarParser::$types for allowed values
* @param bool $allow_null Whether or not to allow null values
*/
public function add($key, $default, $type, $allow_null)
... ...
BO:25:"HTMLPurifier_ConfigSchema":3:{s:8:"defaults";a:126:{s:19:"Attr.AllowedClasses";N;s:24:"Attr.AllowedFrameTargets";a:0:{}s:15:"Attr.AllowedRel";a:0:{}s:15:"Attr.AllowedRev";a:0:{}s:18:"Attr.ClassUseCDATA";N;s:20:"Attr.DefaultImageAlt";N;s:24:"Attr.DefaultInvalidImage";s:0:"";s:27:"Attr.DefaultInvalidImageAlt";s:13:"Invalid image";s:19:"Attr.DefaultTextDir";s:3:"ltr";s:13:"Attr.EnableID";b:0;s:21:"Attr.ForbiddenClasses";a:0:{}s:13:"Attr.ID.HTML5";N;s:16:"Attr.IDBlacklist";a:0:{}s:22:"Attr.IDBlacklistRegexp";N;s:13:"Attr.IDPrefix";s:0:"";s:18:"Attr.IDPrefixLocal";s:0:"";s:24:"AutoFormat.AutoParagraph";b:0;s:17:"AutoFormat.Custom";a:0:{}s:25:"AutoFormat.DisplayLinkURI";b:0;s:18:"AutoFormat.Linkify";b:0;s:33:"AutoFormat.PurifierLinkify.DocURL";s:3:"#%s";s:26:"AutoFormat.PurifierLinkify";b:0;s:32:"AutoFormat.RemoveEmpty.Predicate";a:4:{s:8:"colgroup";a:0:{}s:2:"th";a:0:{}s:2:"td";a:0:{}s:6:"iframe";a:1:{i:0;s:3:"src";}}s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";a:2:{s:2:"td";b:1;s:2:"th";b:1;}s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";b:0;s:22:"AutoFormat.RemoveEmpty";b:0;s:39:"AutoFormat.RemoveSpansWithoutAttributes";b:0;s:19:"CSS.AllowDuplicates";b:0;s:18:"CSS.AllowImportant";b:0;s:15:"CSS.AllowTricky";b:0;s:16:"CSS.AllowedFonts";N;s:21:"CSS.AllowedProperties";N;s:17:"CSS.DefinitionRev";i:1;s:23:"CSS.ForbiddenProperties";a:0:{}s:16:"CSS.MaxImgLength";s:6:"1200px";s:15:"CSS.Proprietary";b:0;s:11:"CSS.Trusted";b:0;s:20:"Cache.DefinitionImpl";s:10:"Serializer";s:20:"Cache.SerializerPath";N;s:27:"Cache.SerializerPermissions";i:493;s:22:"Core.AggressivelyFixLt";b:1;s:29:"Core.AggressivelyRemoveScript";b:1;s:28:"Core.AllowHostnameUnderscore";b:0;s:23:"Core.AllowParseManyTags";b:0;s:18:"Core.CollectErrors";b:0;s:18:"Core.ColorKeywords";a:148:{s:9:"aliceblue";s:7:"#F0F8FF";s:12:"antiquewhite";s:7:"#FAEBD7";s:4:"aqua";s:7:"#00FFFF";s:10:"aquamarine";s:7:"#7FFFD4";s:5:"azure";s:7:"#F0FFFF";s:5:"beige";s:7:"#F5F5DC";s:6:"bisque";s:7:"#FFE4C4";s:5:"black";s:7:"#000000";s:14:"blanchedalmond";s:7:"#FFEBCD";s:4:"blue";s:7:"#0000FF";s:10:"blueviolet";s:7:"#8A2BE2";s:5:"brown";s:7:"#A52A2A";s:9:"burlywood";s:7:"#DEB887";s:9:"cadetblue";s:7:"#5F9EA0";s:10:"chartreuse";s:7:"#7FFF00";s:9:"chocolate";s:7:"#D2691E";s:5:"coral";s:7:"#FF7F50";s:14:"cornflowerblue";s:7:"#6495ED";s:8:"cornsilk";s:7:"#FFF8DC";s:7:"crimson";s:7:"#DC143C";s:4:"cyan";s:7:"#00FFFF";s:8:"darkblue";s:7:"#00008B";s:8:"darkcyan";s:7:"#008B8B";s:13:"darkgoldenrod";s:7:"#B8860B";s:8:"darkgray";s:7:"#A9A9A9";s:8:"darkgrey";s:7:"#A9A9A9";s:9:"darkgreen";s:7:"#006400";s:9:"darkkhaki";s:7:"#BDB76B";s:11:"darkmagenta";s:7:"#8B008B";s:14:"darkolivegreen";s:7:"#556B2F";s:10:"darkorange";s:7:"#FF8C00";s:10:"darkorchid";s:7:"#9932CC";s:7:"darkred";s:7:"#8B0000";s:10:"darksalmon";s:7:"#E9967A";s:12:"darkseagreen";s:7:"#8FBC8F";s:13:"darkslateblue";s:7:"#483D8B";s:13:"darkslategray";s:7:"#2F4F4F";s:13:"darkslategrey";s:7:"#2F4F4F";s:13:"darkturquoise";s:7:"#00CED1";s:10:"darkviolet";s:7:"#9400D3";s:8:"deeppink";s:7:"#FF1493";s:11:"deepskyblue";s:7:"#00BFFF";s:7:"dimgray";s:7:"#696969";s:7:"dimgrey";s:7:"#696969";s:10:"dodgerblue";s:7:"#1E90FF";s:9:"firebrick";s:7:"#B22222";s:11:"floralwhite";s:7:"#FFFAF0";s:11:"forestgreen";s:7:"#228B22";s:7:"fuchsia";s:7:"#FF00FF";s:9:"gainsboro";s:7:"#DCDCDC";s:10:"ghostwhite";s:7:"#F8F8FF";s:4:"gold";s:7:"#FFD700";s:9:"goldenrod";s:7:"#DAA520";s:4:"gray";s:7:"#808080";s:4:"grey";s:7:"#808080";s:5:"green";s:7:"#008000";s:11:"greenyellow";s:7:"#ADFF2F";s:8:"honeydew";s:7:"#F0FFF0";s:7:"hotpink";s:7:"#FF69B4";s:9:"indianred";s:7:"#CD5C5C";s:6:"indigo";s:7:"#4B0082";s:5:"ivory";s:7:"#FFFFF0";s:5:"khaki";s:7:"#F0E68C";s:8:"lavender";s:7:"#E6E6FA";s:13:"lavenderblush";s:7:"#FFF0F5";s:9:"lawngreen";s:7:"#7CFC00";s:12:"lemonchiffon";s:7:"#FFFACD";s:9:"lightblue";s:7:"#ADD8E6";s:10:"lightcoral";s:7:"#F08080";s:9:"lightcyan";s:7:"#E0FFFF";s:20:"lightgoldenrodyellow";s:7:"#FAFAD2";s:9:"lightgray";s:7:"#D3D3D3";s:9:"lightgrey";s:7:"#D3D3D3";s:10:"lightgreen";s:7:"#90EE90";s:9:"lightpink";s:7:"#FFB6C1";s:11:"lightsalmon";s:7:"#FFA07A";s:13:"lightseagreen";s:7:"#20B2AA";s:12:"lightskyblue";s:7:"#87CEFA";s:14:"lightslategray";s:7:"#778899";s:14:"lightslategrey";s:7:"#778899";s:14:"lightsteelblue";s:7:"#B0C4DE";s:11:"lightyellow";s:7:"#FFFFE0";s:4:"lime";s:7:"#00FF00";s:9:"limegreen";s:7:"#32CD32";s:5:"linen";s:7:"#FAF0E6";s:7:"magenta";s:7:"#FF00FF";s:6:"maroon";s:7:"#800000";s:16:"mediumaquamarine";s:7:"#66CDAA";s:10:"mediumblue";s:7:"#0000CD";s:12:"mediumorchid";s:7:"#BA55D3";s:12:"mediumpurple";s:7:"#9370DB";s:14:"mediumseagreen";s:7:"#3CB371";s:15:"mediumslateblue";s:7:"#7B68EE";s:17:"mediumspringgreen";s:7:"#00FA9A";s:15:"mediumturquoise";s:7:"#48D1CC";s:15:"mediumvioletred";s:7:"#C71585";s:12:"midnightblue";s:7:"#191970";s:9:"mintcream";s:7:"#F5FFFA";s:9:"mistyrose";s:7:"#FFE4E1";s:8:"moccasin";s:7:"#FFE4B5";s:11:"navajowhite";s:7:"#FFDEAD";s:4:"navy";s:7:"#000080";s:7:"oldlace";s:7:"#FDF5E6";s:5:"olive";s:7:"#808000";s:9:"olivedrab";s:7:"#6B8E23";s:6:"orange";s:7:"#FFA500";s:9:"orangered";s:7:"#FF4500";s:6:"orchid";s:7:"#DA70D6";s:13:"palegoldenrod";s:7:"#EEE8AA";s:9:"palegreen";s:7:"#98FB98";s:13:"paleturquoise";s:7:"#AFEEEE";s:13:"palevioletred";s:7:"#DB7093";s:10:"papayawhip";s:7:"#FFEFD5";s:9:"peachpuff";s:7:"#FFDAB9";s:4:"peru";s:7:"#CD853F";s:4:"pink";s:7:"#FFC0CB";s:4:"plum";s:7:"#DDA0DD";s:10:"powderblue";s:7:"#B0E0E6";s:6:"purple";s:7:"#800080";s:13:"rebeccapurple";s:7:"#663399";s:3:"red";s:7:"#FF0000";s:9:"rosybrown";s:7:"#BC8F8F";s:9:"royalblue";s:7:"#4169E1";s:11:"saddlebrown";s:7:"#8B4513";s:6:"salmon";s:7:"#FA8072";s:10:"sandybrown";s:7:"#F4A460";s:8:"seagreen";s:7:"#2E8B57";s:8:"seashell";s:7:"#FFF5EE";s:6:"sienna";s:7:"#A0522D";s:6:"silver";s:7:"#C0C0C0";s:7:"skyblue";s:7:"#87CEEB";s:9:"slateblue";s:7:"#6A5ACD";s:9:"slategray";s:7:"#708090";s:9:"slategrey";s:7:"#708090";s:4:"snow";s:7:"#FFFAFA";s:11:"springgreen";s:7:"#00FF7F";s:9:"steelblue";s:7:"#4682B4";s:3:"tan";s:7:"#D2B48C";s:4:"teal";s:7:"#008080";s:7:"thistle";s:7:"#D8BFD8";s:6:"tomato";s:7:"#FF6347";s:9:"turquoise";s:7:"#40E0D0";s:6:"violet";s:7:"#EE82EE";s:5:"wheat";s:7:"#F5DEB3";s:5:"white";s:7:"#FFFFFF";s:10:"whitesmoke";s:7:"#F5F5F5";s:6:"yellow";s:7:"#FFFF00";s:11:"yellowgreen";s:7:"#9ACD32";}s:30:"Core.ConvertDocumentToFragment";b:1;s:36:"Core.DirectLexLineNumberSyncInterval";i:0;s:20:"Core.DisableExcludes";b:0;s:15:"Core.EnableIDNA";b:0;s:13:"Core.Encoding";s:5:"utf-8";s:26:"Core.EscapeInvalidChildren";b:0;s:22:"Core.EscapeInvalidTags";b:0;s:29:"Core.EscapeNonASCIICharacters";b:0;s:19:"Core.HiddenElements";a:2:{s:6:"script";b:1;s:5:"style";b:1;}s:13:"Core.Language";s:2:"en";s:24:"Core.LegacyEntityDecoder";b:0;s:14:"Core.LexerImpl";N;s:24:"Core.MaintainLineNumbers";N;s:22:"Core.NormalizeNewlines";b:1;s:21:"Core.RemoveInvalidImg";b:1;s:33:"Core.RemoveProcessingInstructions";b:0;s:25:"Core.RemoveScriptContents";N;s:13:"Filter.Custom";a:0:{}s:34:"Filter.ExtractStyleBlocks.Escaping";b:1;s:31:"Filter.ExtractStyleBlocks.Scope";N;s:34:"Filter.ExtractStyleBlocks.TidyImpl";N;s:25:"Filter.ExtractStyleBlocks";b:0;s:14:"Filter.YouTube";b:0;s:12:"HTML.Allowed";N;s:22:"HTML.AllowedAttributes";N;s:20:"HTML.AllowedComments";a:0:{}s:26:"HTML.AllowedCommentsRegexp";N;s:20:"HTML.AllowedElements";N;s:19:"HTML.AllowedModules";N;s:23:"HTML.Attr.Name.UseCDATA";b:0;s:17:"HTML.BlockWrapper";s:1:"p";s:16:"HTML.CoreModules";a:7:{s:9:"Structure";b:1;s:4:"Text";b:1;s:9:"Hypertext";b:1;s:4:"List";b:1;s:22:"NonXMLCommonAttributes";b:1;s:19:"XMLCommonAttributes";b:1;s:16:"CommonAttributes";b:1;}s:18:"HTML.CustomDoctype";N;s:17:"HTML.DefinitionID";N;s:18:"HTML.DefinitionRev";i:1;s:12:"HTML.Doctype";N;s:25:"HTML.FlashAllowFullScreen";b:0;s:24:"HTML.ForbiddenAttributes";a:0:{}s:22:"HTML.ForbiddenElements";a:0:{}s:17:"HTML.MaxImgLength";i:1200;s:13:"HTML.Nofollow";b:0;s:11:"HTML.Parent";s:3:"div";s:16:"HTML.Proprietary";b:0;s:14:"HTML.SafeEmbed";b:0;s:15:"HTML.SafeIframe";b:0;s:15:"HTML.SafeObject";b:0;s:18:"HTML.SafeScripting";a:0:{}s:11:"HTML.Strict";b:0;s:16:"HTML.TargetBlank";b:0;s:19:"HTML.TargetNoopener";b:1;s:21:"HTML.TargetNoreferrer";b:1;s:12:"HTML.TidyAdd";a:0:{}s:14:"HTML.TidyLevel";s:6:"medium";s:15:"HTML.TidyRemove";a:0:{}s:12:"HTML.Trusted";b:0;s:10:"HTML.XHTML";b:1;s:28:"Output.CommentScriptContents";b:1;s:19:"Output.FixInnerHTML";b:1;s:18:"Output.FlashCompat";b:0;s:14:"Output.Newline";N;s:15:"Output.SortAttr";b:0;s:17:"Output.TidyFormat";b:0;s:17:"Test.ForceNoIconv";b:0;s:18:"URI.AllowedSchemes";a:7:{s:4:"http";b:1;s:5:"https";b:1;s:6:"mailto";b:1;s:3:"ftp";b:1;s:4:"nntp";b:1;s:4:"news";b:1;s:3:"tel";b:1;}s:8:"URI.Base";N;s:17:"URI.DefaultScheme";s:4:"http";s:16:"URI.DefinitionID";N;s:17:"URI.DefinitionRev";i:1;s:11:"URI.Disable";b:0;s:19:"URI.DisableExternal";b:0;s:28:"URI.DisableExternalResources";b:0;s:20:"URI.DisableResources";b:0;s:8:"URI.Host";N;s:17:"URI.HostBlacklist";a:0:{}s:16:"URI.MakeAbsolute";b:0;s:9:"URI.Munge";N;s:18:"URI.MungeResources";b:0;s:18:"URI.MungeSecretKey";N;s:26:"URI.OverrideAllowedSchemes";b:1;s:20:"URI.SafeIframeRegexp";N;}s:12:"defaultPlist";O:25:"HTMLPurifier_PropertyList":3:{s:7:"*data";a:126:{s:19:"Attr.AllowedClasses";N;s:24:"Attr.AllowedFrameTargets";a:0:{}s:15:"Attr.AllowedRel";a:0:{}s:15:"Attr.AllowedRev";a:0:{}s:18:"Attr.ClassUseCDATA";N;s:20:"Attr.DefaultImageAlt";N;s:24:"Attr.DefaultInvalidImage";s:0:"";s:27:"Attr.DefaultInvalidImageAlt";s:13:"Invalid image";s:19:"Attr.DefaultTextDir";s:3:"ltr";s:13:"Attr.EnableID";b:0;s:21:"Attr.ForbiddenClasses";a:0:{}s:13:"Attr.ID.HTML5";N;s:16:"Attr.IDBlacklist";a:0:{}s:22:"Attr.IDBlacklistRegexp";N;s:13:"Attr.IDPrefix";s:0:"";s:18:"Attr.IDPrefixLocal";s:0:"";s:24:"AutoFormat.AutoParagraph";b:0;s:17:"AutoFormat.Custom";a:0:{}s:25:"AutoFormat.DisplayLinkURI";b:0;s:18:"AutoFormat.Linkify";b:0;s:33:"AutoFormat.PurifierLinkify.DocURL";s:3:"#%s";s:26:"AutoFormat.PurifierLinkify";b:0;s:32:"AutoFormat.RemoveEmpty.Predicate";a:4:{s:8:"colgroup";a:0:{}s:2:"th";a:0:{}s:2:"td";a:0:{}s:6:"iframe";a:1:{i:0;s:3:"src";}}s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";a:2:{s:2:"td";b:1;s:2:"th";b:1;}s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";b:0;s:22:"AutoFormat.RemoveEmpty";b:0;s:39:"AutoFormat.RemoveSpansWithoutAttributes";b:0;s:19:"CSS.AllowDuplicates";b:0;s:18:"CSS.AllowImportant";b:0;s:15:"CSS.AllowTricky";b:0;s:16:"CSS.AllowedFonts";N;s:21:"CSS.AllowedProperties";N;s:17:"CSS.DefinitionRev";i:1;s:23:"CSS.ForbiddenProperties";a:0:{}s:16:"CSS.MaxImgLength";s:6:"1200px";s:15:"CSS.Proprietary";b:0;s:11:"CSS.Trusted";b:0;s:20:"Cache.DefinitionImpl";s:10:"Serializer";s:20:"Cache.SerializerPath";N;s:27:"Cache.SerializerPermissions";i:493;s:22:"Core.AggressivelyFixLt";b:1;s:29:"Core.AggressivelyRemoveScript";b:1;s:28:"Core.AllowHostnameUnderscore";b:0;s:23:"Core.AllowParseManyTags";b:0;s:18:"Core.CollectErrors";b:0;s:18:"Core.ColorKeywords";a:148:{s:9:"aliceblue";s:7:"#F0F8FF";s:12:"antiquewhite";s:7:"#FAEBD7";s:4:"aqua";s:7:"#00FFFF";s:10:"aquamarine";s:7:"#7FFFD4";s:5:"azure";s:7:"#F0FFFF";s:5:"beige";s:7:"#F5F5DC";s:6:"bisque";s:7:"#FFE4C4";s:5:"black";s:7:"#000000";s:14:"blanchedalmond";s:7:"#FFEBCD";s:4:"blue";s:7:"#0000FF";s:10:"blueviolet";s:7:"#8A2BE2";s:5:"brown";s:7:"#A52A2A";s:9:"burlywood";s:7:"#DEB887";s:9:"cadetblue";s:7:"#5F9EA0";s:10:"chartreuse";s:7:"#7FFF00";s:9:"chocolate";s:7:"#D2691E";s:5:"coral";s:7:"#FF7F50";s:14:"cornflowerblue";s:7:"#6495ED";s:8:"cornsilk";s:7:"#FFF8DC";s:7:"crimson";s:7:"#DC143C";s:4:"cyan";s:7:"#00FFFF";s:8:"darkblue";s:7:"#00008B";s:8:"darkcyan";s:7:"#008B8B";s:13:"darkgoldenrod";s:7:"#B8860B";s:8:"darkgray";s:7:"#A9A9A9";s:8:"darkgrey";s:7:"#A9A9A9";s:9:"darkgreen";s:7:"#006400";s:9:"darkkhaki";s:7:"#BDB76B";s:11:"darkmagenta";s:7:"#8B008B";s:14:"darkolivegreen";s:7:"#556B2F";s:10:"darkorange";s:7:"#FF8C00";s:10:"darkorchid";s:7:"#9932CC";s:7:"darkred";s:7:"#8B0000";s:10:"darksalmon";s:7:"#E9967A";s:12:"darkseagreen";s:7:"#8FBC8F";s:13:"darkslateblue";s:7:"#483D8B";s:13:"darkslategray";s:7:"#2F4F4F";s:13:"darkslategrey";s:7:"#2F4F4F";s:13:"darkturquoise";s:7:"#00CED1";s:10:"darkviolet";s:7:"#9400D3";s:8:"deeppink";s:7:"#FF1493";s:11:"deepskyblue";s:7:"#00BFFF";s:7:"dimgray";s:7:"#696969";s:7:"dimgrey";s:7:"#696969";s:10:"dodgerblue";s:7:"#1E90FF";s:9:"firebrick";s:7:"#B22222";s:11:"floralwhite";s:7:"#FFFAF0";s:11:"forestgreen";s:7:"#228B22";s:7:"fuchsia";s:7:"#FF00FF";s:9:"gainsboro";s:7:"#DCDCDC";s:10:"ghostwhite";s:7:"#F8F8FF";s:4:"gold";s:7:"#FFD700";s:9:"goldenrod";s:7:"#DAA520";s:4:"gray";s:7:"#808080";s:4:"grey";s:7:"#808080";s:5:"green";s:7:"#008000";s:11:"greenyellow";s:7:"#ADFF2F";s:8:"honeydew";s:7:"#F0FFF0";s:7:"hotpink";s:7:"#FF69B4";s:9:"indianred";s:7:"#CD5C5C";s:6:"indigo";s:7:"#4B0082";s:5:"ivory";s:7:"#FFFFF0";s:5:"khaki";s:7:"#F0E68C";s:8:"lavender";s:7:"#E6E6FA";s:13:"lavenderblush";s:7:"#FFF0F5";s:9:"lawngreen";s:7:"#7CFC00";s:12:"lemonchiffon";s:7:"#FFFACD";s:9:"lightblue";s:7:"#ADD8E6";s:10:"lightcoral";s:7:"#F08080";s:9:"lightcyan";s:7:"#E0FFFF";s:20:"lightgoldenrodyellow";s:7:"#FAFAD2";s:9:"lightgray";s:7:"#D3D3D3";s:9:"lightgrey";s:7:"#D3D3D3";s:10:"lightgreen";s:7:"#90EE90";s:9:"lightpink";s:7:"#FFB6C1";s:11:"lightsalmon";s:7:"#FFA07A";s:13:"lightseagreen";s:7:"#20B2AA";s:12:"lightskyblue";s:7:"#87CEFA";s:14:"lightslategray";s:7:"#778899";s:14:"lightslategrey";s:7:"#778899";s:14:"lightsteelblue";s:7:"#B0C4DE";s:11:"lightyellow";s:7:"#FFFFE0";s:4:"lime";s:7:"#00FF00";s:9:"limegreen";s:7:"#32CD32";s:5:"linen";s:7:"#FAF0E6";s:7:"magenta";s:7:"#FF00FF";s:6:"maroon";s:7:"#800000";s:16:"mediumaquamarine";s:7:"#66CDAA";s:10:"mediumblue";s:7:"#0000CD";s:12:"mediumorchid";s:7:"#BA55D3";s:12:"mediumpurple";s:7:"#9370DB";s:14:"mediumseagreen";s:7:"#3CB371";s:15:"mediumslateblue";s:7:"#7B68EE";s:17:"mediumspringgreen";s:7:"#00FA9A";s:15:"mediumturquoise";s:7:"#48D1CC";s:15:"mediumvioletred";s:7:"#C71585";s:12:"midnightblue";s:7:"#191970";s:9:"mintcream";s:7:"#F5FFFA";s:9:"mistyrose";s:7:"#FFE4E1";s:8:"moccasin";s:7:"#FFE4B5";s:11:"navajowhite";s:7:"#FFDEAD";s:4:"navy";s:7:"#000080";s:7:"oldlace";s:7:"#FDF5E6";s:5:"olive";s:7:"#808000";s:9:"olivedrab";s:7:"#6B8E23";s:6:"orange";s:7:"#FFA500";s:9:"orangered";s:7:"#FF4500";s:6:"orchid";s:7:"#DA70D6";s:13:"palegoldenrod";s:7:"#EEE8AA";s:9:"palegreen";s:7:"#98FB98";s:13:"paleturquoise";s:7:"#AFEEEE";s:13:"palevioletred";s:7:"#DB7093";s:10:"papayawhip";s:7:"#FFEFD5";s:9:"peachpuff";s:7:"#FFDAB9";s:4:"peru";s:7:"#CD853F";s:4:"pink";s:7:"#FFC0CB";s:4:"plum";s:7:"#DDA0DD";s:10:"powderblue";s:7:"#B0E0E6";s:6:"purple";s:7:"#800080";s:13:"rebeccapurple";s:7:"#663399";s:3:"red";s:7:"#FF0000";s:9:"rosybrown";s:7:"#BC8F8F";s:9:"royalblue";s:7:"#4169E1";s:11:"saddlebrown";s:7:"#8B4513";s:6:"salmon";s:7:"#FA8072";s:10:"sandybrown";s:7:"#F4A460";s:8:"seagreen";s:7:"#2E8B57";s:8:"seashell";s:7:"#FFF5EE";s:6:"sienna";s:7:"#A0522D";s:6:"silver";s:7:"#C0C0C0";s:7:"skyblue";s:7:"#87CEEB";s:9:"slateblue";s:7:"#6A5ACD";s:9:"slategray";s:7:"#708090";s:9:"slategrey";s:7:"#708090";s:4:"snow";s:7:"#FFFAFA";s:11:"springgreen";s:7:"#00FF7F";s:9:"steelblue";s:7:"#4682B4";s:3:"tan";s:7:"#D2B48C";s:4:"teal";s:7:"#008080";s:7:"thistle";s:7:"#D8BFD8";s:6:"tomato";s:7:"#FF6347";s:9:"turquoise";s:7:"#40E0D0";s:6:"violet";s:7:"#EE82EE";s:5:"wheat";s:7:"#F5DEB3";s:5:"white";s:7:"#FFFFFF";s:10:"whitesmoke";s:7:"#F5F5F5";s:6:"yellow";s:7:"#FFFF00";s:11:"yellowgreen";s:7:"#9ACD32";}s:30:"Core.ConvertDocumentToFragment";b:1;s:36:"Core.DirectLexLineNumberSyncInterval";i:0;s:20:"Core.DisableExcludes";b:0;s:15:"Core.EnableIDNA";b:0;s:13:"Core.Encoding";s:5:"utf-8";s:26:"Core.EscapeInvalidChildren";b:0;s:22:"Core.EscapeInvalidTags";b:0;s:29:"Core.EscapeNonASCIICharacters";b:0;s:19:"Core.HiddenElements";a:2:{s:6:"script";b:1;s:5:"style";b:1;}s:13:"Core.Language";s:2:"en";s:24:"Core.LegacyEntityDecoder";b:0;s:14:"Core.LexerImpl";N;s:24:"Core.MaintainLineNumbers";N;s:22:"Core.NormalizeNewlines";b:1;s:21:"Core.RemoveInvalidImg";b:1;s:33:"Core.RemoveProcessingInstructions";b:0;s:25:"Core.RemoveScriptContents";N;s:13:"Filter.Custom";a:0:{}s:34:"Filter.ExtractStyleBlocks.Escaping";b:1;s:31:"Filter.ExtractStyleBlocks.Scope";N;s:34:"Filter.ExtractStyleBlocks.TidyImpl";N;s:25:"Filter.ExtractStyleBlocks";b:0;s:14:"Filter.YouTube";b:0;s:12:"HTML.Allowed";N;s:22:"HTML.AllowedAttributes";N;s:20:"HTML.AllowedComments";a:0:{}s:26:"HTML.AllowedCommentsRegexp";N;s:20:"HTML.AllowedElements";N;s:19:"HTML.AllowedModules";N;s:23:"HTML.Attr.Name.UseCDATA";b:0;s:17:"HTML.BlockWrapper";s:1:"p";s:16:"HTML.CoreModules";a:7:{s:9:"Structure";b:1;s:4:"Text";b:1;s:9:"Hypertext";b:1;s:4:"List";b:1;s:22:"NonXMLCommonAttributes";b:1;s:19:"XMLCommonAttributes";b:1;s:16:"CommonAttributes";b:1;}s:18:"HTML.CustomDoctype";N;s:17:"HTML.DefinitionID";N;s:18:"HTML.DefinitionRev";i:1;s:12:"HTML.Doctype";N;s:25:"HTML.FlashAllowFullScreen";b:0;s:24:"HTML.ForbiddenAttributes";a:0:{}s:22:"HTML.ForbiddenElements";a:0:{}s:17:"HTML.MaxImgLength";i:1200;s:13:"HTML.Nofollow";b:0;s:11:"HTML.Parent";s:3:"div";s:16:"HTML.Proprietary";b:0;s:14:"HTML.SafeEmbed";b:0;s:15:"HTML.SafeIframe";b:0;s:15:"HTML.SafeObject";b:0;s:18:"HTML.SafeScripting";a:0:{}s:11:"HTML.Strict";b:0;s:16:"HTML.TargetBlank";b:0;s:19:"HTML.TargetNoopener";b:1;s:21:"HTML.TargetNoreferrer";b:1;s:12:"HTML.TidyAdd";a:0:{}s:14:"HTML.TidyLevel";s:6:"medium";s:15:"HTML.TidyRemove";a:0:{}s:12:"HTML.Trusted";b:0;s:10:"HTML.XHTML";b:1;s:28:"Output.CommentScriptContents";b:1;s:19:"Output.FixInnerHTML";b:1;s:18:"Output.FlashCompat";b:0;s:14:"Output.Newline";N;s:15:"Output.SortAttr";b:0;s:17:"Output.TidyFormat";b:0;s:17:"Test.ForceNoIconv";b:0;s:18:"URI.AllowedSchemes";a:7:{s:4:"http";b:1;s:5:"https";b:1;s:6:"mailto";b:1;s:3:"ftp";b:1;s:4:"nntp";b:1;s:4:"news";b:1;s:3:"tel";b:1;}s:8:"URI.Base";N;s:17:"URI.DefaultScheme";s:4:"http";s:16:"URI.DefinitionID";N;s:17:"URI.DefinitionRev";i:1;s:11:"URI.Disable";b:0;s:19:"URI.DisableExternal";b:0;s:28:"URI.DisableExternalResources";b:0;s:20:"URI.DisableResources";b:0;s:8:"URI.Host";N;s:17:"URI.HostBlacklist";a:0:{}s:16:"URI.MakeAbsolute";b:0;s:9:"URI.Munge";N;s:18:"URI.MungeResources";b:0;s:18:"URI.MungeSecretKey";N;s:26:"URI.OverrideAllowedSchemes";b:1;s:20:"URI.SafeIframeRegexp";N;}s:9:"*parent";N;s:8:"*cache";N;}s:4:"info";a:139:{s:19:"Attr.AllowedClasses";i:-8;s:24:"Attr.AllowedFrameTargets";i:8;s:15:"Attr.AllowedRel";i:8;s:15:"Attr.AllowedRev";i:8;s:18:"Attr.ClassUseCDATA";i:-7;s:20:"Attr.DefaultImageAlt";i:-1;s:24:"Attr.DefaultInvalidImage";i:1;s:27:"Attr.DefaultInvalidImageAlt";i:1;s:19:"Attr.DefaultTextDir";O:8:"stdClass":2:{s:4:"type";i:1;s:7:"allowed";a:2:{s:3:"ltr";b:1;s:3:"rtl";b:1;}}s:13:"Attr.EnableID";i:7;s:17:"HTML.EnableAttrID";O:8:"stdClass":2:{s:3:"key";s:13:"Attr.EnableID";s:7:"isAlias";b:1;}s:21:"Attr.ForbiddenClasses";i:8;s:13:"Attr.ID.HTML5";i:-7;s:16:"Attr.IDBlacklist";i:9;s:22:"Attr.IDBlacklistRegexp";i:-1;s:13:"Attr.IDPrefix";i:1;s:18:"Attr.IDPrefixLocal";i:1;s:24:"AutoFormat.AutoParagraph";i:7;s:17:"AutoFormat.Custom";i:9;s:25:"AutoFormat.DisplayLinkURI";i:7;s:18:"AutoFormat.Linkify";i:7;s:33:"AutoFormat.PurifierLinkify.DocURL";i:1;s:37:"AutoFormatParam.PurifierLinkifyDocURL";O:8:"stdClass":2:{s:3:"key";s:33:"AutoFormat.PurifierLinkify.DocURL";s:7:"isAlias";b:1;}s:26:"AutoFormat.PurifierLinkify";i:7;s:32:"AutoFormat.RemoveEmpty.Predicate";i:10;s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";i:8;s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";i:7;s:22:"AutoFormat.RemoveEmpty";i:7;s:39:"AutoFormat.RemoveSpansWithoutAttributes";i:7;s:19:"CSS.AllowDuplicates";i:7;s:18:"CSS.AllowImportant";i:7;s:15:"CSS.AllowTricky";i:7;s:16:"CSS.AllowedFonts";i:-8;s:21:"CSS.AllowedProperties";i:-8;s:17:"CSS.DefinitionRev";i:5;s:23:"CSS.ForbiddenProperties";i:8;s:16:"CSS.MaxImgLength";i:-1;s:15:"CSS.Proprietary";i:7;s:11:"CSS.Trusted";i:7;s:20:"Cache.DefinitionImpl";i:-1;s:20:"Core.DefinitionCache";O:8:"stdClass":2:{s:3:"key";s:20:"Cache.DefinitionImpl";s:7:"isAlias";b:1;}s:20:"Cache.SerializerPath";i:-1;s:27:"Cache.SerializerPermissions";i:-5;s:22:"Core.AggressivelyFixLt";i:7;s:29:"Core.AggressivelyRemoveScript";i:7;s:28:"Core.AllowHostnameUnderscore";i:7;s:23:"Core.AllowParseManyTags";i:7;s:18:"Core.CollectErrors";i:7;s:18:"Core.ColorKeywords";i:10;s:30:"Core.ConvertDocumentToFragment";i:7;s:24:"Core.AcceptFullDocuments";O:8:"stdClass":2:{s:3:"key";s:30:"Core.ConvertDocumentToFragment";s:7:"isAlias";b:1;}s:36:"Core.DirectLexLineNumberSyncInterval";i:5;s:20:"Core.DisableExcludes";i:7;s:15:"Core.EnableIDNA";i:7;s:13:"Core.Encoding";i:2;s:26:"Core.EscapeInvalidChildren";i:7;s:22:"Core.EscapeInvalidTags";i:7;s:29:"Core.EscapeNonASCIICharacters";i:7;s:19:"Core.HiddenElements";i:8;s:13:"Core.Language";i:1;s:24:"Core.LegacyEntityDecoder";i:7;s:14:"Core.LexerImpl";i:-11;s:24:"Core.MaintainLineNumbers";i:-7;s:22:"Core.NormalizeNewlines";i:7;s:21:"Core.RemoveInvalidImg";i:7;s:33:"Core.RemoveProcessingInstructions";i:7;s:25:"Core.RemoveScriptContents";i:-7;s:13:"Filter.Custom";i:9;s:34:"Filter.ExtractStyleBlocks.Escaping";i:7;s:33:"Filter.ExtractStyleBlocksEscaping";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.Escaping";s:7:"isAlias";b:1;}s:38:"FilterParam.ExtractStyleBlocksEscaping";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.Escaping";s:7:"isAlias";b:1;}s:31:"Filter.ExtractStyleBlocks.Scope";i:-1;s:30:"Filter.ExtractStyleBlocksScope";O:8:"stdClass":2:{s:3:"key";s:31:"Filter.ExtractStyleBlocks.Scope";s:7:"isAlias";b:1;}s:35:"FilterParam.ExtractStyleBlocksScope";O:8:"stdClass":2:{s:3:"key";s:31:"Filter.ExtractStyleBlocks.Scope";s:7:"isAlias";b:1;}s:34:"Filter.ExtractStyleBlocks.TidyImpl";i:-11;s:38:"FilterParam.ExtractStyleBlocksTidyImpl";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.TidyImpl";s:7:"isAlias";b:1;}s:25:"Filter.ExtractStyleBlocks";i:7;s:14:"Filter.YouTube";i:7;s:12:"HTML.Allowed";i:-4;s:22:"HTML.AllowedAttributes";i:-8;s:20:"HTML.AllowedComments";i:8;s:26:"HTML.AllowedCommentsRegexp";i:-1;s:20:"HTML.AllowedElements";i:-8;s:19:"HTML.AllowedModules";i:-8;s:23:"HTML.Attr.Name.UseCDATA";i:7;s:17:"HTML.BlockWrapper";i:1;s:16:"HTML.CoreModules";i:8;s:18:"HTML.CustomDoctype";i:-1;s:17:"HTML.DefinitionID";i:-1;s:18:"HTML.DefinitionRev";i:5;s:12:"HTML.Doctype";O:8:"stdClass":3:{s:4:"type";i:1;s:10:"allow_null";b:1;s:7:"allowed";a:5:{s:22:"HTML 4.01 Transitional";b:1;s:16:"HTML 4.01 Strict";b:1;s:22:"XHTML 1.0 Transitional";b:1;s:16:"XHTML 1.0 Strict";b:1;s:9:"XHTML 1.1";b:1;}}s:25:"HTML.FlashAllowFullScreen";i:7;s:24:"HTML.ForbiddenAttributes";i:8;s:22:"HTML.ForbiddenElements";i:8;s:17:"HTML.MaxImgLength";i:-5;s:13:"HTML.Nofollow";i:7;s:11:"HTML.Parent";i:1;s:16:"HTML.Proprietary";i:7;s:14:"HTML.SafeEmbed";i:7;s:15:"HTML.SafeIframe";i:7;s:15:"HTML.SafeObject";i:7;s:18:"HTML.SafeScripting";i:8;s:11:"HTML.Strict";i:7;s:16:"HTML.TargetBlank";i:7;s:19:"HTML.TargetNoopener";i:7;s:21:"HTML.TargetNoreferrer";i:7;s:12:"HTML.TidyAdd";i:8;s:14:"HTML.TidyLevel";O:8:"stdClass":2:{s:4:"type";i:1;s:7:"allowed";a:4:{s:4:"none";b:1;s:5:"light";b:1;s:6:"medium";b:1;s:5:"heavy";b:1;}}s:15:"HTML.TidyRemove";i:8;s:12:"HTML.Trusted";i:7;s:10:"HTML.XHTML";i:7;s:10:"Core.XHTML";O:8:"stdClass":2:{s:3:"key";s:10:"HTML.XHTML";s:7:"isAlias";b:1;}s:28:"Output.CommentScriptContents";i:7;s:26:"Core.CommentScriptContents";O:8:"stdClass":2:{s:3:"key";s:28:"Output.CommentScriptContents";s:7:"isAlias";b:1;}s:19:"Output.FixInnerHTML";i:7;s:18:"Output.FlashCompat";i:7;s:14:"Output.Newline";i:-1;s:15:"Output.SortAttr";i:7;s:17:"Output.TidyFormat";i:7;s:15:"Core.TidyFormat";O:8:"stdClass":2:{s:3:"key";s:17:"Output.TidyFormat";s:7:"isAlias";b:1;}s:17:"Test.ForceNoIconv";i:7;s:18:"URI.AllowedSchemes";i:8;s:8:"URI.Base";i:-1;s:17:"URI.DefaultScheme";i:-1;s:16:"URI.DefinitionID";i:-1;s:17:"URI.DefinitionRev";i:5;s:11:"URI.Disable";i:7;s:15:"Attr.DisableURI";O:8:"stdClass":2:{s:3:"key";s:11:"URI.Disable";s:7:"isAlias";b:1;}s:19:"URI.DisableExternal";i:7;s:28:"URI.DisableExternalResources";i:7;s:20:"URI.DisableResources";i:7;s:8:"URI.Host";i:-1;s:17:"URI.HostBlacklist";i:9;s:16:"URI.MakeAbsolute";i:7;s:9:"URI.Munge";i:-1;s:18:"URI.MungeResources";i:7;s:18:"URI.MungeSecretKey";i:-1;s:26:"URI.OverrideAllowedSchemes";i:7;s:20:"URI.SafeIframeRegexp";i:-1;}}
... ...
... ... @@ -6,7 +6,7 @@ DEFAULT: false
<p>
When enabled, HTML Purifier will treat any elements that contain only
non-breaking spaces as well as regular whitespace as empty, and remove
them when %AutoForamt.RemoveEmpty is enabled.
them when %AutoFormat.RemoveEmpty is enabled.
</p>
<p>
See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements
... ...
Core.AllowParseManyTags
TYPE: bool
DEFAULT: false
VERSION: 4.10.1
--DESCRIPTION--
<p>
This directive allows parsing of many nested tags.
If you set true, relaxes any hardcoded limit from the parser.
However, in that case it may cause a Dos attack.
Be careful when enabling it.
</p>
--# vim: et sw=4 sts=4
... ...
... ... @@ -3,23 +3,154 @@ TYPE: hash
VERSION: 2.0.0
--DEFAULT--
array (
'maroon' => '#800000',
'red' => '#FF0000',
'orange' => '#FFA500',
'yellow' => '#FFFF00',
'olive' => '#808000',
'purple' => '#800080',
'aliceblue' => '#F0F8FF',
'antiquewhite' => '#FAEBD7',
'aqua' => '#00FFFF',
'aquamarine' => '#7FFFD4',
'azure' => '#F0FFFF',
'beige' => '#F5F5DC',
'bisque' => '#FFE4C4',
'black' => '#000000',
'blanchedalmond' => '#FFEBCD',
'blue' => '#0000FF',
'blueviolet' => '#8A2BE2',
'brown' => '#A52A2A',
'burlywood' => '#DEB887',
'cadetblue' => '#5F9EA0',
'chartreuse' => '#7FFF00',
'chocolate' => '#D2691E',
'coral' => '#FF7F50',
'cornflowerblue' => '#6495ED',
'cornsilk' => '#FFF8DC',
'crimson' => '#DC143C',
'cyan' => '#00FFFF',
'darkblue' => '#00008B',
'darkcyan' => '#008B8B',
'darkgoldenrod' => '#B8860B',
'darkgray' => '#A9A9A9',
'darkgrey' => '#A9A9A9',
'darkgreen' => '#006400',
'darkkhaki' => '#BDB76B',
'darkmagenta' => '#8B008B',
'darkolivegreen' => '#556B2F',
'darkorange' => '#FF8C00',
'darkorchid' => '#9932CC',
'darkred' => '#8B0000',
'darksalmon' => '#E9967A',
'darkseagreen' => '#8FBC8F',
'darkslateblue' => '#483D8B',
'darkslategray' => '#2F4F4F',
'darkslategrey' => '#2F4F4F',
'darkturquoise' => '#00CED1',
'darkviolet' => '#9400D3',
'deeppink' => '#FF1493',
'deepskyblue' => '#00BFFF',
'dimgray' => '#696969',
'dimgrey' => '#696969',
'dodgerblue' => '#1E90FF',
'firebrick' => '#B22222',
'floralwhite' => '#FFFAF0',
'forestgreen' => '#228B22',
'fuchsia' => '#FF00FF',
'white' => '#FFFFFF',
'lime' => '#00FF00',
'gainsboro' => '#DCDCDC',
'ghostwhite' => '#F8F8FF',
'gold' => '#FFD700',
'goldenrod' => '#DAA520',
'gray' => '#808080',
'grey' => '#808080',
'green' => '#008000',
'greenyellow' => '#ADFF2F',
'honeydew' => '#F0FFF0',
'hotpink' => '#FF69B4',
'indianred' => '#CD5C5C',
'indigo' => '#4B0082',
'ivory' => '#FFFFF0',
'khaki' => '#F0E68C',
'lavender' => '#E6E6FA',
'lavenderblush' => '#FFF0F5',
'lawngreen' => '#7CFC00',
'lemonchiffon' => '#FFFACD',
'lightblue' => '#ADD8E6',
'lightcoral' => '#F08080',
'lightcyan' => '#E0FFFF',
'lightgoldenrodyellow' => '#FAFAD2',
'lightgray' => '#D3D3D3',
'lightgrey' => '#D3D3D3',
'lightgreen' => '#90EE90',
'lightpink' => '#FFB6C1',
'lightsalmon' => '#FFA07A',
'lightseagreen' => '#20B2AA',
'lightskyblue' => '#87CEFA',
'lightslategray' => '#778899',
'lightslategrey' => '#778899',
'lightsteelblue' => '#B0C4DE',
'lightyellow' => '#FFFFE0',
'lime' => '#00FF00',
'limegreen' => '#32CD32',
'linen' => '#FAF0E6',
'magenta' => '#FF00FF',
'maroon' => '#800000',
'mediumaquamarine' => '#66CDAA',
'mediumblue' => '#0000CD',
'mediumorchid' => '#BA55D3',
'mediumpurple' => '#9370DB',
'mediumseagreen' => '#3CB371',
'mediumslateblue' => '#7B68EE',
'mediumspringgreen' => '#00FA9A',
'mediumturquoise' => '#48D1CC',
'mediumvioletred' => '#C71585',
'midnightblue' => '#191970',
'mintcream' => '#F5FFFA',
'mistyrose' => '#FFE4E1',
'moccasin' => '#FFE4B5',
'navajowhite' => '#FFDEAD',
'navy' => '#000080',
'blue' => '#0000FF',
'aqua' => '#00FFFF',
'teal' => '#008080',
'black' => '#000000',
'oldlace' => '#FDF5E6',
'olive' => '#808000',
'olivedrab' => '#6B8E23',
'orange' => '#FFA500',
'orangered' => '#FF4500',
'orchid' => '#DA70D6',
'palegoldenrod' => '#EEE8AA',
'palegreen' => '#98FB98',
'paleturquoise' => '#AFEEEE',
'palevioletred' => '#DB7093',
'papayawhip' => '#FFEFD5',
'peachpuff' => '#FFDAB9',
'peru' => '#CD853F',
'pink' => '#FFC0CB',
'plum' => '#DDA0DD',
'powderblue' => '#B0E0E6',
'purple' => '#800080',
'rebeccapurple' => '#663399',
'red' => '#FF0000',
'rosybrown' => '#BC8F8F',
'royalblue' => '#4169E1',
'saddlebrown' => '#8B4513',
'salmon' => '#FA8072',
'sandybrown' => '#F4A460',
'seagreen' => '#2E8B57',
'seashell' => '#FFF5EE',
'sienna' => '#A0522D',
'silver' => '#C0C0C0',
'gray' => '#808080',
'skyblue' => '#87CEEB',
'slateblue' => '#6A5ACD',
'slategray' => '#708090',
'slategrey' => '#708090',
'snow' => '#FFFAFA',
'springgreen' => '#00FF7F',
'steelblue' => '#4682B4',
'tan' => '#D2B48C',
'teal' => '#008080',
'thistle' => '#D8BFD8',
'tomato' => '#FF6347',
'turquoise' => '#40E0D0',
'violet' => '#EE82EE',
'wheat' => '#F5DEB3',
'white' => '#FFFFFF',
'whitesmoke' => '#F5F5F5',
'yellow' => '#FFFF00',
'yellowgreen' => '#9ACD32'
)
--DESCRIPTION--
... ...
... ... @@ -118,7 +118,7 @@ class HTMLPurifier_EntityParser
$entity = $matches[0];
$hex_part = @$matches[1];
$dec_part = @$matches[2];
$named_part = empty($matches[3]) ? @$matches[4] : $matches[3];
$named_part = empty($matches[3]) ? (empty($matches[4]) ? "" : $matches[4]) : $matches[3];
if ($hex_part !== NULL && $hex_part !== "") {
return HTMLPurifier_Encoder::unichr(hexdec($hex_part));
} elseif ($dec_part !== NULL && $dec_part !== "") {
... ...
... ... @@ -23,13 +23,13 @@ class HTMLPurifier_HTMLModule_SafeScripting extends HTMLPurifier_HTMLModule
$script = $this->addElement(
'script',
'Inline',
'Empty',
'Optional:', // Not `Empty` to not allow to autoclose the <script /> tag @see https://www.w3.org/TR/html4/interact/scripts.html
null,
array(
// While technically not required by the spec, we're forcing
// it to this value.
'type' => 'Enum#text/javascript',
'src*' => new HTMLPurifier_AttrDef_Enum(array_keys($allowed))
'src*' => new HTMLPurifier_AttrDef_Enum(array_keys($allowed), /*case sensitive*/ true)
)
);
$script->attr_transform_pre[] =
... ...
... ... @@ -8,4 +8,6 @@ $messages = array(
'HTMLPurifier' => 'HTML Purifier X'
);
$errorNames = array();
// vim: et sw=4 sts=4
... ...
... ... @@ -9,4 +9,6 @@ $messages = array(
'HTMLPurifier' => 'HTML Purifier XNone'
);
$errorNames = array();
// vim: et sw=4 sts=4
... ...
... ... @@ -68,8 +68,13 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
$doc = new DOMDocument();
$doc->encoding = 'UTF-8'; // theoretically, the above has this covered
$options = 0;
if ($config->get('Core.AllowParseManyTags') && defined('LIBXML_PARSEHUGE')) {
$options |= LIBXML_PARSEHUGE;
}
set_error_handler(array($this, 'muteErrorHandler'));
$doc->loadHTML($html);
$doc->loadHTML($html, $options);
restore_error_handler();
$body = $doc->getElementsByTagName('html')->item(0)-> // <html>
... ... @@ -133,11 +138,11 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
*/
protected function getTagName($node)
{
if (property_exists($node, 'tagName')) {
if (isset($node->tagName)) {
return $node->tagName;
} else if (property_exists($node, 'nodeName')) {
} else if (isset($node->nodeName)) {
return $node->nodeName;
} else if (property_exists($node, 'localName')) {
} else if (isset($node->localName)) {
return $node->localName;
}
return null;
... ... @@ -150,11 +155,11 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
*/
protected function getData($node)
{
if (property_exists($node, 'data')) {
if (isset($node->data)) {
return $node->data;
} else if (property_exists($node, 'nodeValue')) {
} else if (isset($node->nodeValue)) {
return $node->nodeValue;
} else if (property_exists($node, 'textContent')) {
} else if (isset($node->textContent)) {
return $node->textContent;
}
return null;
... ...
... ... @@ -48,7 +48,7 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
$this->compress = $compress;
// initialize sub-printers
$this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default();
$this->fields[HTMLPurifier_VarParser::BOOL] = new HTMLPurifier_Printer_ConfigForm_bool();
$this->fields[HTMLPurifier_VarParser::C_BOOL] = new HTMLPurifier_Printer_ConfigForm_bool();
}
/**
... ... @@ -339,7 +339,7 @@ class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer
$value = '';
}
}
if ($type === HTMLPurifier_VarParser::MIXED) {
if ($type === HTMLPurifier_VarParser::C_MIXED) {
return 'Not supported';
$value = serialize($value);
}
... ...
... ... @@ -7,34 +7,34 @@
class HTMLPurifier_VarParser
{
const STRING = 1;
const C_STRING = 1;
const ISTRING = 2;
const TEXT = 3;
const ITEXT = 4;
const INT = 5;
const FLOAT = 6;
const BOOL = 7;
const C_INT = 5;
const C_FLOAT = 6;
const C_BOOL = 7;
const LOOKUP = 8;
const ALIST = 9;
const HASH = 10;
const MIXED = 11;
const C_MIXED = 11;
/**
* Lookup table of allowed types. Mainly for backwards compatibility, but
* also convenient for transforming string type names to the integer constants.
*/
public static $types = array(
'string' => self::STRING,
'string' => self::C_STRING,
'istring' => self::ISTRING,
'text' => self::TEXT,
'itext' => self::ITEXT,
'int' => self::INT,
'float' => self::FLOAT,
'bool' => self::BOOL,
'int' => self::C_INT,
'float' => self::C_FLOAT,
'bool' => self::C_BOOL,
'lookup' => self::LOOKUP,
'list' => self::ALIST,
'hash' => self::HASH,
'mixed' => self::MIXED
'mixed' => self::C_MIXED
);
/**
... ... @@ -42,7 +42,7 @@ class HTMLPurifier_VarParser
* allowed value lists.
*/
public static $stringTypes = array(
self::STRING => true,
self::C_STRING => true,
self::ISTRING => true,
self::TEXT => true,
self::ITEXT => true,
... ... @@ -74,7 +74,7 @@ class HTMLPurifier_VarParser
// These are basic checks, to make sure nothing horribly wrong
// happened in our implementations.
switch ($type) {
case (self::STRING):
case (self::C_STRING):
case (self::ISTRING):
case (self::TEXT):
case (self::ITEXT):
... ... @@ -85,17 +85,17 @@ class HTMLPurifier_VarParser
$var = strtolower($var);
}
return $var;
case (self::INT):
case (self::C_INT):
if (!is_int($var)) {
break;
}
return $var;
case (self::FLOAT):
case (self::C_FLOAT):
if (!is_float($var)) {
break;
}
return $var;
case (self::BOOL):
case (self::C_BOOL):
if (!is_bool($var)) {
break;
}
... ... @@ -119,7 +119,7 @@ class HTMLPurifier_VarParser
}
}
return $var;
case (self::MIXED):
case (self::C_MIXED):
return $var;
default:
$this->errorInconsistent(get_class($this), $type);
... ...
... ... @@ -23,23 +23,23 @@ class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser
// Note: if code "breaks" from the switch, it triggers a generic
// exception to be thrown. Specific errors can be specifically
// done here.
case self::MIXED:
case self::C_MIXED:
case self::ISTRING:
case self::STRING:
case self::C_STRING:
case self::TEXT:
case self::ITEXT:
return $var;
case self::INT:
case self::C_INT:
if (is_string($var) && ctype_digit($var)) {
$var = (int)$var;
}
return $var;
case self::FLOAT:
case self::C_FLOAT:
if ((is_string($var) && is_numeric($var)) || is_int($var)) {
$var = (float)$var;
}
return $var;
case self::BOOL:
case self::C_BOOL:
if (is_int($var) && ($var === 0 || $var === 1)) {
$var = (bool)$var;
} elseif (is_string($var)) {
... ...
Deny from all
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Deny from all
</>
... ...
#!/usr/bin/php
<?php
chdir(dirname(__FILE__));
require_once 'common.php';
assertCli();
/**
* @file
* Runs all generation/flush cache scripts to ensure that somewhat volatile
* generated files are up-to-date.
*/
function e($cmd)
{
echo "\$ $cmd\n";
passthru($cmd, $status);
echo "\n";
if ($status) exit($status);
}
$php = empty($_SERVER['argv'][1]) ? 'php' : $_SERVER['argv'][1];
e($php . ' generate-includes.php');
e($php . ' generate-schema-cache.php');
e($php . ' flush-definition-cache.php');
e($php . ' generate-standalone.php');
e($php . ' config-scanner.php');
// vim: et sw=4 sts=4
#!/bin/bash
set -ex
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
php "$DIR/generate-includes.php"
php "$DIR/generate-schema-cache.php"
php "$DIR/flush-definition-cache.php"
php "$DIR/generate-standalone.php"
php "$DIR/config-scanner.php"
... ...
#!/usr/bin/php
<?php
chdir(dirname(__FILE__));
require_once 'common.php';
assertCli();
/**
* @file
* Converts all instances of $config->set and $config->get to the new
* format, as described by docs/dev-config-bcbreaks.txt
*/
$FS = new FSTools();
chdir(dirname(__FILE__) . '/..');
$raw_files = $FS->globr('.', '*.php');
foreach ($raw_files as $file) {
$file = substr($file, 2); // rm leading './'
if (strpos($file, 'library/standalone/') === 0) continue;
if (strpos($file, 'maintenance/update-config.php') === 0) continue;
if (strpos($file, 'test-settings.php') === 0) continue;
if (substr_count($file, '.') > 1) continue; // rm meta files
// process the file
$contents = file_get_contents($file);
$contents = preg_replace(
"#config->(set|get)\('(.+?)', '(.+?)'#",
"config->\\1('\\2.\\3'",
$contents
);
if ($contents === '') continue;
file_put_contents($file, $contents);
}
// vim: et sw=4 sts=4
... ... @@ -53,5 +53,6 @@ $config->set('Core.Encoding', $GLOBALS['PHORUM']['DATA']['CHARSET']); // we'll c
if (strtolower($GLOBALS['PHORUM']['DATA']['CHARSET']) !== 'utf-8') {
$config->set('Core.EscapeNonASCIICharacters', true);
}
$config->set('Core.AllowParseManyTags', false);
// vim: et sw=4 sts=4
... ...
<?php
// Tags releases
if (php_sapi_name() != 'cli') {
echo 'Release script cannot be called from web-browser.';
exit;
}
require 'svn.php';
$svn_info = my_svn_info('.');
$version = trim(file_get_contents('VERSION'));
$trunk_url = $svn_info['Repository Root'] . '/htmlpurifier/trunk';
$trunk_tag_url = $svn_info['Repository Root'] . '/htmlpurifier/tags/' . $version;
echo "Tagging trunk to tags/$version...";
passthru("svn copy --message \"Tag $version release.\" $trunk_url $trunk_tag_url");
// vim: et sw=4 sts=4
... ... @@ -102,7 +102,7 @@ if (!$c) {
}
file_put_contents('library/HTMLPurifier/Config.php', $config_c);
passthru('php maintenance/flush.php');
passthru('maintenance/flush.sh');
if ($is_dev) echo "Review changes, write something in WHATSNEW and FOCUS, and then commit with log 'Release $version.'" . PHP_EOL;
else echo "Numbers updated to dev, no other modifications necessary!";
... ...
... ... @@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org).
## [Unreleased]
## [1.8.2] - 2019-07-08
### Fixed
- Uncaught error when opening ods file and properties aren't defined - [Issue #1047](https://github.com/PHPOffice/PhpSpreadsheet/issues/1047)
- Xlsx Reader Cell datavalidations bug - [PR #1052](https://github.com/PHPOffice/PhpSpreadsheet/pull/1052)
## [1.8.1] - 2019-07-02
### Fixed
... ...
... ... @@ -58,21 +58,6 @@ abstract class BaseReader implements IReader
public function __construct()
{
$this->readFilter = new DefaultReadFilter();
// A fatal error will bypass the destructor, so we register a shutdown here
register_shutdown_function([$this, '__destruct']);
}
private function shutdown()
{
if ($this->securityScanner !== null) {
$this->securityScanner = null;
}
}
public function __destruct()
{
$this->shutdown();
}
public function getReadDataOnly()
... ... @@ -146,7 +131,7 @@ abstract class BaseReader implements IReader
return $this;
}
public function getSecuritySCanner()
public function getSecurityScanner()
{
if (property_exists($this, 'securityScanner')) {
return $this->securityScanner;
... ...
... ... @@ -20,13 +20,13 @@ class Properties
$officeProperty = $xml->children($namespacesMeta['office']);
foreach ($officeProperty as $officePropertyData) {
/** @var \SimpleXMLElement $officePropertyData */
$officePropertiesDC = [];
$officePropertiesDC = (object) [];
if (isset($namespacesMeta['dc'])) {
$officePropertiesDC = $officePropertyData->children($namespacesMeta['dc']);
}
$this->setCoreProperties($docProps, $officePropertiesDC);
$officePropertyMeta = [];
$officePropertyMeta = (object) [];
if (isset($namespacesMeta['dc'])) {
$officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']);
}
... ...
... ... @@ -25,7 +25,7 @@ class XmlScanner
$this->disableEntityLoaderCheck();
// A fatal error will bypass the destructor, so we register a shutdown here
register_shutdown_function([$this, '__destruct']);
register_shutdown_function([__CLASS__, 'shutdown']);
}
public static function getInstance(Reader\IReader $reader)
... ... @@ -72,16 +72,17 @@ class XmlScanner
}
}
private function shutdown()
public static function shutdown()
{
if (self::$libxmlDisableEntityLoaderValue !== null) {
libxml_disable_entity_loader(self::$libxmlDisableEntityLoaderValue);
self::$libxmlDisableEntityLoaderValue = null;
}
}
public function __destruct()
{
$this->shutdown();
self::shutdown();
}
public function setAdditionalCallback(callable $callback)
... ... @@ -93,13 +94,13 @@ class XmlScanner
{
$pattern = '/encoding="(.*?)"/';
$result = preg_match($pattern, $xml, $matches);
$charset = $result ? $matches[1] : 'UTF-8';
$charset = strtoupper($result ? $matches[1] : 'UTF-8');
if ($charset !== 'UTF-8') {
$xml = mb_convert_encoding($xml, 'UTF-8', $charset);
$result = preg_match($pattern, $xml, $matches);
$charset = $result ? $matches[1] : 'UTF-8';
$charset = strtoupper($result ? $matches[1] : 'UTF-8');
if ($charset !== 'UTF-8') {
throw new Reader\Exception('Suspicious Double-encoded XML, spreadsheet file load() aborted to prevent XXE/XEE attacks');
}
... ...
... ... @@ -19,7 +19,7 @@ class DataValidations
public function load()
{
foreach ($this->worksheetXml->dataValidation as $dataValidation) {
foreach ($this->worksheetXml->dataValidations->dataValidation as $dataValidation) {
// Uppercase coordinate
$range = strtoupper($dataValidation['sqref']);
$rangeSet = explode(' ', $range);
... ...
*.phar
*.zip
build/artifacts
phpunit.xml
phpunit.functional.xml
.DS_Store
.swp
.build
composer.lock
vendor
src/package.xml
.idea/
... ...
filter:
excluded_paths: [tests/*]
checks:
php:
code_rating: true
remove_extra_empty_lines: true
remove_php_closing_tag: true
remove_trailing_whitespace: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
fix_php_opening_tag: true
fix_linefeed: true
fix_line_ending: true
fix_identation_4spaces: true
fix_doc_comments: true
tools:
external_code_coverage:
timeout: 1200
runs: 3
php_analyzer: true
php_code_coverage: false
php_code_sniffer:
config:
standard: PSR2
filter:
paths: ['src']
php_loc:
enabled: true
excluded_dirs: [vendor, tests]
php_cpd:
enabled: true
excluded_dirs: [vendor, tests]
... ...
sudo: false
language: php
php:
- 5.4
- 5.5
- 5.6
- 7.0
before_script:
- export QINIU_TEST_ENV="travis"
- travis_retry composer self-update
- travis_retry composer install --no-interaction --prefer-source --dev
script:
- ./vendor/bin/phpcs --standard=PSR2 src
- ./vendor/bin/phpcs --standard=PSR2 examples
- ./vendor/bin/phpcs --standard=PSR2 tests
- ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover tests/Qiniu/Tests/
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
env:
global:
- secure: "V9BsntXQZwvO9EOD6itzaae2uq+GemzyTUTxMTJx1/jFoUNpCU2O2UAgjA2XSEr5sgci0KWDV4Krbzv3EBB4uplOFLMI3w32256UHbT9E0x3YjhfPJZk68MH1iS1be7X81LDHON7yveavK8987s3qzjeUcbfLSPgccT+cvf7+dc="
- QINIU_ACCESS_KEY=vHg2e7nOh7Jsucv2Azr5FH6omPgX22zoJRWa0FN5
\ No newline at end of file
... ...
# Changelog
## 7.2.7 (2018-11-06)
* 添加 QVM 内网上传到 KODO 的 zone 设置
## 7.2.6 (2018-05-18)
* 修复rs,rsf在不同机房默认的https域名
## 7.2.5 (2018-05-10)
* 修复表单上传中多余的参数checkCrc导致的fname错位问题
## 7.2.4 (2018-05-09)
### 增加
* 连麦功能
## 7.2.3 (2018-01-20)
### 增加
* 新加坡机房
### 修正
* 获取域名的入口域名
* http回复头部兼容大小写
## 7.2.2 (2017-11-06)
### 增加
* Qiniu算法的鉴权方法
## 7.1.4 (2017-06-21)
### 增加
* cdn 文件/目录 刷新
* cdn 获取 流量/带宽
* cdn 获取域名的访问日志列表
* cdn 对资源链接进行时间戳防盗链签名
## 7.1.3 (2016-11-18)
### 增加
* move, copy操作增加force参数
## 7.1.2 (2016-11-12)
### 修正
* 明确抛出获取各区域域名失败时的报错
## 7.1.1 (2016-11-02)
### 修正
* 多区域配置文件存储目录从home修改到tmp目录
## 7.1.0 (2016-10-22)
### 增加
* 多存储区域的支持
## 7.0.8 (2016-07-19)
### 增加
* demo
* https url 支持
* deleteAfterDays 策略
* 添加图片处理链接统一拼接方法 by @SherlockRen
## 7.0.7 (2016-01-12)
### 修正
* PersistentFop参数pipeline和notify_url失效
* resume 模式 close file inputstream
## 7.0.6 (2015-12-05)
### 修正
* php7.0 Json 对空字符串解析单元测试报错
* 开启安全模式或者设置可操作目录树时,设置CURLOPT_FOLLOWLOCATION报错, by @twocabbages
* fetch 支持不指定key, by @sinkcup
## 7.0.5 (2015-10-29)
### 增加
* 增加上传策略最小文件大小限制 fsizeMin
* 增加常见examples
## 7.0.4 (2015-07-23)
### 修正
* 一些地方的严格比较检查
* resumeupload 备用地址失效
## 7.0.3 (2015-07-10)
### 修改
* 多zone 支持
## 7.0.2 (2015-04-18)
### 修改
* fetch 接口返回内容调整
* pfop 接口调整
###修正
* exception 类调用
## 7.0.1 (2015-03-27)
### 增加
* 增加代码注释
## 7.0.0 (2015-02-03)
### 增加
* 简化上传接口
* 自动选择断点续上传还是直传
* 重构代码,接口和内部结构更清晰
* 改变mime
* 代码覆盖度报告
* policy改为array, 便于灵活增加,并加入过期字段检查
* 文件列表支持目录形式
* 利用元编程方式支持 fop 和 pfop
... ...
# 贡献代码指南
我们非常欢迎大家来贡献代码,我们会向贡献者致以最诚挚的敬意。
一般可以通过在Github上提交[Pull Request](https://github.com/qiniu/php-sdk)来贡献代码。
## Pull Request要求
- **[PSR-2 编码风格标准](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** 。要通过项目中的code sniffer检查。
- **代码格式** 提交前 请按 ./vendor/bin/phpcbf --standard=PSR2 进行格式化。
- **必须添加测试!** - 如果没有测试(单元测试、集成测试都可以),那么提交的补丁是不会通过的。
- **记得更新文档** - 保证`README.md`以及其他相关文档及时更新,和代码的变更保持一致性。
- **考虑我们的发布周期** - 我们的版本号会服从[SemVer v2.0.0](http://semver.org/),我们绝对不会随意变更对外的API。
- **创建feature分支** - 最好不要从你的master分支提交 pull request。
- **一个feature提交一个pull请求** - 如果你的代码变更了多个操作,那就提交多个pull请求吧。
- **清晰的commit历史** - 保证你的pull请求的每次commit操作都是有意义的。如果你开发中需要执行多次的即时commit操作,那么请把它们放到一起再提交pull请求。
## 运行测试
``` bash
./vendor/bin/phpunit tests/Qiniu/Tests/
```
... ...
The MIT License (MIT)
Copyright (c) 2014 Qiniu, Ltd.<sdk@qiniu.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
... ...
# Qiniu Cloud SDK for PHP
[![doxygen.io](http://doxygen.io/github.com/qiniu/php-sdk/?status.svg)](http://doxygen.io/github.com/qiniu/php-sdk/)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
[![Build Status](https://travis-ci.org/qiniu/php-sdk.svg)](https://travis-ci.org/qiniu/php-sdk)
[![Latest Stable Version](https://img.shields.io/packagist/v/qiniu/php-sdk.svg)](https://packagist.org/packages/qiniu/php-sdk)
[![Total Downloads](https://img.shields.io/packagist/dt/qiniu/php-sdk.svg)](https://packagist.org/packages/qiniu/php-sdk)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/qiniu/php-sdk/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/qiniu/php-sdk/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/qiniu/php-sdk/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/qiniu/php-sdk/?branch=master)
[![Join Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/qiniu/php-sdk?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![@qiniu on weibo](http://img.shields.io/badge/weibo-%40qiniutek-blue.svg)](http://weibo.com/qiniutek)
## 安装
* 通过composer,这是推荐的方式,可以使用composer.json 声明依赖,或者运行下面的命令。SDK 包已经放到这里 [`qiniu/php-sdk`][install-packagist]
```bash
$ composer require qiniu/php-sdk
```
* 直接下载安装,SDK 没有依赖其他第三方库,但需要参照 composer的autoloader,增加一个自己的autoloader程序。
## 运行环境
| Qiniu SDK版本 | PHP 版本 |
|:--------------------:|:---------------------------:|
| 7.x | cURL extension, 5.3 - 5.6,7.0 |
| 6.x | cURL extension, 5.2 - 5.6 |
## 使用方法
### 上传
```php
use Qiniu\Storage\UploadManager;
use Qiniu\Auth;
...
$upManager = new UploadManager();
$auth = new Auth($accessKey, $secretKey);
$token = $auth->uploadToken($bucketName);
list($ret, $error) = $upManager->put($token, 'formput', 'hello world');
...
```
## 测试
``` bash
$ ./vendor/bin/phpunit tests/Qiniu/Tests/
```
## 常见问题
- $error保留了请求响应的信息,失败情况下ret 为none, 将$error可以打印出来,提交给我们。
- API 的使用 demo 可以参考 [单元测试](https://github.com/qiniu/php-sdk/blob/master/tests)
## 代码贡献
详情参考[代码提交指南](https://github.com/qiniu/php-sdk/blob/master/CONTRIBUTING.md)
## 贡献记录
- [所有贡献者](https://github.com/qiniu/php-sdk/contributors)
## 联系我们
- 如果需要帮助,请提交工单(在portal右侧点击咨询和建议提交工单,或者直接向 support@qiniu.com 发送邮件)
- 如果有什么问题,可以到问答社区提问,[问答社区](http://qiniu.segmentfault.com/)
- 更详细的文档,见[官方文档站](http://developer.qiniu.com/)
- 如果发现了bug, 欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues)
- 如果有功能需求,欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues)
- 如果要提交代码,欢迎提交 pull request
- 欢迎关注我们的[微信](http://www.qiniu.com/#weixin) [微博](http://weibo.com/qiniutek),及时获取动态信息。
## 代码许可
The MIT License (MIT).详情见 [License文件](https://github.com/qiniu/php-sdk/blob/master/LICENSE).
[packagist]: http://packagist.org
[install-packagist]: https://packagist.org/packages/qiniu/php-sdk
... ...
<?php
function classLoader($class)
{
$path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
$file = __DIR__ . '/src/' . $path . '.php';
if (file_exists($file)) {
require_once $file;
}
}
spl_autoload_register('classLoader');
require_once __DIR__ . '/src/Qiniu/functions.php';
... ...
{
"name": "qiniu/php-sdk",
"type": "library",
"description": "Qiniu Resource (Cloud) Storage SDK for PHP",
"keywords": ["qiniu", "storage", "sdk", "cloud"],
"homepage": "http://developer.qiniu.com/",
"license": "MIT",
"authors": [
{
"name": "Qiniu",
"email": "sdk@qiniu.com",
"homepage": "http://www.qiniu.com"
}
],
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.3"
},
"autoload": {
"psr-4": {"Qiniu\\": "src/Qiniu"},
"files": ["src/Qiniu/functions.php"]
}
}
... ...
# Rtc Streaming Cloud Server-Side Library For PHP
## Features
- Appclient
- [x] 创建房间: client->createApp()
- [x] 查看房间: client->getApp()
- [x] 删除房间: client->deleteApp()
- [x] 生成房间token: client->appToken()
## Contents
- [Installation](#installation)
- [Usage](#usage)
- [Configuration](#configuration)
- [App](#app)
- [Create a app](#create-a-app)
- [Get a app](#get-a-app)
- [Delete a app](#delete-a-app)
- [Generate a app token](#generate-a-app-token)
## Usage
### App
#### Create a app
```php
$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
$sk = "xxxx";
$auth = new Auth($ak, $sk);
$client = new Qiniu\Rtc\AppClient($auth);
$resp=$client->createApp("901","testApp");
print_r($resp);
```
#### Get an app
```php
$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
$sk = "xxxx";
$auth = new Auth($ak, $sk);
$client = new Qiniu\Rtc\AppClient($auth);
$resp=$client->getApp("deq02uhb6");
print_r($resp);
```
#### Delete an app
```php
$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
$sk = "xxxx";
$auth = new Auth($ak, $sk);
$client = new Qiniu\Rtc\AppClient($auth);
$resp=$client->deleteApp("deq02uhb6");
print_r($resp);
```
#### Generate an app token
```php
$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
$sk = "xxxx";
$auth = new Auth($ak, $sk);
$client = new Qiniu\Rtc\AppClient($auth);
$resp=$client->appToken("deq02uhb6", "lfx", '1111', (time()+3600), 'user');
print_r($resp);
```
\ No newline at end of file
... ...
<?php
require_once("../../autoload.php");
use \Qiniu\Auth;
$ak = 'gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5';
$sk = 'xxxx';
$auth = new Auth($ak, $sk);
$client = new Qiniu\Rtc\AppClient($auth);
$hub = 'lfxlive';
$title = 'lfxl';
try {
//创建app
$resp = $client->createApp($hub, $title, $maxUsers);
print_r($resp);
// 获取app状态
$resp = $client->getApp('dgdl5ge8y');
print_r($resp);
//修改app状态
$mergePublishRtmp = null;
$mergePublishRtmp['enable'] = true;
$resp = $client->updateApp('dgdl5ge8y', $hub, $title, $maxUsers, $mergePublishRtmp);
print_r($resp);
//删除app
$resp = $client->deleteApp('dgdl5ge8y');
print_r($resp);
//获取房间连麦的成员
$resp=$client->listUser("dgbfvvzid", 'lfxl');
print_r($resp);
//剔除房间的连麦成员
$resp=$client->kickUser("dgbfvvzid", 'lfx', "qiniu-f6e07b78-4dc8-45fb-a701-a9e158abb8e6");
print_r($resp);
// 列举房间
$resp=$client->listActiveRooms("dgbfvvzid", 'lfx', null, null);
print_r($resp);
//鉴权的有效时间: 1个小时.
$resp = $client->appToken("dgd4vecde", "lfxl", '1111', (time()+3600), 'user');
print_r($resp);
} catch (\Exception $e) {
echo "Error:", $e, "\n";
}
... ...
<?php
require_once("../../autoload.php");
use \Qiniu\Auth;
$ak="xxxx";
$sk="xxxx";
$auth = new Auth($ak, $sk);
$client = new Qiniu\Sms\Sms($auth);
//发送信息模块
$template_id="1131792074274775040";
$mobiles=array("18011111111","18011111111");
$code = array('code' => 'code' );
try {
//发送短信
$resp = $client->sendMessage($template_id, $mobiles, $code);
print_r($resp);
} catch (\Exception $e) {
echo "Error:", $e, "\n";
}exit;
//模板模块
$name="tstest001";
$template="tesy001 ${code}";
$type="notification";
$description="tstest001";
$signature_id="1131464448834277376";
$id="1131810682442883072";
try {
//创建模板
$resp = $client->createTemplate($name, $template, $type, $description, $signature_id);
print_r($resp);
//查询模板
$resp = $client->queryTemplate();
print_r($resp);
//修改模板
$resp = $client->updateTemplate($id, $name, $template, $description, $signature_id);
print_r($resp);
//删除模板
$resp = $client->deleteTemplate($id);
print_r($resp);
} catch (\Exception $e) {
echo "Error:", $e, "\n";
}
//签名模块
$signature = 'lfxlive2';
$source = 'enterprises_and_institutions';
$pic="/Users/Desktop/sss.jpg";
$audit_status="passed";
$page=1;
$page_size=1;
$id="1131464448834277376";
try {
//创建签名
$resp = $client->createSignature($signature, $source, $pic);
print_r($resp);
//查询签名
$resp = $client->checkSignature($audit_status);
//修改签名
$resp = $client->updateSignature($id, $signature, $source, $pic);
print_r($resp);
//删除ID
$resp = $client->deleteSignature($id);
print_r($resp);
} catch (\Exception $e) {
echo "Error:", $e, "\n";
}
... ...
# examples
这些 examples 旨在帮助你快速了解使用七牛的sdk。这些demo都是可以直接运行的, 但是在运行之前需要填上您自己的参数。
比如:
* `$bucket` 需要填上您想操作的 [bucket名字](http://developer.qiniu.com/docs/v6/api/overview/concepts.html#bucket)
* `$accessKey` 和 `$secretKey` 可以在我们的[管理后台](https://portal.qiniu.com/setting/key)找到。
* 在进行`视频转码`, `压缩文件`等异步操作时 需要使用到的队列名称也可以在我们[管理后台](https://portal.qiniu.com/mps/pipeline)新建。
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$name = 'demo';
$prefix = 'test';
$delete_after_days = 80;
$to_line_after_days =70;
list($Info, $err) = $bucketManager->bucketLifecycleRule(
$bucket,
$name,
$prefix,
$delete_after_days,
$to_line_after_days
);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Cdn\CdnManager;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Qiniu\Auth($accessKey, $secretKey);
$cdnManager = new CdnManager($auth);
//获取流量和带宽数据
//参考文档:http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html
$domains = array(
"javasdk.qiniudn.com",
"phpsdk.qiniudn.com"
);
$startDate = "2017-08-20";
$endDate = "2017-08-21";
//5min or hour or day
$granularity = "day";
//获取带宽数据
list($bandwidthData, $getBandwidthErr) = $cdnManager->getBandwidthData(
$domains,
$startDate,
$endDate,
$granularity
);
if ($getBandwidthErr != null) {
var_dump($getBandwidthErr);
} else {
echo "get bandwidth data success\n";
print_r($bandwidthData);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Cdn\CdnManager;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Qiniu\Auth($accessKey, $secretKey);
$cdnManager = new CdnManager($auth);
//获取流量和带宽数据
//参考文档:http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html
$domains = array(
"javasdk.qiniudn.com",
"phpsdk.qiniudn.com"
);
$startDate = "2017-08-20";
$endDate = "2017-08-21";
//5min or hour or day
$granularity = "day";
//获取流量数据
list($fluxData, $getFluxErr) = $cdnManager->getFluxData($domains, $startDate, $endDate, $granularity);
if ($getFluxErr != null) {
var_dump($getFluxErr);
} else {
echo "get flux data success\n";
print_r($fluxData);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Cdn\CdnManager;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Qiniu\Auth($accessKey, $secretKey);
$cdnManager = new CdnManager($auth);
$domains = array(
"javasdk.qiniudn.com",
"phpsdk.qiniudn.com"
);
$logDate = '2017-08-20';
//获取日志下载链接
//参考文档:http://developer.qiniu.com/article/fusion/api/log.html
list($logListData, $getLogErr) = $cdnManager->getCdnLogList($domains, $logDate);
if ($getLogErr != null) {
var_dump($getLogErr);
} else {
echo "get cdn log list success\n";
print_r($logListData);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Cdn\CdnManager;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Qiniu\Auth($accessKey, $secretKey);
//待刷新的文件列表和目录,文件列表最多一次100个,目录最多一次10个
//参考文档:http://developer.qiniu.com/article/fusion/api/refresh.html
$urls = array(
"http://phpsdk.qiniudn.com/qiniu.jpg",
"http://phpsdk.qiniudn.com/qiniu2.jpg",
);
//刷新目录需要联系七牛技术支持开通账户权限
$dirs = array(
"http://phpsdk.qiniudn.com/test/"
);
$cdnManager = new CdnManager($auth);
// 目前客户默认没有目录刷新权限,刷新会有400038报错,参考:https://developer.qiniu.com/fusion/api/1229/cache-refresh
// 需要刷新目录请工单联系技术支持 https://support.qiniu.com/tickets/category
list($refreshResult, $refreshErr) = $cdnManager->refreshUrlsAndDirs($urls, $dirs);
if ($refreshErr != null) {
var_dump($refreshErr);
} else {
echo "refresh request sent\n";
print_r($refreshResult);
}
//如果只有刷新链接或者目录的需求,可以分布使用
list($refreshResult, $refreshErr) = $cdnManager->refreshUrls($urls);
if ($refreshErr != null) {
var_dump($refreshErr);
} else {
echo "refresh request sent\n";
print_r($refreshResult);
}
list($refreshResult, $refreshErr) = $cdnManager->refreshDirs($dirs);
if ($refreshErr != null) {
var_dump($refreshErr);
} else {
echo "refresh request sent\n";
print_r($refreshResult);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Cdn\CdnManager;
//创建时间戳防盗链
//时间戳防盗链密钥,后台获取
$encryptKey = 'your_domain_timestamp_antileech_encryptkey';
//带访问协议的域名
$url1 = 'http://phpsdk.qiniuts.com/24.jpg?avinfo';
$url2 = 'http://phpsdk.qiniuts.com/24.jpg';
//有效期时间(单位秒)
$durationInSeconds = 3600;
$signedUrl = CdnManager::createTimestampAntiLeechUrl($url1, $encryptKey, $durationInSeconds);
print($signedUrl);
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$name = 'xxxx';
list($Info, $err) = $bucketManager->deleteBucket($name);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$name = 'demo';
list($Info, $err) = $bucketManager->deleteBucketEvent($bucket, $name);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$name = 'demo';
list($Info, $err) = $bucketManager->deleteBucketLifecycleRule($bucket, $name);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
list($Info, $err) = $bucketManager->getBucketEvents($bucket);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
list($Info, $err) = $bucketManager->getBucketLifecycleRules($bucket);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$region = 'z1';
list($Info, $err) = $bucketManager->listbuckets($region);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
list($Info, $err) = $bucketManager->getBucketQuota($bucket);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
list($Info, $err) = $bucketManager->bucketInfo($bucket);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$region = 'z1';
list($Info, $err) = $bucketManager->bucketInfos($region);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
list($Info, $err) = $bucketManager->getCorsRules($bucket);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
// 引入图片处理类
use Qiniu\Processing\ImageUrlBuilder;
$imageUrlBuilder = new ImageUrlBuilder();
// 要处理图片
$url = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg';
$url2 = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg?watermark/1/gravity/SouthEast/dx/0/dy/0/image/'
. 'aHR0cDovL2Fkcy1jZG4uY2h1Y2h1amllLmNvbS9Ga1R6bnpIY2RLdmRBUFc5cHZZZ3pTc21UY0tB';
$waterImage = 'http://developer.qiniu.com/resource/logo-2.jpg';
/**
* 缩略图链接拼接
*
* @param string $url 图片链接
* @param int $mode 缩略模式
* @param int $width 宽度
* @param int $height 长度
* @param string $format 输出类型 [可选]
* @param int $quality 图片质量 [可选]
* @param int $interlace 是否支持渐进显示 [可选]
* @param int $ignoreError 忽略结果 [可选]
* @return string
* @link http://developer.qiniu.com/code/v6/api/kodo-api/image/imageview2.html
* @author Sherlock Ren <sherlock_ren@icloud.com>
*/
$thumbLink = $imageUrlBuilder->thumbnail($url, 1, 100, 100);
// 函数方式调用 也可拼接多个操作参数 图片+水印
$thumbLink2 = \Qiniu\thumbnail($url2, 1, 100, 100);
var_dump($thumbLink, $thumbLink2);
/**
* 图片水印
*
* @param string $url 图片链接
* @param string $image 水印图片链接
* @param numeric $dissolve 透明度 [可选]
* @param string $gravity 水印位置 [可选]
* @param numeric $dx 横轴边距 [可选]
* @param numeric $dy 纵轴边距 [可选]
* @param numeric $watermarkScale 自适应原图的短边比例 [可选]
* @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html
* @return string
* @author Sherlock Ren <sherlock_ren@icloud.com>
*/
$waterLink = $imageUrlBuilder->waterImg($url, $waterImage);
// 函数调用方法
//$waterLink = \Qiniu\waterImg($url, $waterImage);
var_dump($waterLink);
/**
* 文字水印
*
* @param string $url 图片链接
* @param string $text 文字
* @param string $font 文字字体
* @param string $fontSize 文字字号
* @param string $fontColor 文字颜色 [可选]
* @param numeric $dissolve 透明度 [可选]
* @param string $gravity 水印位置 [可选]
* @param numeric $dx 横轴边距 [可选]
* @param numeric $dy 纵轴边距 [可选]
* @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html#text-watermark
* @return string
* @author Sherlock Ren <sherlock_ren@icloud.com>
*/
$textLink = $imageUrlBuilder->waterText($url, '你瞅啥', '微软雅黑', 300);
// 函数调用方法
// $textLink = \Qiniu\waterText($url, '你瞅啥', '微软雅黑', 300);
var_dump($textLink);
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
$accessKey = 'Access_Key';
$secretKey = 'Secret_Key';
$auth = new Auth($accessKey, $secretKey);
// 要转码的文件所在的空间。
$bucket = 'Bucket_Name';
// 转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline
$pipeline = 'pipeline_name';
// 初始化
$pfop = new PersistentFop($auth, $bucket, $pipeline);
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Processing\PersistentFop;
$pfop = new Qiniu\Processing\PersistentFop(null, null);
// 触发持久化处理后返回的 Id
$persistentId = 'z1.5b8a48e5856db843bc24cfc3';
// 通过persistentId查询该 触发持久化处理的状态
list($ret, $err) = $pfop->status($persistentId);
if ($err) {
print_r($err);
} else {
print_r($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
// 去我们的portal 后台来获取AK, SK
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$key = 'qiniu.png';
$auth = new Auth($accessKey, $secretKey);
// 异步任务的队列, 去后台新建: https://portal.qiniu.com/mps/pipeline
$pipeline = 'sdktest';
$pfop = new PersistentFop($auth, null);
// 进行zip压缩的url
$url1 = 'http://phpsdk.qiniudn.com/php-logo.png';
$url2 = 'http://phpsdk.qiniudn.com/1.png';
//压缩后的key
$zipKey = 'test.zip';
$fops = 'mkzip/2/url/' . \Qiniu\base64_urlSafeEncode($url1);
$fops .= '/url/' . \Qiniu\base64_urlSafeEncode($url2);
$fops .= '|saveas/' . \Qiniu\base64_urlSafeEncode("$bucket:$zipKey");
$notify_url = null;
$force = false;
list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notify_url, $force);
echo "\n====> pfop mkzip result: \n";
if ($err != null) {
var_dump($err);
} else {
echo "PersistentFop Id: $id\n";
$res = "http://api.qiniu.com/status/get/prefop?id=$id";
echo "Processing result: $res";
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
//对已经上传到七牛的视频发起异步转码操作
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
//要转码的文件所在的空间和文件名。
$key = 'qiniu.mp4';
//转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline
$pipeline = 'sdktest';
//转码完成后通知到你的业务服务器。
$notifyUrl = 'http://375dec79.ngrok.com/notify.php';
$force = false;
$config = new \Qiniu\Config();
$config->useHTTPS = true;
$pfop = new PersistentFop($auth, $config);
//要进行视频截图操作
$fops = "vframe/jpg/offset/1/w/480/h/360/rotate/90|saveas/" .
\Qiniu\base64_urlSafeEncode($bucket . ":qiniu_480x360.jpg");
list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force);
echo "\n====> pfop avthumb result: \n";
if ($err != null) {
var_dump($err);
} else {
echo "PersistentFop Id: $id\n";
}
//查询转码的进度和状态
list($ret, $err) = $pfop->status($id);
echo "\n====> pfop avthumb status: \n";
if ($err != null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
//对已经上传到七牛的视频发起异步转码操作
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
//要转码的文件所在的空间和文件名。
$key = 'qiniu.mp4';
//转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline
$pipeline = 'sdktest';
$force = false;
//转码完成后通知到你的业务服务器。
$notifyUrl = 'http://375dec79.ngrok.com/notify.php';
$config = new \Qiniu\Config();
//$config->useHTTPS=true;
$pfop = new PersistentFop($auth, $config);
//要进行转码的转码操作。 http://developer.qiniu.com/docs/v6/api/reference/fop/av/avthumb.html
$fops = "avthumb/mp4/s/640x360/vb/1.4m|saveas/" . \Qiniu\base64_urlSafeEncode($bucket . ":qiniu_640x360.mp4");
list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force);
echo "\n====> pfop avthumb result: \n";
if ($err != null) {
var_dump($err);
} else {
echo "PersistentFop Id: $id\n";
}
//查询转码的进度和状态
list($ret, $err) = $pfop->status($id);
echo "\n====> pfop avthumb status: \n";
if ($err != null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
//对已经上传到七牛的视频发起异步转码操作
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
//要转码的文件所在的空间和文件名。
$key = 'qiniu.mp4';
//转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline
$pipeline = 'sdktest';
//转码完成后通知到你的业务服务器。
$notifyUrl = 'http://375dec79.ngrok.com/notify.php';
$force = false;
$config = new \Qiniu\Config();
//$config->useHTTPS=true;
$pfop = new PersistentFop($auth, $config);
//需要添加水印的图片UrlSafeBase64
//可以参考http://developer.qiniu.com/code/v6/api/dora-api/av/video-watermark.html
$base64URL = Qiniu\base64_urlSafeEncode('http://devtools.qiniu.com/qiniu.png');
//水印参数
$fops = "avthumb/mp4/s/640x360/vb/1.4m/image/" . $base64URL . "|saveas/"
. \Qiniu\base64_urlSafeEncode($bucket . ":qiniu_wm.mp4");
list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force);
echo "\n====> pfop avthumb result: \n";
if ($err != null) {
var_dump($err);
} else {
echo "PersistentFop Id: $id\n";
}
//查询转码的进度和状态
list($ret, $err) = $pfop->status($id);
echo "\n====> pfop avthumb status: \n";
if ($err != null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
$accessKey = 'Access_Key';
$secretKey = 'Secret_Key';
$auth = new Auth($accessKey, $secretKey);
//要持久化处理的文件所在的空间和文件名。
$bucket = 'Bucket_Name';
//持久化处理使用的队列名称。 https://portal.qiniu.com/mps/pipeline
$pipeline = 'pipeline_name';
//持久化处理完成后通知到你的业务服务器。
$notifyUrl = 'http://375dec79.ngrok.com/notify.php';
$pfop = new PersistentFop($auth, $bucket, $pipeline, $notifyUrl);
$id = "z2.5955c739e3d0041bf80c9baa";
//查询持久化处理的进度和状态
list($ret, $err) = $pfop->status($id);
echo "\n====> pfop avthumb status: \n";
if ($err != null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Http\Client;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$argusManager = new \Qiniu\Storage\ArgusManager($auth, $config);
$reqBody = array();
$reqBody['uri'] = "xxxx";
$ops = array();
$ops = array(
array(
'op' => 'pulp',
'params' => array(
'labels' => array(
array(
'label' => "1",
'select' => 1,
'score' => 2,
),
)
)
),
);
$params = array();
$params = array(
'async' => false,
'vframe' => array(
'mode' => 1,
'interval' => 8,
)
);
$req = array();
$req['data'] = $reqBody;
$req['ops'] = $ops;
$req['params'] = $params;
$body = json_encode($req);
$vid = "xxxx";
list($ret, $err) = $argusManager->pulpVideo($body, $vid);
if ($err !== null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$private = 1;
list($Info, $err) = $bucketManager->putBucketAccessMode($bucket, $private);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$mode = 1;
list($Info, $err) = $bucketManager->putBucketAccessStyleMode($bucket, $mode);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$name = 'testdemo';
$prefix = 'test1';
$suffix = 'mp3';
$event = array("move","copy");
$callbackURL = 'http://www.qiniu.com';
list($Info, $err) = $bucketManager->putBucketEvent($bucket, $name, $prefix, $suffix, $event, $callbackURL);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$maxAge = 15768000;
list($Info, $err) = $bucketManager->putBucketMaxAge($bucket, $maxAge);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$size = 99999;
$count = 99;
list($Info, $err) = $bucketManager->putBucketQuota($bucket, $size, $count);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$mode = 1;
$norefer = "1";
$pattern = "*.qiniu.com";
list($Info, $err) = $bucketManager->putReferAntiLeech($bucket, $mode, $norefer, $pattern);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Etag;
$localFile = "/Users/jemy/Documents/qiniu.mp4";
list($etag, $err) = Etag::sum($localFile);
if ($err == null) {
echo "Etag: $etag";
} else {
var_dump($err);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
//每次最多不能超过1000个
$keyMimePairs = array(
'qiniu.mp4' => 'video/x-mp4',
'qiniu.png' => 'image/x-png',
'qiniu.jpg' => 'image/x-jpg'
);
$ops = $bucketManager->buildBatchChangeMime($bucket, $keyMimePairs);
list($ret, $err) = $bucketManager->batch($ops);
if ($err) {
print_r($err);
} else {
print_r($ret);
}
... ...