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
parent cf0881302b
commit 07533e7940

View File

@@ -154,10 +154,14 @@ class HttpStream
*/
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);
$fileInfo = pathinfo($filename, PATHINFO_EXTENSION);
$this->setExtension($fileInfo["extension"]);
$this->setExtension($fileInfo);
$this->setSourceName(basename($filename));
}