From: Andrey Kutejko Date: Tue, 17 Dec 2013 06:30:58 +0000 (+0200) Subject: better application path detection X-Git-Tag: 0.5~8 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=ed38f4d805041ce48c91d95ed1b65260086f9126;p=ipf.git better application path detection --- diff --git a/ipf/application.php b/ipf/application.php index c5e8ad5..037f86d 100644 --- a/ipf/application.php +++ b/ipf/application.php @@ -9,8 +9,8 @@ abstract class IPF_Application { $this->name = str_replace('_App', '', get_class($this)); - $root = (strpos($this->name,'IPF_') === 0) ? IPF::get('ipf_path') : IPF::get('project_path'); - $this->path = $root.DIRECTORY_SEPARATOR.strtolower(str_replace('_',DIRECTORY_SEPARATOR,$this->name)).DIRECTORY_SEPARATOR; + $rc = new ReflectionClass($this); + $this->path = dirname($rc->getFileName()).DIRECTORY_SEPARATOR; $models = array(); try {