for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of CacheTool.
*
* (c) Samuel Gordalina <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CacheTool\Adapter\Http;
class FileGetContents extends AbstractHttp
{
public function fetch($filename)
$url = "{$this->baseUrl}/{$filename}";
$contents = @file_get_contents($url);
if (false === $contents) {
return serialize([
'result' => false,
'errors' => [
[
'no' => 0,
'str' => "file_get_contents() call failed with url: ${url}",
],
]);
}
return $contents;