Change UTF8 to utf8mb4 to properly support utf8 in mysql

This commit is contained in:
osaajani 2021-12-29 02:54:21 +01:00
parent fadffdab10
commit bd3da73711
6 changed files with 14 additions and 14 deletions

View File

@ -1 +1 @@
v3.2.5 v3.2.6

View File

@ -55,7 +55,7 @@ namespace controllers\internals;
*/ */
public function phone($id_phone) public function phone($id_phone)
{ {
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8'); $bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$internal_phone = new \controllers\internals\Phone($bdd); $internal_phone = new \controllers\internals\Phone($bdd);
$phone = $internal_phone->get($id_phone); $phone = $internal_phone->get($id_phone);
@ -74,7 +74,7 @@ namespace controllers\internals;
*/ */
public function user_exists(string $email) public function user_exists(string $email)
{ {
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8'); $bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$internal_user = new \controllers\internals\User($bdd); $internal_user = new \controllers\internals\User($bdd);
$user = $internal_user->get_by_email($email); $user = $internal_user->get_by_email($email);
@ -89,7 +89,7 @@ namespace controllers\internals;
*/ */
public function user_id_exists(string $id) public function user_id_exists(string $id)
{ {
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8'); $bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$internal_user = new \controllers\internals\User($bdd); $internal_user = new \controllers\internals\User($bdd);
$user = $internal_user->get($id); $user = $internal_user->get($id);
@ -111,7 +111,7 @@ namespace controllers\internals;
*/ */
public function create_update_user(string $email, string $password, bool $admin, ?string $api_key = null, string $status = \models\User::STATUS_ACTIVE, bool $encrypt_password = true) public function create_update_user(string $email, string $password, bool $admin, ?string $api_key = null, string $status = \models\User::STATUS_ACTIVE, bool $encrypt_password = true)
{ {
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8'); $bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$internal_user = new \controllers\internals\User($bdd); $internal_user = new \controllers\internals\User($bdd);
$user = $internal_user->get_by_email($email); $user = $internal_user->get_by_email($email);
@ -146,7 +146,7 @@ namespace controllers\internals;
*/ */
public function update_user_status(string $id, string $status) public function update_user_status(string $id, string $status)
{ {
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8'); $bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$internal_user = new \controllers\internals\User($bdd); $internal_user = new \controllers\internals\User($bdd);
$user = $internal_user->get($id); $user = $internal_user->get($id);
@ -167,7 +167,7 @@ namespace controllers\internals;
*/ */
public function delete_user(string $id) public function delete_user(string $id)
{ {
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8'); $bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$internal_user = new \controllers\internals\User($bdd); $internal_user = new \controllers\internals\User($bdd);
$success = $internal_user->delete($id); $success = $internal_user->delete($id);
@ -180,7 +180,7 @@ namespace controllers\internals;
*/ */
public function clean_unused_medias() public function clean_unused_medias()
{ {
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8'); $bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$internal_media = new \controllers\internals\Media($bdd); $internal_media = new \controllers\internals\Media($bdd);
$medias = $internal_media->gets_unused(); $medias = $internal_media->gets_unused();
@ -198,7 +198,7 @@ namespace controllers\internals;
*/ */
public function quota_limit_alerting() public function quota_limit_alerting()
{ {
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8'); $bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$internal_quota = new \controllers\internals\Quota($bdd); $internal_quota = new \controllers\internals\Quota($bdd);
$internal_quota->alerting_for_limit_close_and_reached(); $internal_quota->alerting_for_limit_close_and_reached();
} }
@ -208,7 +208,7 @@ namespace controllers\internals;
*/ */
public function renew_quotas() public function renew_quotas()
{ {
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8'); $bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$internal_quota = new \controllers\internals\Quota($bdd); $internal_quota = new \controllers\internals\Quota($bdd);
$internal_quota->renew_quotas(); $internal_quota->renew_quotas();
} }

View File

@ -44,7 +44,7 @@ class Launcher extends AbstractDaemon
public function run() public function run()
{ {
//Create the internal controllers //Create the internal controllers
$this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8'); $this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
$this->internal_phone = new \controllers\internals\Phone($this->bdd); $this->internal_phone = new \controllers\internals\Phone($this->bdd);
$this->start_sender_daemon(); $this->start_sender_daemon();

View File

@ -60,7 +60,7 @@ class Phone extends AbstractDaemon
$this->read_tick += 1; $this->read_tick += 1;
$this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8'); $this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
//Send smss in queue //Send smss in queue
$this->send_smss(); $this->send_smss();

View File

@ -94,7 +94,7 @@ class Sender extends AbstractDaemon
public function on_start() public function on_start()
{ {
$this->logger->info('Starting Sender with pid ' . getmypid()); $this->logger->info('Starting Sender with pid ' . getmypid());
$this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8'); $this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
} }
public function on_stop() public function on_stop()

View File

@ -12,6 +12,6 @@ environments:
user: '%APP_DATABASE_USER%' user: '%APP_DATABASE_USER%'
pass: '%APP_DATABASE_PASS%' pass: '%APP_DATABASE_PASS%'
port: 3306 port: 3306
charset: utf8 charset: utf8mb4
version_order: creation version_order: creation