Skip to content

Commit

Permalink
exists method changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
omaximus committed Dec 1, 2014
1 parent b5d9e3c commit 111394e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/LocalFileService.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ public function write($data, $filename = '', $uploadDir = '')
*/
public function exists($filename)
{
// Cut base dir name
if (__SAMSON_BASE__ != '/') {
$filename = str_replace(__SAMSON_BASE__, '', $filename);
}
// Cut first back slash to retrieve relative path
if ($filename[0] === '/') {
$filename = substr($filename, 1);
}
return file_exists($filename);
}

Expand Down

0 comments on commit 111394e

Please sign in to comment.