]> git.andy128k.dev Git - ipf.git/commitdiff
simplify application path guess
authorAndrey Kutejko <andy128k@gmail.com>
Thu, 11 Jul 2013 18:25:23 +0000 (21:25 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Thu, 11 Jul 2013 18:25:23 +0000 (21:25 +0300)
ipf/application.php

index b9134803403a81d0c392a603aec0d2167dd5be0e..73f370979437b7438df720df3779454280e6a231 100644 (file)
@@ -9,11 +9,8 @@ abstract class IPF_Application
     {
         $this->name = str_replace('_App', '', get_class($this));
 
-        if (strpos($this->name,'IPF_')===0)
-            $this->path = IPF::get('ipf_path').DIRECTORY_SEPARATOR.strtolower(str_replace('_',DIRECTORY_SEPARATOR,$this->name));
-        else
-            $this->path = IPF::get('project_path').DIRECTORY_SEPARATOR.strtolower(str_replace('_',DIRECTORY_SEPARATOR,$this->name));
-        $this->path .= DIRECTORY_SEPARATOR;
+        $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;
 
         if (array_key_exists('models',$data)) {
             foreach ($data['models'] as &$modelname) {