fix settings controllers and models

This commit is contained in:
osaajani 2019-11-08 19:17:47 +01:00
parent 65ab7a4b1b
commit 0442f8a9a6
5 changed files with 8 additions and 10 deletions

View File

@ -5,10 +5,10 @@
#####################
# RASPISMS SETTINGS #
#####################
$bdd = descartes\Model::connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$internal_setting = new \controllers\internals\Setting($bdd);
$settings = $internal_setting->all();
$settings = $internal_setting->get_all();
foreach ($settings as $setting)
{
define('RASPISMS_SETTINGS_' . mb_convert_case($setting['name'], MB_CASE_UPPER), $setting['value']);

View File

@ -26,9 +26,9 @@ namespace controllers\internals;
*
* @return array || false
*/
public function all()
public function get_all()
{
return $this->model_setting->all();
return $this->model_setting->get_all();
}
/**

View File

@ -29,8 +29,6 @@ namespace controllers\publics;
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$this->internal_user = new \controllers\internals\User($bdd);
\controllers\internals\Tool::verifyconnect();
}
/**

View File

@ -16,10 +16,10 @@
#####################
# RASPISMS SETTINGS #
#####################
$bdd = descartes\Model::connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$internal_setting = new \controllers\internals\Setting($bdd);
$settings = $internal_setting->all();
$settings = $internal_setting->get_all();
foreach ($settings as $setting)
{
define('RASPISMS_SETTINGS_' . mb_convert_case($setting['name'], MB_CASE_UPPER), $setting['value']);

View File

@ -20,9 +20,9 @@ namespace models;
/**
* Return array of all settings.
*/
public function all(): array
public function get_all(): array
{
return $this->_select('setting', [], '', false);
return $this->_select('setting');
}
/**