diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index fd09569f9..2722e07b3 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -11,6 +11,12 @@ * @version Release: @package_version@ */ +namespace Seeddms\Seeddms; + +use SeedDMS_Core_File; +use SeedDMS_Core_DMS; +use SeedDMS_Core_DatabaseAccess; + /** * Class for reading and writing the configuration file * @@ -1595,39 +1601,14 @@ class Settings { /* {{{ */ } if($dsn) { $connTmp = new PDO($dsn, $this->_dbUser, $this->_dbPass); - /* Check if there wasn't a previous error while searching for - * SeedDMS_Core. - */ - if(!isset($result["coreDir"])) { - /* Instanciate SeedDMS_Core to check version */ - if(!empty($this->_coreDir)) - require_once($this->_coreDir.'/Core.php'); - else - require_once($this->_rootDir.'../vendor/seeddms/core/Core.php'); - $tmpcore = new SeedDMS_Core_DMS(null, $this->_contentDir); - $db = new SeedDMS_Core_DatabaseAccess($this->_dbDriver, $this->_dbHostname, $this->_dbUser, $this->_dbPass, $this->_dbDatabase); - if(!$db->connect()) { - $result["dbDatabase"] = array( - "status" => "error", - "type" => "error", - "currentvalue" => '[host, user, database] -> [' . $this->_dbHostname . ',' . $this->_dbUser . ',' . $this->_dbDatabase .']', - "systemerror" => $connTmp->ErrorMsg() - ); - } else { - /* - $dms = new SeedDMS_Core_DMS($db, $this->_contentDir.$this->_contentOffsetDir); - - if(!$dms->checkVersion()) { - $result["dbVersion"] = array( - "status" => "error", - "type" => "error", - "currentvalue" => $dms->version, - "suggestion" => 'updateDatabase' - ); - } - */ - } - $connTmp = null; + $db = new SeedDMS_Core_DatabaseAccess($this->_dbDriver, $this->_dbHostname, $this->_dbUser, $this->_dbPass, $this->_dbDatabase); + if(!$db->connect()) { + $result["dbDatabase"] = array( + "status" => "error", + "type" => "error", + "currentvalue" => '[host, user, database] -> [' . $this->_dbHostname . ',' . $this->_dbUser . ',' . $this->_dbDatabase .']', + "systemerror" => $connTmp->ErrorMsg() + ); } } } catch(Exception $e) { diff --git a/inc/inc.Settings.php b/inc/inc.Settings.php index 07a49b021..5ff65c570 100644 --- a/inc/inc.Settings.php +++ b/inc/inc.Settings.php @@ -18,6 +18,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +use Seeddms\Seeddms\Settings; + require_once('inc.ClassSettings.php'); if(defined("SEEDDMS_CONFIG_FILE")) $settings = new Settings(SEEDDMS_CONFIG_FILE);