From 502ee062a239386e3e7f0d36a3874d68858d1032 Mon Sep 17 00:00:00 2001 From: David Drapeau Date: Thu, 26 Nov 2020 14:24:16 +0100 Subject: [PATCH] making wefra fully customisable by external addons (cont.) --- modules/ClassConfig.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/modules/ClassConfig.php b/modules/ClassConfig.php index eac4f1e..7e05656 100644 --- a/modules/ClassConfig.php +++ b/modules/ClassConfig.php @@ -5,7 +5,7 @@ class ClassConfig implements InterfacePostgreSQL, InterfaceConfig { public function __construct(){} public function __destruct(){} - public function databaseConnect(){ + public static function databaseConnect(){ try { $oPDOLink = new PDO("pgsql:host=".InterfacePostgreSQL::PG_SERVER.";port=".InterfacePostgreSQL::PG_PORT.";dbname=".InterfacePostgreSQL::PG_DBNAME.";user=".InterfacePostgreSQL::PG_USER.";password=".InterfacePostgreSQL::PG_PASSWORD); //, array(PDO::MYSQL_ATTR_INIT_COMMAND=>"SET NAMES utf8") return $oPDOLink; @@ -33,16 +33,27 @@ class ClassConfig implements InterfacePostgreSQL, InterfaceConfig { } } - public function getURLRoot($post_url=''){ - $this->_postURL=$post_url; - return ($this->_postURL!='')?InterfaceConfig::URL_ROOT.$this->_postURL:InterfaceConfig::URL_ROOT; - } + public function getURLRoot($post_url=''){ + $this->_postURL=$post_url; + return ($this->_postURL!='')?InterfaceConfig::URL_ROOT.$this->_postURL:InterfaceConfig::URL_ROOT; + } + + public function getPathRoot($post_url=''){ + $this->_postURL=$post_url; + return ($this->_postURL!='')?InterfaceConfig::PATH_ROOT.$this->_postURL:InterfaceConfig::PATH_ROOT; + } + + public function getPathCustom($post_url=''){ + $this->_postURL=$post_url; + return ($this->_postURL!='')?InterfaceConfig::PATH_CUSTOM.$this->_postURL:InterfaceConfig::PATH_CUSTOM; + } public function getURLScript($post_url=''){ $this->_postURL=$post_url; return ($this->_postURL!='')?InterfaceConfig::URL_SCRIPT.$this->_postURL:InterfaceConfig::URL_SCRIPT; } + public function getConfig(){ $oPDOLink = ClassConfig::databaseConnect(); $rowsConfig = array();