bootstrap.php 1.2 KB

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