bootstrap.php 989 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. $bucketNameBC = 'phpsdk-bc';
  12. $bucketNameNA = 'phpsdk-na';
  13. $dummyAccessKey = 'abcdefghklmnopq';
  14. $dummySecretKey = '1234567890';
  15. $dummyAuth = new Auth($dummyAccessKey, $dummySecretKey);
  16. //cdn
  17. $timestampAntiLeechEncryptKey = getenv('QINIU_TIMESTAMP_ENCRPTKEY');
  18. $customDomain = "http://phpsdk.peterpy.cn";
  19. $tid = getenv('TRAVIS_JOB_NUMBER');
  20. if (!empty($tid)) {
  21. $pid = getmypid();
  22. $tid = strstr($tid, '.');
  23. $tid .= '.' . $pid;
  24. }
  25. function qiniuTempFile($size)
  26. {
  27. $fileName = tempnam(sys_get_temp_dir(), 'qiniu_');
  28. $file = fopen($fileName, 'wb');
  29. if ($size > 0) {
  30. fseek($file, $size - 1);
  31. fwrite($file, ' ');
  32. }
  33. fclose($file);
  34. return $fileName;
  35. }