From d4c03133d054dbb9a1c24865619a1b4b7cfa94d0 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Thu, 11 Jul 2013 21:25:23 +0300 Subject: [PATCH] simplify application path guess --- ipf/application.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ipf/application.php b/ipf/application.php index b913480..73f3709 100644 --- a/ipf/application.php +++ b/ipf/application.php @@ -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) { -- 2.49.0