我试图使用Laravel文件系统获得相关的外部文件,但我不断收到一个File does not exist at path
异常Laravel文件::得到()文件并不在路径异常存在
这里是我的代码
File::get('http://lorempixel.com/272/172');
的Laravel被调用函数
public function get($path, $lock = false)
{
if ($this->isFile($path)) {
return $lock ? $this->sharedGet($path) : file_get_contents($path);
}
throw new FileNotFoundException("File does not exist at path {$path}");
}
我有我的服务器上测试file_get_contents('http://lorempixel.com/272/172')
和工作正常。
如果做dd($path)
的if语句中,我得到
"/home/vagrant/Code/test/storage/framework/sessions/fdb554540ba30a38464950b36908fa20e0ee94cc"
返回
如果我这样做dd($path)
if语句之外,我得到http://lorempixel.com/272/172
返回
我感到困惑,这是很奇怪的
File :: getRemote已在5.1中弃用 – user2834482
请阅读https://github.com/laravel/framework/issues/3366 –