From c43f13a5ddfa852817ed9446ef370e9fdc63b340 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 18 Aug 2021 16:14:34 +0200 Subject: [PATCH 1/4] ci(travis): print logs after failure --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index ab378158f..3381c3ecb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,9 @@ script: - docker-compose exec appwrite vars - docker-compose exec appwrite test --debug +after_failure: +- docker-compose logs appwrite + deploy: - provider: script edge: true From 9170f64a75039d785e70520d01aa9734aa4d9264 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 19 Aug 2021 10:50:21 +0545 Subject: [PATCH 2/4] fix changed getURL to getPath --- app/controllers/general.php | 2 +- app/controllers/mock.php | 4 ++-- app/controllers/shared/api.php | 2 +- composer.json | 2 +- composer.lock | 15 +++++++-------- src/Appwrite/Specification/Format/OpenAPI3.php | 2 +- src/Appwrite/Specification/Format/Swagger2.php | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 708e24985..0af6d92fd 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -316,7 +316,7 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project) { if($route) { Console::error('[Error] Method: '.$route->getMethod()); - Console::error('[Error] URL: '.$route->getURL()); + Console::error('[Error] URL: '.$route->getPath()); } Console::error('[Error] Type: '.get_class($error)); diff --git a/app/controllers/mock.php b/app/controllers/mock.php index 2cad650f5..d4076547e 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -518,7 +518,7 @@ App::shutdown(function($utopia, $response, $request) { throw new Exception('Failed to read results', 500); } - $result[$route->getMethod() . ':' . $route->getURL()] = true; + $result[$route->getMethod() . ':' . $route->getPath()] = true; $tests = \array_merge($tests, $result); @@ -526,5 +526,5 @@ App::shutdown(function($utopia, $response, $request) { throw new Exception('Failed to save resutls', 500); } - $response->dynamic(new Document(['result' => $route->getMethod() . ':' . $route->getURL() . ':passed']), Response::MODEL_MOCK); + $response->dynamic(new Document(['result' => $route->getMethod() . ':' . $route->getPath() . ':passed']), Response::MODEL_MOCK); }, ['utopia', 'response', 'request'], 'mock'); \ No newline at end of file diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 4ebe7f32a..0df72d057 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -40,7 +40,7 @@ App::init(function ($utopia, $request, $response, $project, $user, $register, $e ->setParam('{userId}', $user->getId()) ->setParam('{userAgent}', $request->getUserAgent('')) ->setParam('{ip}', $request->getIP()) - ->setParam('{url}', $request->getHostname().$route->getURL()) + ->setParam('{url}', $request->getHostname().$route->getPath()) ; //TODO make sure we get array here diff --git a/composer.json b/composer.json index fe173521c..9c1807312 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "appwrite/php-clamav": "1.1.*", "appwrite/php-runtimes": "0.4.*", - "utopia-php/framework": "0.17.*", + "utopia-php/framework": "0.18.*", "utopia-php/abuse": "0.5.*", "utopia-php/analytics": "0.2.*", "utopia-php/audit": "0.5.*", diff --git a/composer.lock b/composer.lock index 9db0fcb30..e0858de93 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "63a89a825697892a52aa27d6819b5972", + "content-hash": "45963af754680568d89330a4f37c40d1", "packages": [ { "name": "adhocore/jwt", @@ -1756,16 +1756,16 @@ }, { "name": "utopia-php/framework", - "version": "0.17.2", + "version": "0.18.0", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "3cd5fa2a9e30040277861f4254c5ccd1b1600952" + "reference": "f577522a5eb8009967b893fb7ad4ee70d3f7c0db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/3cd5fa2a9e30040277861f4254c5ccd1b1600952", - "reference": "3cd5fa2a9e30040277861f4254c5ccd1b1600952", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/f577522a5eb8009967b893fb7ad4ee70d3f7c0db", + "reference": "f577522a5eb8009967b893fb7ad4ee70d3f7c0db", "shasum": "" }, "require": { @@ -1799,9 +1799,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.17.2" + "source": "https://github.com/utopia-php/framework/tree/0.18.0" }, - "time": "2021-08-02T10:18:26+00:00" + "time": "2021-08-19T04:58:47+00:00" }, { "name": "utopia-php/image", @@ -4882,7 +4882,6 @@ "type": "github" } ], - "abandoned": true, "time": "2020-09-28T06:45:17+00:00" }, { diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index b14134cdf..d01a7da72 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -91,7 +91,7 @@ class OpenAPI3 extends Format $usedModels = []; foreach ($this->routes as $route) { /** @var \Utopia\Route $route */ - $url = \str_replace('/v1', '', $route->getURL()); + $url = \str_replace('/v1', '', $route->getPath()); $scope = $route->getLabel('scope', ''); $hide = $route->getLabel('sdk.hide', false); $consumes = [$route->getLabel('sdk.request.type', 'application/json')]; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 9809220f8..dfb6bdc98 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -89,7 +89,7 @@ class Swagger2 extends Format $usedModels = []; foreach ($this->routes as $route) { /** @var \Utopia\Route $route */ - $url = \str_replace('/v1', '', $route->getURL()); + $url = \str_replace('/v1', '', $route->getPath()); $scope = $route->getLabel('scope', ''); $hide = $route->getLabel('sdk.hide', false); $consumes = [$route->getLabel('sdk.request.type', 'application/json')]; From 071d7169495bcf26cdd342ec7543f1731c16de22 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 24 Aug 2021 16:45:09 +0100 Subject: [PATCH 3/4] Initial Fix --- app/init.php | 4 +++- docker-compose.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/init.php b/app/init.php index 0dd043bba..fcea4cb15 100644 --- a/app/init.php +++ b/app/init.php @@ -166,7 +166,6 @@ $register->set('dbPool', function () { // Register DB connection $dbPass = App::getEnv('_APP_DB_PASS', ''); $dbScheme = App::getEnv('_APP_DB_SCHEMA', ''); - $pool = new PDOPool((new PDOConfig()) ->withHost($dbHost) ->withPort($dbPort) @@ -174,6 +173,9 @@ $register->set('dbPool', function () { // Register DB connection ->withCharset('utf8mb4') ->withUsername($dbUser) ->withPassword($dbPass) + ->withOptions([ + PDO::ATTR_ERRMODE => App::isDevelopment() ? PDO::ERRMODE_WARNING : PDO::ERRMODE_SILENT, // If in production mode, warnings are not displayed + ]) , 16); return $pool; diff --git a/docker-compose.yml b/docker-compose.yml index 86b1e4dc2..eef722688 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -397,7 +397,7 @@ services: - MYSQL_DATABASE=${_APP_DB_SCHEMA} - MYSQL_USER=${_APP_DB_USER} - MYSQL_PASSWORD=${_APP_DB_PASS} - command: 'mysqld --innodb-flush-method=fsync --wait_timeout=86400' # add ' --query_cache_size=0' for DB tests + command: 'mysqld --innodb-flush-method=fsync' # add ' --query_cache_size=0' for DB tests # command: mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/ib_logfile0.bu && mv /var/lib/mysql/ib_logfile1 /var/lib/mysql/ib_logfile1.bu # smtp: From 667a875b4994d209dd67c90c138d7e294923ed77 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 24 Aug 2021 16:56:12 +0100 Subject: [PATCH 4/4] Update compose.phtml --- app/views/install/compose.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 95e33b9ea..64df401e0 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -342,7 +342,7 @@ services: - MYSQL_DATABASE=${_APP_DB_SCHEMA} - MYSQL_USER=${_APP_DB_USER} - MYSQL_PASSWORD=${_APP_DB_PASS} - command: 'mysqld --innodb-flush-method=fsync --wait_timeout=86400' + command: 'mysqld --innodb-flush-method=fsync' redis: image: redis:6.0-alpine3.12