From 7aa2ef53e3b015c79a99eaf1c595ef42925874bc Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Sun, 29 Nov 2020 09:26:47 +0100 Subject: [PATCH 01/16] update readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f4698da..cf86bef 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ Alternatively you can integrate this project into the web framework of your choi In these integrations [Composer](https://getcomposer.org/) is used to load this project as a dependency. +For people that don't use composer, the file "`api.include.php`" (containing everything but the configuration) is provided. + ## Configuration Edit the following lines in the bottom of the file "`api.php`": From ad17b03bf2ba0067cd09f6599ba9791ba980a90e Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Sun, 29 Nov 2020 09:30:05 +0100 Subject: [PATCH 02/16] update readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cf86bef..d474d97 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,8 @@ Alternatively you can integrate this project into the web framework of your choi In these integrations [Composer](https://getcomposer.org/) is used to load this project as a dependency. -For people that don't use composer, the file "`api.include.php`" (containing everything but the configuration) is provided. +For people that don't use composer, the file "`api.include.php`" is provided. This file contains everything +from "`api.php`" except the configuration (from "`src/index.php`") and can be used by PHP's "include". ## Configuration From 20ea56b38ebae9e235494cfcd5c076b8255dc44e Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Sun, 29 Nov 2020 09:30:20 +0100 Subject: [PATCH 03/16] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d474d97..1cf2737 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Alternatively you can integrate this project into the web framework of your choi In these integrations [Composer](https://getcomposer.org/) is used to load this project as a dependency. For people that don't use composer, the file "`api.include.php`" is provided. This file contains everything -from "`api.php`" except the configuration (from "`src/index.php`") and can be used by PHP's "include". +from "`api.php`" except the configuration from "`src/index.php`" and can be used by PHP's "include". ## Configuration From 7b64a47b03c685f152811db817de568e0fd972b5 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Sun, 17 Jan 2021 21:04:59 +0100 Subject: [PATCH 04/16] fix for #740 --- api.include.php | 2 +- api.php | 2 +- src/Tqdev/PhpCrudApi/Middleware/Router/SimpleRouter.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api.include.php b/api.include.php index 868dc65..20d074c 100644 --- a/api.include.php +++ b/api.include.php @@ -7065,7 +7065,7 @@ namespace Tqdev\PhpCrudApi\Middleware\Router { $method = strtoupper($request->getMethod()); $path = array(); $segment = $method; - for ($i = 1; $segment; $i++) { + for ($i = 1; strlen($segment) > 0; $i++) { array_push($path, $segment); $segment = RequestUtils::getPathSegment($request, $i); } diff --git a/api.php b/api.php index 7d777bb..9a7512f 100644 --- a/api.php +++ b/api.php @@ -7065,7 +7065,7 @@ namespace Tqdev\PhpCrudApi\Middleware\Router { $method = strtoupper($request->getMethod()); $path = array(); $segment = $method; - for ($i = 1; $segment; $i++) { + for ($i = 1; strlen($segment) > 0; $i++) { array_push($path, $segment); $segment = RequestUtils::getPathSegment($request, $i); } diff --git a/src/Tqdev/PhpCrudApi/Middleware/Router/SimpleRouter.php b/src/Tqdev/PhpCrudApi/Middleware/Router/SimpleRouter.php index b8360ac..b1a5c75 100644 --- a/src/Tqdev/PhpCrudApi/Middleware/Router/SimpleRouter.php +++ b/src/Tqdev/PhpCrudApi/Middleware/Router/SimpleRouter.php @@ -104,7 +104,7 @@ class SimpleRouter implements Router $method = strtoupper($request->getMethod()); $path = array(); $segment = $method; - for ($i = 1; $segment; $i++) { + for ($i = 1; strlen($segment) > 0; $i++) { array_push($path, $segment); $segment = RequestUtils::getPathSegment($request, $i); } From 2e1c42e20b42baf01747a8f42e3735080be9ee85 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Sun, 17 Jan 2021 21:07:36 +0100 Subject: [PATCH 05/16] test for #740 --- tests/functional/001_records/090_list_posts.log | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/functional/001_records/090_list_posts.log diff --git a/tests/functional/001_records/090_list_posts.log b/tests/functional/001_records/090_list_posts.log new file mode 100644 index 0000000..84a1ba9 --- /dev/null +++ b/tests/functional/001_records/090_list_posts.log @@ -0,0 +1,8 @@ +=== +GET /records/posts/0 +=== +404 +Content-Type: application/json; charset=utf-8 +Content-Length: 46 + +{"code":1003,"message":"Record '0' not found"} From 02d4bf7404b8fcb788502ca45c813946b6c4f5b9 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Mon, 18 Jan 2021 08:12:11 +0100 Subject: [PATCH 06/16] test for #740 --- tests/functional/001_records/003_read_post.log | 8 ++++++++ tests/functional/001_records/090_list_posts.log | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 tests/functional/001_records/090_list_posts.log diff --git a/tests/functional/001_records/003_read_post.log b/tests/functional/001_records/003_read_post.log index 8cb9d44..86c05c6 100644 --- a/tests/functional/001_records/003_read_post.log +++ b/tests/functional/001_records/003_read_post.log @@ -6,3 +6,11 @@ Content-Type: application/json; charset=utf-8 Content-Length: 58 {"id":2,"user_id":1,"category_id":2,"content":"It works!"} +=== +GET /records/posts/0 +=== +404 +Content-Type: application/json; charset=utf-8 +Content-Length: 46 + +{"code":1003,"message":"Record '0' not found"} diff --git a/tests/functional/001_records/090_list_posts.log b/tests/functional/001_records/090_list_posts.log deleted file mode 100644 index 84a1ba9..0000000 --- a/tests/functional/001_records/090_list_posts.log +++ /dev/null @@ -1,8 +0,0 @@ -=== -GET /records/posts/0 -=== -404 -Content-Type: application/json; charset=utf-8 -Content-Length: 46 - -{"code":1003,"message":"Record '0' not found"} From bb3cc302708aeaf5db608cb37547ecb8fe78f8e4 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Wed, 20 Jan 2021 23:01:31 +0100 Subject: [PATCH 07/16] fix powertools dep in centos 8 --- docker/centos8/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/centos8/Dockerfile b/docker/centos8/Dockerfile index 625fdfc..4267c30 100644 --- a/docker/centos8/Dockerfile +++ b/docker/centos8/Dockerfile @@ -16,7 +16,7 @@ RUN dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x # enable epel repo RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm # enable powertools repos -RUN dnf -y install 'dnf-command(config-manager)' && dnf -y config-manager --set-enabled PowerTools +RUN dnf -y install 'dnf-command(config-manager)' && dnf -y config-manager --set-enabled powertools # set php to remi 7.4 RUN dnf -y module reset php && dnf -y module enable php:remi-7.4 From b0a0b92a83d49e0f3af118f2da369ba4bffc88a5 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Wed, 20 Jan 2021 23:15:50 +0100 Subject: [PATCH 08/16] fix sqlsrv dbauth bug --- src/Tqdev/PhpCrudApi/Middleware/DbAuthMiddleware.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tqdev/PhpCrudApi/Middleware/DbAuthMiddleware.php b/src/Tqdev/PhpCrudApi/Middleware/DbAuthMiddleware.php index 91d4180..5e96567 100644 --- a/src/Tqdev/PhpCrudApi/Middleware/DbAuthMiddleware.php +++ b/src/Tqdev/PhpCrudApi/Middleware/DbAuthMiddleware.php @@ -63,6 +63,7 @@ class DbAuthMiddleware extends Middleware $columnNames = array_map('trim', explode(',', $returnedColumns)); $columnNames[] = $passwordColumnName; $columnNames[] = $pkName; + $columnNames = array_values(array_unique($columnNames)); } $columnOrdering = $this->ordering->getDefaultColumnOrdering($table); if ($path == 'register') { From e49546d6c99dd46ca683827f1429a5e58a5b3746 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Wed, 20 Jan 2021 23:27:27 +0100 Subject: [PATCH 09/16] tests updated --- README.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 1cf2737..791352d 100644 --- a/README.md +++ b/README.md @@ -1271,10 +1271,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire [3/4] Starting SQLServer 2017 ... skipped [4/4] Cloning PHP-CRUD-API v2 ... skipped ------------------------------------------------ - mysql: 110 tests ran in 1911 ms, 1 skipped, 0 failed - pgsql: 110 tests ran in 1112 ms, 1 skipped, 0 failed + mysql: 110 tests ran in 957 ms, 1 skipped, 0 failed + pgsql: 110 tests ran in 817 ms, 1 skipped, 0 failed sqlsrv: skipped, driver not loaded - sqlite: 110 tests ran in 1178 ms, 12 skipped, 0 failed + sqlite: 110 tests ran in 685 ms, 12 skipped, 0 failed ================================================ Debian 10 (PHP 7.3) ================================================ @@ -1283,10 +1283,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire [3/4] Starting SQLServer 2017 ... skipped [4/4] Cloning PHP-CRUD-API v2 ... skipped ------------------------------------------------ - mysql: 110 tests ran in 3459 ms, 1 skipped, 0 failed - pgsql: 110 tests ran in 1134 ms, 1 skipped, 0 failed + mysql: 110 tests ran in 952 ms, 1 skipped, 0 failed + pgsql: 110 tests ran in 816 ms, 1 skipped, 0 failed sqlsrv: skipped, driver not loaded - sqlite: 110 tests ran in 1275 ms, 12 skipped, 0 failed + sqlite: 110 tests ran in 690 ms, 12 skipped, 0 failed ================================================ Debian 9 (PHP 7.0) ================================================ @@ -1295,10 +1295,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire [3/4] Starting SQLServer 2017 ... skipped [4/4] Cloning PHP-CRUD-API v2 ... skipped ------------------------------------------------ - mysql: 110 tests ran in 3181 ms, 1 skipped, 0 failed - pgsql: 110 tests ran in 1201 ms, 1 skipped, 0 failed + mysql: 110 tests ran in 1075 ms, 1 skipped, 0 failed + pgsql: 110 tests ran in 834 ms, 1 skipped, 0 failed sqlsrv: skipped, driver not loaded - sqlite: 110 tests ran in 1414 ms, 12 skipped, 0 failed + sqlite: 110 tests ran in 728 ms, 12 skipped, 0 failed ================================================ Ubuntu 16.04 (PHP 7.0) ================================================ @@ -1307,9 +1307,9 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire [3/4] Starting SQLServer 2017 ... done [4/4] Cloning PHP-CRUD-API v2 ... skipped ------------------------------------------------ - mysql: 110 tests ran in 3168 ms, 1 skipped, 0 failed - pgsql: 110 tests ran in 1197 ms, 1 skipped, 0 failed - sqlsrv: 110 tests ran in 10151 ms, 1 skipped, 0 failed + mysql: 110 tests ran in 1065 ms, 1 skipped, 0 failed + pgsql: 110 tests ran in 845 ms, 1 skipped, 0 failed + sqlsrv: 110 tests ran in 5404 ms, 1 skipped, 0 failed sqlite: skipped, driver not loaded ================================================ Ubuntu 18.04 (PHP 7.2) @@ -1319,10 +1319,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire [3/4] Starting SQLServer 2017 ... skipped [4/4] Cloning PHP-CRUD-API v2 ... skipped ------------------------------------------------ - mysql: 110 tests ran in 3709 ms, 1 skipped, 0 failed - pgsql: 110 tests ran in 1334 ms, 1 skipped, 0 failed + mysql: 110 tests ran in 1261 ms, 1 skipped, 0 failed + pgsql: 110 tests ran in 859 ms, 1 skipped, 0 failed sqlsrv: skipped, driver not loaded - sqlite: 110 tests ran in 1477 ms, 12 skipped, 0 failed + sqlite: 110 tests ran in 725 ms, 12 skipped, 0 failed ================================================ Ubuntu 20.04 (PHP 7.4) ================================================ @@ -1331,10 +1331,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire [3/4] Starting SQLServer 2017 ... skipped [4/4] Cloning PHP-CRUD-API v2 ... skipped ------------------------------------------------ - mysql: 110 tests ran in 5102 ms, 1 skipped, 0 failed - pgsql: 110 tests ran in 1170 ms, 1 skipped, 0 failed + mysql: 110 tests ran in 1505 ms, 1 skipped, 0 failed + pgsql: 110 tests ran in 851 ms, 1 skipped, 0 failed sqlsrv: skipped, driver not loaded - sqlite: 110 tests ran in 1380 ms, 12 skipped, 0 failed + sqlite: 110 tests ran in 675 ms, 12 skipped, 0 failed The above test run (including starting up the databases) takes less than 5 minutes on my slow laptop. @@ -1354,10 +1354,10 @@ The above test run (including starting up the databases) takes less than 5 minut [3/4] Starting SQLServer 2017 ... skipped [4/4] Cloning PHP-CRUD-API v2 ... skipped ------------------------------------------------ - mysql: 105 tests ran in 3390 ms, 1 skipped, 0 failed - pgsql: 105 tests ran in 936 ms, 1 skipped, 0 failed + mysql: 110 tests ran in 1261 ms, 1 skipped, 0 failed + pgsql: 110 tests ran in 859 ms, 1 skipped, 0 failed sqlsrv: skipped, driver not loaded - sqlite: 105 tests ran in 1063 ms, 12 skipped, 0 failed + sqlite: 110 tests ran in 725 ms, 12 skipped, 0 failed root@b7ab9472e08f:/php-crud-api# As you can see the "run.sh" script gives you access to a prompt in a chosen the docker environment. From c003f404fbaeff44a2d4ae5ba8ebf1f1814285d0 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Wed, 20 Jan 2021 23:42:27 +0100 Subject: [PATCH 10/16] fix for #743 --- api.include.php | 3 ++- api.php | 3 ++- src/Tqdev/PhpCrudApi/Database/LazyPdo.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/api.include.php b/api.include.php index 20d074c..40fb991 100644 --- a/api.include.php +++ b/api.include.php @@ -6387,7 +6387,7 @@ namespace Tqdev\PhpCrudApi\Database { return $this->pdo()->lastInsertId($name); } - public function query(string $statement): \PDOStatement + public function query(string $query, int $fetchMode = null, mixed ...$fetchModeArgs): \PDOStatement { return call_user_func_array(array($this->pdo(), 'query'), func_get_args()); } @@ -7579,6 +7579,7 @@ namespace Tqdev\PhpCrudApi\Middleware { $columnNames = array_map('trim', explode(',', $returnedColumns)); $columnNames[] = $passwordColumnName; $columnNames[] = $pkName; + $columnNames = array_values(array_unique($columnNames)); } $columnOrdering = $this->ordering->getDefaultColumnOrdering($table); if ($path == 'register') { diff --git a/api.php b/api.php index 9a7512f..441d06e 100644 --- a/api.php +++ b/api.php @@ -6387,7 +6387,7 @@ namespace Tqdev\PhpCrudApi\Database { return $this->pdo()->lastInsertId($name); } - public function query(string $statement): \PDOStatement + public function query(string $query, int $fetchMode = null, mixed ...$fetchModeArgs): \PDOStatement { return call_user_func_array(array($this->pdo(), 'query'), func_get_args()); } @@ -7579,6 +7579,7 @@ namespace Tqdev\PhpCrudApi\Middleware { $columnNames = array_map('trim', explode(',', $returnedColumns)); $columnNames[] = $passwordColumnName; $columnNames[] = $pkName; + $columnNames = array_values(array_unique($columnNames)); } $columnOrdering = $this->ordering->getDefaultColumnOrdering($table); if ($path == 'register') { diff --git a/src/Tqdev/PhpCrudApi/Database/LazyPdo.php b/src/Tqdev/PhpCrudApi/Database/LazyPdo.php index 87c2797..bb31f04 100644 --- a/src/Tqdev/PhpCrudApi/Database/LazyPdo.php +++ b/src/Tqdev/PhpCrudApi/Database/LazyPdo.php @@ -117,7 +117,7 @@ class LazyPdo extends \PDO return $this->pdo()->lastInsertId($name); } - public function query(string $statement): \PDOStatement + public function query(string $query, int $fetchMode = null, mixed ...$fetchModeArgs): \PDOStatement { return call_user_func_array(array($this->pdo(), 'query'), func_get_args()); } From f881c9f2285b786109259ce34d77a9c0afaab649 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Wed, 20 Jan 2021 23:46:25 +0100 Subject: [PATCH 11/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 791352d..5687ef6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PHP-CRUD-API -Single file PHP 7 script that adds a REST API to a MySQL/MariaDB, PostgreSQL, SQL Server or SQLite database. +Single file PHP script that adds a REST API to a MySQL/MariaDB, PostgreSQL, SQL Server or SQLite database. NB: This is the [TreeQL](https://treeql.org) reference implementation in PHP. From edb2a69b78b950f85ea61ab07b1db9ed6e097809 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Wed, 20 Jan 2021 23:51:04 +0100 Subject: [PATCH 12/16] PHP 8 compat --- api.include.php | 2 +- api.php | 2 +- src/Tqdev/PhpCrudApi/Database/LazyPdo.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api.include.php b/api.include.php index 40fb991..096e824 100644 --- a/api.include.php +++ b/api.include.php @@ -6387,7 +6387,7 @@ namespace Tqdev\PhpCrudApi\Database { return $this->pdo()->lastInsertId($name); } - public function query(string $query, int $fetchMode = null, mixed ...$fetchModeArgs): \PDOStatement + public function query($query, /* ?int */$fetchMode = null, ...$fetchModeArgs): \PDOStatement { return call_user_func_array(array($this->pdo(), 'query'), func_get_args()); } diff --git a/api.php b/api.php index 441d06e..7b4bccb 100644 --- a/api.php +++ b/api.php @@ -6387,7 +6387,7 @@ namespace Tqdev\PhpCrudApi\Database { return $this->pdo()->lastInsertId($name); } - public function query(string $query, int $fetchMode = null, mixed ...$fetchModeArgs): \PDOStatement + public function query($query, /* ?int */$fetchMode = null, ...$fetchModeArgs): \PDOStatement { return call_user_func_array(array($this->pdo(), 'query'), func_get_args()); } diff --git a/src/Tqdev/PhpCrudApi/Database/LazyPdo.php b/src/Tqdev/PhpCrudApi/Database/LazyPdo.php index bb31f04..b0a6c21 100644 --- a/src/Tqdev/PhpCrudApi/Database/LazyPdo.php +++ b/src/Tqdev/PhpCrudApi/Database/LazyPdo.php @@ -117,7 +117,7 @@ class LazyPdo extends \PDO return $this->pdo()->lastInsertId($name); } - public function query(string $query, int $fetchMode = null, mixed ...$fetchModeArgs): \PDOStatement + public function query($query, /* ?int */$fetchMode = null, ...$fetchModeArgs): \PDOStatement { return call_user_func_array(array($this->pdo(), 'query'), func_get_args()); } From 6c60082ab04f7c32e91c37520f6b9a4b5ede67c1 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Thu, 21 Jan 2021 00:20:37 +0100 Subject: [PATCH 13/16] PHP 8 compat --- api.include.php | 6 +++++- api.php | 6 +++++- docker-compose.yml | 2 ++ src/Tqdev/PhpCrudApi/Middleware/XmlMiddleware.php | 6 +++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/api.include.php b/api.include.php index 096e824..0e866ac 100644 --- a/api.include.php +++ b/api.include.php @@ -8746,7 +8746,11 @@ namespace Tqdev\PhpCrudApi\Middleware { private function xml2json($xml) { - $a = @dom_import_simplexml(simplexml_load_string($xml)); + $o = @simplexml_load_string($xml); + if ($o===false) { + return null; + } + $a = @dom_import_simplexml($o); if (!$a) { return null; } diff --git a/api.php b/api.php index 7b4bccb..49430c7 100644 --- a/api.php +++ b/api.php @@ -8746,7 +8746,11 @@ namespace Tqdev\PhpCrudApi\Middleware { private function xml2json($xml) { - $a = @dom_import_simplexml(simplexml_load_string($xml)); + $o = @simplexml_load_string($xml); + if ($o===false) { + return null; + } + $a = @dom_import_simplexml($o); if (!$a) { return null; } diff --git a/docker-compose.yml b/docker-compose.yml index 405da65..a31a66a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,3 +29,5 @@ services: - "8080:80" depends_on: - database + volumes: + - .:/php-crud-api:ro diff --git a/src/Tqdev/PhpCrudApi/Middleware/XmlMiddleware.php b/src/Tqdev/PhpCrudApi/Middleware/XmlMiddleware.php index b613ce1..b2225e4 100644 --- a/src/Tqdev/PhpCrudApi/Middleware/XmlMiddleware.php +++ b/src/Tqdev/PhpCrudApi/Middleware/XmlMiddleware.php @@ -83,7 +83,11 @@ class XmlMiddleware extends Middleware private function xml2json($xml) { - $a = @dom_import_simplexml(simplexml_load_string($xml)); + $o = @simplexml_load_string($xml); + if ($o===false) { + return null; + } + $a = @dom_import_simplexml($o); if (!$a) { return null; } From 402a9bff0c97f69f6c4a2ef6a1d39bfa9c4f99b9 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Thu, 21 Jan 2021 00:21:36 +0100 Subject: [PATCH 14/16] PHP 8 compat --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index a31a66a..cc7ed6f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,5 +29,5 @@ services: - "8080:80" depends_on: - database - volumes: - - .:/php-crud-api:ro + #volumes: + #- .:/php-crud-api:ro From 9548b023aa01e62615c94a1e342c7d4768b74e0c Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Thu, 21 Jan 2021 00:52:31 +0100 Subject: [PATCH 15/16] update tests --- README.md | 2 +- docker/centos8/Dockerfile | 4 ++-- docker/centos8/run.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5687ef6..bd297a6 100644 --- a/README.md +++ b/README.md @@ -1264,7 +1264,7 @@ Install docker using the following commands and then logout and login for the ch To run the docker tests run "build_all.sh" and "run_all.sh" from the docker directory. The output should be: ================================================ - CentOS 8 (PHP 7.4) + CentOS 8 (PHP 8.0) ================================================ [1/4] Starting MariaDB 10.5 ..... done [2/4] Starting PostgreSQL 12.5 .. done diff --git a/docker/centos8/Dockerfile b/docker/centos8/Dockerfile index 4267c30..59bc59e 100644 --- a/docker/centos8/Dockerfile +++ b/docker/centos8/Dockerfile @@ -18,8 +18,8 @@ RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.n # enable powertools repos RUN dnf -y install 'dnf-command(config-manager)' && dnf -y config-manager --set-enabled powertools -# set php to remi 7.4 -RUN dnf -y module reset php && dnf -y module enable php:remi-7.4 +# set php to remi 8.0 +RUN dnf -y module reset php && dnf -y module enable php:remi-8.0 # disable mariadb and postgresql default (appstream) repo RUN dnf -y module disable mariadb RUN dnf -y module disable postgresql diff --git a/docker/centos8/run.sh b/docker/centos8/run.sh index 189abe8..8dc71e4 100755 --- a/docker/centos8/run.sh +++ b/docker/centos8/run.sh @@ -1,6 +1,6 @@ #!/bin/bash echo "================================================" -echo " CentOS 8 (PHP 7.4)" +echo " CentOS 8 (PHP 8.0)" echo "================================================" echo -n "[1/4] Starting MariaDB 10.5 ..... " # initialize mysql From 24013a1f69d3d86700037fd872910d69ebb887ec Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Thu, 21 Jan 2021 00:53:54 +0100 Subject: [PATCH 16/16] update tests --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd297a6..3d73128 100644 --- a/README.md +++ b/README.md @@ -1210,7 +1210,7 @@ I am testing mainly on Ubuntu and I have the following test setups: - (Docker) Ubuntu 18.04 with PHP 7.2, MySQL 5.7, PostgreSQL 10.4 (PostGIS 2.4) and SQLite 3.22 - (Docker) Debian 10 with PHP 7.3, MariaDB 10.3, PostgreSQL 11.4 (PostGIS 2.5) and SQLite 3.27 - (Docker) Ubuntu 20.04 with PHP 7.4, MySQL 8.0, PostgreSQL 12.2 (PostGIS 3.0) and SQLite 3.31 - - (Docker) CentOS 8 with PHP 7.4, MariaDB 10.5, PostgreSQL 12.5 (PostGIS 3.0) and SQLite 3.26 + - (Docker) CentOS 8 with PHP 8.0, MariaDB 10.5, PostgreSQL 12.5 (PostGIS 3.0) and SQLite 3.26 This covers not all environments (yet), so please notify me of failing tests and report your environment. I will try to cover most relevant setups in the "docker" folder of the project.