Fix for HttpStream class, updating old scheme to updater return value using pathinfo() func.

This commit is contained in:
Erik Amaru Ortiz
2014-03-06 12:10:00 -04:00
committed by user
parent ba1ff9e6e9
commit bc464cbe55

View File

@@ -154,10 +154,14 @@ class HttpStream
*/ */
public function loadFromFile($filename) public function loadFromFile($filename)
{ {
$this->filename =$filename; if (! file_exists($filename)) {
throw new \Exception("Unable to find file: $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));
} }