Skip to content

Commit 7aa92bf

Browse files
author
FreedomKnight
committed
add setBasePath
1 parent 8d86ccd commit 7aa92bf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/FileApi.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ public function __construct($basepath = '/', $visibility = 'public')
2727
}
2828

2929
$this->visibility = $visibility;
30+
}
31+
32+
public function setBasePath($basepath)
33+
{
34+
if (mb_substr($basepath, -1, 1, 'utf8') != '/') {
35+
$basepath .= '/';
36+
}
37+
3038
$this->basepath = $basepath;
39+
return $this;
3140
}
3241

3342
public function get($filename, $size = null)

0 commit comments

Comments
 (0)