]> git.andy128k.dev Git - ipf.git/commitdiff
better application path detection
authorAndrey Kutejko <andy128k@gmail.com>
Tue, 17 Dec 2013 06:30:58 +0000 (08:30 +0200)
committerAndrey Kutejko <andy128k@gmail.com>
Tue, 17 Dec 2013 06:30:58 +0000 (08:30 +0200)
ipf/application.php

index c5e8ad5c2f3d44f3e4e9d74aa501ba0ade412d8f..037f86d17f0b58f00fad32838c550f28190523a1 100644 (file)
@@ -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 {