CdnSampleConf.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * Copyright 2014 Baidu, Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. *
  8. * Http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  11. * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  12. * specific language governing permissions and limitations under the License.
  13. */
  14. error_reporting(-1);
  15. date_default_timezone_set('UTC');
  16. define('CDN_CLIENT_ROOT', dirname(__DIR__));
  17. $g_CDN_TEST_CONFIG =
  18. array(
  19. 'credentials' => array(
  20. 'accessKeyId' => 'your ak',
  21. 'secretAccessKey' => 'your sk',
  22. ),
  23. 'endpoint' => 'http://cdn.baidubce.com',
  24. );
  25. $STDERR = fopen('php://stderr', 'w+');
  26. $__handler = new \Monolog\Handler\StreamHandler($STDERR, \Monolog\Logger::DEBUG);
  27. $__handler->setFormatter(
  28. new \Monolog\Formatter\LineFormatter(null, null, false, true)
  29. );
  30. \BaiduBce\Log\LogFactory::setInstance(
  31. new \BaiduBce\Log\MonoLogFactory(array($__handler))
  32. );
  33. \BaiduBce\Log\LogFactory::setLogLevel(\Psr\Log\LogLevel::DEBUG);