You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
587 B

2 years ago
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Jaeger <JaegerCode@gmail.com>
  5. * Date: 18/12/11
  6. * Time: 下午6:48
  7. */
  8. require __DIR__.'/../vendor/autoload.php';
  9. use Jaeger\GHttp;
  10. use Cache\Adapter\Predis\PredisCachePool;
  11. $rt = GHttp::get('http://httpbin.org/get',[
  12. 'wd' => 'QueryList'
  13. ],[
  14. 'cache' => __DIR__,
  15. 'cache_ttl' => 120
  16. ]);
  17. print_r($rt);
  18. $client = new \Predis\Client('tcp:/127.0.0.1:6379');
  19. $pool = new PredisCachePool($client);
  20. $rt = GHttp::get('http://httpbin.org/get',[
  21. 'wd' => 'QueryList'
  22. ],[
  23. 'cache' => $pool,
  24. 'cache_ttl' => 120
  25. ]);
  26. print_r($rt);