|
@@ -123,4 +123,27 @@ class Config {
|
|
|
return $_cnf[$conf_file];
|
|
return $_cnf[$conf_file];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * activeProject - SE/projects/{activeProject}/
|
|
|
|
|
+ * may be set by ENV or in CRM_CONFIG
|
|
|
|
|
+ */
|
|
|
|
|
+ public static function getProjectName() {
|
|
|
|
|
+ static $_activeProject = null;
|
|
|
|
|
+ if (null !== $_activeProject) return $_activeProject;
|
|
|
|
|
+
|
|
|
|
|
+ $activeProject = V::get('P5_ACTIVE_PROJECT', '', $_SERVER);
|
|
|
|
|
+ DBG::log("\$activeProject = '{$activeProject}' (ENV)");
|
|
|
|
|
+ if (!$activeProject) $activeProject = DB::getPDO()->fetchValue(" select c.CONF_VAL from CRM_CONFIG c where c.CONF_KEY = 'activeProject' ");
|
|
|
|
|
+ DBG::log("\$activeProject = '{$activeProject}' (ENV, DB)");
|
|
|
|
|
+ $_activeProject = (string)$activeProject;
|
|
|
|
|
+
|
|
|
|
|
+ return $_activeProject;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static function getProjectPath() {
|
|
|
|
|
+ $activeProject = self::getProjectName();
|
|
|
|
|
+ if (!$activeProject) return null;
|
|
|
|
|
+ return APP_PATH_ROOT . DS . "projects" . DS . "{$activeProject}";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|