Skip to content

Commit

Permalink
Update imdb.class.php
Browse files Browse the repository at this point in the history
  • Loading branch information
saslv authored Sep 11, 2017
1 parent 2ddf3c6 commit bc24f13
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion imdb.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ class IMDB
* @throws \IMDBException
*/
public function __construct($sSearch, $iCache = null, $sSearchFor = 'all', $sRoot = null) {
if(isNull($sRoot)) $this->sRoot = dirname(__FILE__);
if(is_null($sRoot)){
$this->sRoot = dirname(__FILE__);
}else{
$this->sRoot = $sRoot;
}

if ( ! is_writable($this->sRoot . '/posters') && ! mkdir($this->sRoot . '/posters')) {
throw new IMDBException('The directory “' . $this->sRoot . '/posters” isn’t writable.');
}
Expand Down

0 comments on commit bc24f13

Please sign in to comment.