Fix for HttpStream class, updating old scheme to updater return value using pathinfo() func.
This commit is contained in:
@@ -154,10 +154,14 @@ class HttpStream
|
|||||||
*/
|
*/
|
||||||
public function loadFromFile($filename)
|
public function loadFromFile($filename)
|
||||||
{
|
{
|
||||||
|
if (! file_exists($filename)) {
|
||||||
|
throw new \Exception("Unable to find file: $filename");
|
||||||
|
}
|
||||||
|
|
||||||
$this->filename = $filename;
|
$this->filename = $filename;
|
||||||
$this->content = file_get_contents($this->filename);
|
$this->content = file_get_contents($this->filename);
|
||||||
$fileInfo = pathinfo($filename, PATHINFO_EXTENSION);
|
$fileInfo = pathinfo($filename, PATHINFO_EXTENSION);
|
||||||
$this->setExtension($fileInfo["extension"]);
|
$this->setExtension($fileInfo);
|
||||||
$this->setSourceName(basename($filename));
|
$this->setSourceName(basename($filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user