Skip to content

Commit d34400b

Browse files
committed
update
1 parent 2ea514b commit d34400b

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,7 @@ I am testing mainly on Ubuntu and I have the following test setups:
14871487
- (Docker) CentOS 8 with PHP 8.1, MariaDB 10.7, PostgreSQL 12.10 (PostGIS 3.0) and SQLite 3.26
14881488
- (Docker) Debian 11 with PHP 7.4, MariaDB 10.5, PostgreSQL 13.4 (PostGIS 3.1) and SQLite 3.34
14891489
- (Docker) Ubuntu 22.04 with PHP 8.1, MySQL 8.0, PostgreSQL 14.2 (PostGIS 3.2) and SQLite 3.37
1490+
- (Docker) Debian 12 with PHP 8.2, MariaDB 10.11, PostgreSQL 15.3 (PostGIS 3.3) and SQLite 3.40
14901491

14911492
This covers not all environments (yet), so please notify me of failing tests and report your environment.
14921493
I will try to cover most relevant setups in the "docker" folder of the project.

docker/debian12/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM debian:12
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
# install: php / mysql / postgres / sqlite / tools / mssql deps
6+
RUN apt-get update && apt-get -y install \
7+
php-cli php-xml php-mbstring \
8+
mariadb-server mariadb-client php-mysql \
9+
postgresql php-pgsql \
10+
postgresql-15-postgis-3 \
11+
sqlite3 php-sqlite3 \
12+
git wget
13+
14+
# install run script
15+
ADD run.sh /usr/sbin/docker-run
16+
CMD docker-run

docker/debian12/run.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
echo "================================================"
3+
echo " Debian 12 (PHP 8.2)"
4+
echo "================================================"
5+
6+
echo -n "[1/4] Starting MariaDB 10.11 .... "
7+
# make sure mysql can create socket and lock
8+
mkdir /var/run/mysqld && chmod 777 /var/run/mysqld
9+
# run mysql server
10+
nohup mysqld --user=root > /root/mysql.log 2>&1 &
11+
# wait for mysql to become available
12+
while ! mysqladmin ping -hlocalhost >/dev/null 2>&1; do
13+
sleep 1
14+
done
15+
# create database and user on mysql
16+
mysql -u root >/dev/null << 'EOF'
17+
CREATE DATABASE `php-crud-api` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
18+
CREATE USER 'php-crud-api'@'localhost' IDENTIFIED BY 'php-crud-api';
19+
GRANT ALL PRIVILEGES ON `php-crud-api`.* TO 'php-crud-api'@'localhost' WITH GRANT OPTION;
20+
FLUSH PRIVILEGES;
21+
EOF
22+
echo "done"
23+
24+
echo -n "[2/4] Starting PostgreSQL 15.3 .. "
25+
# run postgres server
26+
nohup su - -c "/usr/lib/postgresql/15/bin/postgres -D /etc/postgresql/15/main" postgres > /root/postgres.log 2>&1 &
27+
# wait for postgres to become available
28+
until su - -c "psql -U postgres -c '\q'" postgres >/dev/null 2>&1; do
29+
sleep 1;
30+
done
31+
# create database and user on postgres
32+
su - -c "psql -U postgres >/dev/null" postgres << 'EOF'
33+
CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
34+
CREATE DATABASE "php-crud-api";
35+
GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" to "php-crud-api";
36+
\c "php-crud-api";
37+
CREATE EXTENSION IF NOT EXISTS postgis;
38+
\q
39+
EOF
40+
echo "done"
41+
42+
echo -n "[3/4] Starting SQLServer 2019 ... "
43+
echo "skipped"
44+
45+
echo -n "[4/4] Cloning PHP-CRUD-API v2 ... "
46+
# install software
47+
if [ -d /php-crud-api ]; then
48+
echo "skipped"
49+
else
50+
git clone --quiet https://github.com/mevdschee/php-crud-api.git
51+
echo "done"
52+
fi
53+
54+
echo "------------------------------------------------"
55+
56+
# run the tests
57+
cd php-crud-api
58+
php test.php

0 commit comments

Comments
 (0)