Skip to content

Commit

Permalink
bug fix for systems when realpath returns false on some systems and t…
Browse files Browse the repository at this point in the history
…hus the configsetexceptions thrown have no path set in the message.
  • Loading branch information
buggedcom committed Mar 17, 2014
1 parent c4d5f65 commit ad611c7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/PHPVideoToolkit/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,19 @@ public function __set($key, $value)

case 'temp_directory' :

$original_value = $value;
$value = realpath($value);
if(empty($value) === true || is_dir($value) === false)
{
throw new ConfigSetException('`temp_directory` "'.$value.'" does not exist or is not a directory.');
throw new ConfigSetException('`temp_directory` "'.$original_value.'" does not exist or is not a directory.');
}
else if(is_readable($value) === false)
{
throw new ConfigSetException('`temp_directory` "'.$value.'" is not readable.');
throw new ConfigSetException('`temp_directory` "'.$original_value.'" is not readable.');
}
else if(is_writable($value) === false)
{
throw new ConfigSetException('`temp_directory` "'.$value.'" is not writeable.');
throw new ConfigSetException('`temp_directory` "'.$original_value.'" is not writeable.');
}

$this->{'_'.$key} = $value;
Expand Down

0 comments on commit ad611c7

Please sign in to comment.