b9212d2660e4540f9ccd6b96016da0d6ed21c006
14 * The base directory where path is located
17 protected $baseDir = "";
19 function __construct($baseDir = "", $path = "") {
20 $this->baseDir
= $baseDir;
24 function __invoke($path) {
30 function __toString() {
31 return $this->getFullPath();
34 function getBaseDir() {
35 return $this->baseDir
;
38 function getPathName() {
42 function getFullPath($ext = "") {
43 return $this->baseDir
. DIRECTORY_SEPARATOR
. $this->path
. $ext;
46 function getSubPath($path) {
47 return trim(substr($path, strlen($this->baseDir
)), DIRECTORY_SEPARATOR
);
50 function isFile($ext = ".md") {
51 return is_file($this->getFullPath($ext));
55 if ($this->isFile()) {
56 return htmlspecialchars(file_get_contents($this->getFullPath()));
57 } elseif ($this->isFile("")) {
58 return htmlspecialchars(file_get_contents($this->getFullPath("")));