From 9484413e3d9f5d5de9769287185fe276cb96e689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 20 Jan 2017 16:42:25 +0100 Subject: [PATCH 1/4] Specify we are using MySQL service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 77e5ca62dc..514b27248b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,9 @@ language: php +services: + - mysql + php: - "7.1" - "7.0" From 9d24e4649b8d69594d4aa2cd3cef8e5c9c645b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 20 Jan 2017 19:12:19 +0100 Subject: [PATCH 2/4] Do not create database if exits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 514b27248b..b07625a561 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ install: before_script: - export PATH=~/.composer/vendor/bin/:$PATH - - mysql -uroot -e "CREATE DATABASE test" + - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test" - mysql -uroot < sql/create_tables.sql - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')" - ./test/start-local-server From 9ecda4175b6c19c781cf23254da151bfa15eb81a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Sat, 21 Jan 2017 11:42:00 +0100 Subject: [PATCH 3/4] Run Travis CI tests on OS X as well MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - install dependencies using brew - manuall start MariaDB server Issue #12883 Signed-off-by: Michal Čihař --- .travis.yml | 12 ++++++++++++ test/ci-test | 2 +- test/install-runkit | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b07625a561..4c675666a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,6 +61,18 @@ matrix: env: CI_MODE=release - php: "7.0" env: CI_MODE=docs + - os: osx + language: generic + env: CI_MODE=test + before_install: + - brew tap homebrew/php + - brew update + - brew install ant gettext php70 mariadb + - brew link --force gettext + - curl https://getcomposer.org/installer | php + - ln -s /Users/travis/build/phpmyadmin/phpmyadmin/composer.phar /usr/local/bin/composer + - mysql.server start + cache: directories: - $HOME/.composer/cache/ diff --git a/test/ci-test b/test/ci-test index 49f87891f8..da8bd65c60 100755 --- a/test/ci-test +++ b/test/ci-test @@ -4,7 +4,7 @@ ant locales export PHPUNIT_ARGS="--exclude-group selenium" -if [ $TRAVIS_PHP_VERSION = "hhvm" ] ; then +if [ "$TRAVIS_PHP_VERSION" = "hhvm" ] ; then ant phpunit-hhvm else ant phpunit diff --git a/test/install-runkit b/test/install-runkit index 7fde346b05..180d4ca139 100755 --- a/test/install-runkit +++ b/test/install-runkit @@ -6,7 +6,7 @@ if [ -n "$GATEWAY_INTERFACE" ] ; then exit 1 fi -if [ "$TRAVIS_PHP_VERSION" = "nightly" -o "$TRAVIS_PHP_VERSION" = "hhvm" -o "$TRAVIS_PHP_VERSION" = "7.0" -o "$TRAVIS_PHP_VERSION" = "7.1" ] ; then +if [ "$TRAVIS_PHP_VERSION" = "nightly" -o "$TRAVIS_PHP_VERSION" = "hhvm" -o "$TRAVIS_PHP_VERSION" = "7.0" -o "$TRAVIS_PHP_VERSION" = "7.1" -o "$TRAVIS_OS_NAME" = "osx" ] ; then exit 0 fi From 393402406180291d84161d72baa7d9dbf4e5dee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Sat, 21 Jan 2017 12:24:00 +0100 Subject: [PATCH 4/4] Handle AM/PM marks in date on our own MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is same as with months and days in week - we can not rely on the PHP providing sane result. Also this way we can properly translate it to all supported languages. For example on OS X, the strftime function does not seem to respect PHP locales and always use system ones. Fixes #12913 Signed-off-by: Michal Čihař --- libraries/Util.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libraries/Util.php b/libraries/Util.php index 1333fc2069..684e8c4c58 100644 --- a/libraries/Util.php +++ b/libraries/Util.php @@ -1603,6 +1603,15 @@ class Util $date ); + /* Fill in AM/PM */ + $hours = (int)date('H', $timestamp); + if ($hours >= 12) { + $am_pm = _pgettext('AM/PM indication in time', 'PM'); + } else { + $am_pm = _pgettext('AM/PM indication in time', 'AM'); + } + $date = preg_replace('@%[pP]@', $am_pm, $date); + $ret = strftime($date, $timestamp); // Some OSes such as Win8.1 Traditional Chinese version did not produce UTF-8 // output here. See https://sourceforge.net/p/phpmyadmin/bugs/4207/