From 3500190e41b4dc94cf67a126e063a8960b0c3b78 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 12 Apr 2017 16:49:05 +0200 Subject: [PATCH 1/4] Default to utf8mb4 https://github.com/friendica/friendica/issues/3324 --- include/dbstructure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/dbstructure.php b/include/dbstructure.php index 48cc02d2d1..b2f61eec01 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -154,7 +154,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) { if (isset($a->config["system"]["db_charset"])) { $charset = $a->config["system"]["db_charset"]; } else { - $charset = "utf8"; + $charset = "utf8mb4"; } $errors = false; From a2a03c3f70a519381074e545d9ff9d742d6c2df1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 16 Apr 2017 16:04:38 +0200 Subject: [PATCH 2/4] Default UTF8MB4 for CREATE DATABASE --- friendica_test_data.sql | 2 +- mod/install.php | 2 +- util/vagrant_provision.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/friendica_test_data.sql b/friendica_test_data.sql index 6a34272bb6..f3a0081384 100644 --- a/friendica_test_data.sql +++ b/friendica_test_data.sql @@ -19,7 +19,7 @@ -- Current Database: `friendica` -- -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `friendica` /*!40100 DEFAULT CHARACTER SET latin1 */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `friendica` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */; USE `friendica`; diff --git a/mod/install.php b/mod/install.php index fbd296a9da..8854723b76 100755 --- a/mod/install.php +++ b/mod/install.php @@ -48,7 +48,7 @@ function install_post(App $a) { $db = new dba($dbhost, $dbuser, $dbpass, '', true); if(! get_db_errno()) { - $r = q("CREATE DATABASE '%s'", + $r = q("CREATE DATABASE '%s' DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci", dbesc($dbdata) ); if ($r) { diff --git a/util/vagrant_provision.sh b/util/vagrant_provision.sh index 6b7f0b862e..39db0d73c4 100644 --- a/util/vagrant_provision.sh +++ b/util/vagrant_provision.sh @@ -100,7 +100,7 @@ sudo ln -fs /vagrant /var/www cp /vagrant/util/htconfig.vagrant.php /vagrant/.htconfig.php # create the friendica database -echo "create database friendica" | mysql -u root -proot +echo "create database friendica DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" | mysql -u root -proot # import test database $MYSQL -uroot -proot friendica < /vagrant/friendica_test_data.sql From 08924b9c598fc969923fc16c3eccd90a931bbd1f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 18 Apr 2017 21:21:29 +0200 Subject: [PATCH 3/4] Revert unneeded changes in third-party libraries https://github.com/friendica/friendica/pull/3326#discussion_r112039526 https://github.com/friendica/friendica/pull/3326#discussion_r112039589 --- library/Smarty/demo/plugins/resource.mysql.php | 2 +- library/Smarty/demo/plugins/resource.mysqls.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Smarty/demo/plugins/resource.mysql.php b/library/Smarty/demo/plugins/resource.mysql.php index a5a3507209..dfc9606b4e 100644 --- a/library/Smarty/demo/plugins/resource.mysql.php +++ b/library/Smarty/demo/plugins/resource.mysql.php @@ -10,7 +10,7 @@ * `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, * `source` text, * PRIMARY KEY (`name`) - * ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; * Demo data: *
INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');
* diff --git a/library/Smarty/demo/plugins/resource.mysqls.php b/library/Smarty/demo/plugins/resource.mysqls.php index 1c84542425..f694ddf11a 100644 --- a/library/Smarty/demo/plugins/resource.mysqls.php +++ b/library/Smarty/demo/plugins/resource.mysqls.php @@ -12,7 +12,7 @@ * `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, * `source` text, * PRIMARY KEY (`name`) - * ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; * Demo data: *
INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');
* From 6cc4f8b0a9673c77320905f4ae18fdacb76b8f9f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 19 Apr 2017 21:44:13 +0200 Subject: [PATCH 4/4] Delete frio dynamic.php https://github.com/friendica/friendica/pull/3326#discussion_r112116929 --- view/theme/frio/img/dynamic.php | 55 --------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 view/theme/frio/img/dynamic.php diff --git a/view/theme/frio/img/dynamic.php b/view/theme/frio/img/dynamic.php deleted file mode 100644 index b8f71effc0..0000000000 --- a/view/theme/frio/img/dynamic.php +++ /dev/null @@ -1,55 +0,0 @@ - - array ( - 'db' => - array ( - 'class' => 'yii\\db\\Connection', - 'dsn' => 'mysql:host=127.0.0.1;dbname=installer', - 'username' => 'root', - 'password' => 'root', - 'charset' => 'utf8mb4', - ), - 'user' => - array ( - ), - 'mailer' => - array ( - 'transport' => - array ( - 'class' => 'Swift_MailTransport', - ), - ), - 'view' => - array ( - 'theme' => - array ( - 'name' => 'HumHub', - ), - ), - 'formatter' => - array ( - 'defaultTimeZone' => 'Europe/Berlin', - ), - 'formatterApp' => - array ( - 'defaultTimeZone' => 'Europe/Berlin', - 'timeZone' => 'Europe/Berlin', - ), - ), - 'params' => - array ( - 'installer' => - array ( - 'db' => - array ( - 'installer_hostname' => '127.0.0.1', - 'installer_database' => 'installer', - ), - ), - 'config_created_at' => 1440430541, - 'installed' => true, - ), - 'name' => 'Installer', - 'language' => 'de', - 'timeZone' => 'Europe/Berlin', -); ?> \ No newline at end of file