我試圖使用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 –