Improve some error messages, add missing "use"

This commit is contained in:
Cyril 2019-10-14 12:39:58 +02:00
parent 616cf82516
commit ba8b16d5ed
3 changed files with 8 additions and 6 deletions

View file

@ -27,6 +27,8 @@
namespace Baikal\Model; namespace Baikal\Model;
use Symfony\Component\Yaml\Yaml;
class User extends \Flake\Core\Model\Db { class User extends \Flake\Core\Model\Db {
const DATATABLE = "users"; const DATATABLE = "users";
const PRIMARYKEY = "id"; const PRIMARYKEY = "id";
@ -281,7 +283,7 @@ class User extends \Flake\Core\Model\Db {
function getPasswordHashForPassword($sPassword) { function getPasswordHashForPassword($sPassword) {
try { try {
$config = Yaml::parseFile(PROJECT_PATH_CONFIG . "system.yaml"); $config = Yaml::parseFile(PROJECT_PATH_CONFIG . "config.yaml");
} catch(\Exception $e) {} } catch(\Exception $e) {}
return md5($this->get("username") . ':' . $config['parameters']['BAIKAL_AUTH_REALM'] . ':' . $sPassword); return md5($this->get("username") . ':' . $config['parameters']['BAIKAL_AUTH_REALM'] . ':' . $sPassword);

View file

@ -257,19 +257,19 @@ class Framework extends \Flake\Core\Framework {
protected static function initDbMysql(array $config) { protected static function initDbMysql(array $config) {
if (!$config['parameters']['PROJECT_DB_MYSQL_HOST']) { if (!$config['parameters']['PROJECT_DB_MYSQL_HOST']) {
die("<h3>The constant PROJECT_DB_MYSQL_HOST, containing the MySQL host name, is not set.<br />You should set it in Specific/config.system.php</h3>"); die("<h3>The constant PROJECT_DB_MYSQL_HOST, containing the MySQL host name, is not set.<br />You should set it in config/system.yaml</h3>");
} }
if (!$config['parameters']['PROJECT_DB_MYSQL_DBNAME']) { if (!$config['parameters']['PROJECT_DB_MYSQL_DBNAME']) {
die("<h3>The constant PROJECT_DB_MYSQL_DBNAME, containing the MySQL database name, is not set.<br />You should set it in Specific/config.system.php</h3>"); die("<h3>The constant PROJECT_DB_MYSQL_DBNAME, containing the MySQL database name, is not set.<br />You should set it in config/system.yaml</h3>");
} }
if (!$config['parameters']['PROJECT_DB_MYSQL_USERNAME']) { if (!$config['parameters']['PROJECT_DB_MYSQL_USERNAME']) {
die("<h3>The constant PROJECT_DB_MYSQL_USERNAME, containing the MySQL database username, is not set.<br />You should set it in Specific/config.system.php</h3>"); die("<h3>The constant PROJECT_DB_MYSQL_USERNAME, containing the MySQL database username, is not set.<br />You should set it in config/system.yaml</h3>");
} }
if (!$config['parameters']['PROJECT_DB_MYSQL_PASSWORD']) { if (!$config['parameters']['PROJECT_DB_MYSQL_PASSWORD']) {
die("<h3>The constant PROJECT_DB_MYSQL_PASSWORD, containing the MySQL database password, is not set.<br />You should set it in Specific/config.system.php</h3>"); die("<h3>The constant PROJECT_DB_MYSQL_PASSWORD, containing the MySQL database password, is not set.<br />You should set it in config/system.yaml</h3>");
} }
try { try {

View file

@ -31,4 +31,4 @@ composer.lock: composer.json
clean: clean:
# Wipe out all local data, and go back to a clean install # Wipe out all local data, and go back to a clean install
rm Specific/config.php Specific/config.system.php Specific/db/db.sqlite; true rm config/config.yaml config/system.yaml Specific/db/db.sqlite; true