You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to download Private transparent proxy cache url with guzzle
I am trying to download a file from a file sharing website, but it really slows down the execution of the script. For large files it is giving me a time out error. I tried everything, but I'm still unable to download the cache URL files, as fast as it can be.
`use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use Kevinrob\GuzzleCache\CacheMiddleware;
use Doctrine\Common\Cache\ChainCache;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\Common\Cache\FilesystemCache;
use Kevinrob\GuzzleCache\Strategy\PrivateCacheStrategy;
use Kevinrob\GuzzleCache\Storage\DoctrineCacheStorage;
use GuzzleHttp\Psr7;
use GuzzleHttp\Cookie\FileCookieJar;
$current_dir = getcwd();
$temp_dir = "/temp/";
$cache_dir = "/cache/";
$stack = HandlerStack::create();
$stack->push(new CacheMiddleware(
new PrivateCacheStrategy(
new DoctrineCacheStorage(
new ChainCache([
new ArrayCache(),
new FilesystemCache($current_dir . $cache_dir),
])
)
)
), 'cache');
// Guzzle init
$cookieJar = new FileCookieJar($current_dir . $temp_dir .'jar.txt', true);
$client = new Client([
'defaults' => ['debug' => true],
'verify' => $current_dir . $temp_dir ."cacert.pem",
'handler' => $stack,
'cookies' => $cookieJar
]);
$download_file = "http://affix.is/mp3embed-1cg17i8ptsc8.mp3";
$resource = fopen($current_dir . $temp_dir ."temp.ext", 'w');
$response = $client->request('GET', $download_file, ['sink' => $resource]);
echo html_status($response);`
The text was updated successfully, but these errors were encountered:
Hi @polupraneeth, I don't realy understand what is your issue 😄. I'm not realy sure that this is related to this library.
I close this issue for the moment, if you need more help about that, don't hesitate to respond 😉.
Trying to download Private transparent proxy cache url with guzzle
I am trying to download a file from a file sharing website, but it really slows down the execution of the script. For large files it is giving me a time out error. I tried everything, but I'm still unable to download the cache URL files, as fast as it can be.
`use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
The text was updated successfully, but these errors were encountered: