class Settings has been moved into namespace Seeddms\Seeddms

This commit is contained in:
Uwe Steinmann 2025-10-28 15:48:10 +01:00
parent ef49a43644
commit 9ac6bca75f
2 changed files with 16 additions and 33 deletions

View File

@ -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) {

View File

@ -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);