bootstrap.php
990 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
// @codingStandardsIgnoreFile
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$testAuth = new Auth($accessKey, $secretKey);
$bucketName = 'phpsdk';
$key = 'php-logo.png';
$key2 = 'niu.jpg';
$bucketNameBC = 'phpsdk-bc';
$bucketNameNA = 'phpsdk-na';
$dummyAccessKey = 'abcdefghklmnopq';
$dummySecretKey = '1234567890';
$dummyAuth = new Auth($dummyAccessKey, $dummySecretKey);
//cdn
$timestampAntiLeechEncryptKey = getenv('QINIU_TIMESTAMP_ENCRPTKEY');
$customDomain = "http://phpsdk.qiniuts.com";
$tid = getenv('TRAVIS_JOB_NUMBER');
if (!empty($tid)) {
$pid = getmypid();
$tid = strstr($tid, '.');
$tid .= '.' . $pid;
}
function qiniuTempFile($size)
{
$fileName = tempnam(sys_get_temp_dir(), 'qiniu_');
$file = fopen($fileName, 'wb');
if ($size > 0) {
fseek($file, $size - 1);
fwrite($file, ' ');
}
fclose($file);
return $fileName;
}