@@ -1547,6 +1547,7 @@ I am testing mainly on Ubuntu and I have the following test setups:
15471547 - (Docker) Ubuntu 18.04 with PHP 7.2, MySQL 5.7, PostgreSQL 10.4 (PostGIS 2.4) and SQLite 3.22
15481548 - (Docker) Ubuntu 20.04 with PHP 7.4, MySQL 8.0, PostgreSQL 12.15 (PostGIS 3.0) and SQLite 3.31 and SQL Server 2019
15491549 - (Docker) Ubuntu 22.04 with PHP 8.1, MySQL 8.0, PostgreSQL 14.2 (PostGIS 3.2) and SQLite 3.37
1550+ - (Docker) Ubuntu 24.04 with PHP 8.3, MySQL 8.0, PostgreSQL 16.2 (PostGIS 3.4) and SQLite 3.45
15501551
15511552This covers not all environments (yet), so please notify me of failing tests and report your environment.
15521553I will try to cover most relevant setups in the "docker" folder of the project.
@@ -1561,7 +1562,26 @@ To run the functional tests locally you may run the following commands:
15611562This runs the functional tests from the "tests" directory. It uses the database dumps (fixtures) and
15621563database configuration (config) from the corresponding subdirectories.
15631564
1564- ## Nginx config example
1565+ ## Pretty URL
1566+
1567+ You may "rewrite" the URL to remove the "api.php" from the URL.
1568+
1569+ ### Apache config example
1570+
1571+ Enable mod_rewrite and add the following to your ".htaccess" file:
1572+
1573+ ```
1574+ RewriteEngine On
1575+ RewriteCond %{REQUEST_FILENAME} !-d
1576+ RewriteCond %{REQUEST_FILENAME} !-f
1577+ RewriteRule ^(.*)$ api.php/$1 [L,QSA]
1578+ ```
1579+
1580+ The ".htaccess" file needs to go in the same folder as "api.php".
1581+
1582+ ### Nginx config example
1583+
1584+ Use the following config to serve the API under Nginx and PHP-FPM:
15651585
15661586```
15671587server {
@@ -1596,7 +1616,7 @@ server {
15961616
15971617Install docker using the following commands and then logout and login for the changes to take effect:
15981618
1599- sudo apt install docker.io
1619+ sudo apt install docker.io docker-buildx
16001620 sudo usermod -aG docker ${USER}
16011621
16021622To run the docker tests run "build_all.sh" and "run_all.sh" from the docker directory. The output should be:
@@ -1609,10 +1629,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
16091629 [3/4] Starting SQLServer 2017 ... skipped
16101630 [4/4] Cloning PHP-CRUD-API v2 ... skipped
16111631 ------------------------------------------------
1612- mysql: 120 tests ran in 3279 ms, 1 skipped, 0 failed
1613- pgsql: 120 tests ran in 1802 ms, 1 skipped, 0 failed
1632+ mysql: 120 tests ran in 921 ms, 1 skipped, 0 failed
1633+ pgsql: 120 tests ran in 1058 ms, 1 skipped, 0 failed
16141634 sqlsrv: skipped, driver not loaded
1615- sqlite: 120 tests ran in 1720 ms, 13 skipped, 0 failed
1635+ sqlite: 120 tests ran in 752 ms, 13 skipped, 0 failed
16161636 ================================================
16171637 Debian 11 (PHP 7.4)
16181638 ================================================
@@ -1621,10 +1641,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
16211641 [3/4] Starting SQLServer 2017 ... skipped
16221642 [4/4] Cloning PHP-CRUD-API v2 ... skipped
16231643 ------------------------------------------------
1624- mysql: 120 tests ran in 2761 ms, 1 skipped, 0 failed
1625- pgsql: 120 tests ran in 2263 ms, 1 skipped, 0 failed
1644+ mysql: 120 tests ran in 914 ms, 1 skipped, 0 failed
1645+ pgsql: 120 tests ran in 997 ms, 1 skipped, 0 failed
16261646 sqlsrv: skipped, driver not loaded
1627- sqlite: 120 tests ran in 1860 ms, 13 skipped, 0 failed
1647+ sqlite: 120 tests ran in 735 ms, 13 skipped, 0 failed
16281648 ================================================
16291649 Debian 12 (PHP 8.2)
16301650 ================================================
@@ -1633,10 +1653,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
16331653 [3/4] Starting SQLServer 2019 ... skipped
16341654 [4/4] Cloning PHP-CRUD-API v2 ... skipped
16351655 ------------------------------------------------
1636- mysql: 120 tests ran in 3106 ms, 1 skipped, 0 failed
1637- pgsql: 120 tests ran in 1863 ms, 1 skipped, 0 failed
1656+ mysql: 120 tests ran in 1016 ms, 1 skipped, 0 failed
1657+ pgsql: 120 tests ran in 1041 ms, 1 skipped, 0 failed
16381658 sqlsrv: skipped, driver not loaded
1639- sqlite: 120 tests ran in 1649 ms, 13 skipped, 0 failed
1659+ sqlite: 120 tests ran in 733 ms, 13 skipped, 0 failed
16401660 ================================================
16411661 RockyLinux 8 (PHP 7.2)
16421662 ================================================
@@ -1645,10 +1665,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
16451665 [3/4] Starting SQLServer 2017 ... skipped
16461666 [4/4] Cloning PHP-CRUD-API v2 ... skipped
16471667 ------------------------------------------------
1648- mysql: 120 tests ran in 3248 ms, 1 skipped, 0 failed
1668+ mysql: 120 tests ran in 935 ms, 1 skipped, 0 failed
16491669 pgsql: skipped, driver not loaded
16501670 sqlsrv: skipped, driver not loaded
1651- sqlite: 120 tests ran in 1745 ms, 13 skipped, 0 failed
1671+ sqlite: 120 tests ran in 746 ms, 13 skipped, 0 failed
16521672 ================================================
16531673 RockyLinux 9 (PHP 8.0)
16541674 ================================================
@@ -1657,10 +1677,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
16571677 [3/4] Starting SQLServer 2017 ... skipped
16581678 [4/4] Cloning PHP-CRUD-API v2 ... skipped
16591679 ------------------------------------------------
1660- mysql: 120 tests ran in 2945 ms, 1 skipped, 0 failed
1680+ mysql: 120 tests ran in 928 ms, 1 skipped, 0 failed
16611681 pgsql: skipped, driver not loaded
16621682 sqlsrv: skipped, driver not loaded
1663- sqlite: 120 tests ran in 1657 ms, 13 skipped, 0 failed
1683+ sqlite: 120 tests ran in 728 ms, 13 skipped, 0 failed
16641684 ================================================
16651685 Ubuntu 18.04 (PHP 7.2)
16661686 ================================================
@@ -1669,10 +1689,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
16691689 [3/4] Starting SQLServer 2017 ... skipped
16701690 [4/4] Cloning PHP-CRUD-API v2 ... skipped
16711691 ------------------------------------------------
1672- mysql: 120 tests ran in 4151 ms, 1 skipped, 0 failed
1673- pgsql: 120 tests ran in 1798 ms, 1 skipped, 0 failed
1692+ mysql: 120 tests ran in 1296 ms, 1 skipped, 0 failed
1693+ pgsql: 120 tests ran in 1056 ms, 1 skipped, 0 failed
16741694 sqlsrv: skipped, driver not loaded
1675- sqlite: 120 tests ran in 1906 ms, 13 skipped, 0 failed
1695+ sqlite: 120 tests ran in 772 ms, 13 skipped, 0 failed
16761696 ================================================
16771697 Ubuntu 20.04 (PHP 7.4)
16781698 ================================================
@@ -1681,10 +1701,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
16811701 [3/4] Starting SQLServer 2019 ... done
16821702 [4/4] Cloning PHP-CRUD-API v2 ... skipped
16831703 ------------------------------------------------
1684- mysql: 120 tests ran in 6480 ms, 1 skipped, 0 failed
1685- pgsql: 120 tests ran in 2415 ms, 1 skipped, 0 failed
1686- sqlsrv: 120 tests ran in 14517 ms, 1 skipped, 0 failed
1687- sqlite: 120 tests ran in 1694 ms, 13 skipped, 0 failed
1704+ mysql: 120 tests ran in 1375 ms, 1 skipped, 0 failed
1705+ pgsql: 120 tests ran in 868 ms, 1 skipped, 0 failed
1706+ sqlsrv: 120 tests ran in 5713 ms, 1 skipped, 0 failed
1707+ sqlite: 120 tests ran in 733 ms, 13 skipped, 0 failed
16881708 ================================================
16891709 Ubuntu 22.04 (PHP 8.1)
16901710 ================================================
@@ -1693,10 +1713,22 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
16931713 [3/4] Starting SQLServer 2019 ... skipped
16941714 [4/4] Cloning PHP-CRUD-API v2 ... skipped
16951715 ------------------------------------------------
1696- mysql: 120 tests ran in 5951 ms, 1 skipped, 0 failed
1697- pgsql: 120 tests ran in 1951 ms, 1 skipped, 0 failed
1716+ mysql: 120 tests ran in 1372 ms, 1 skipped, 0 failed
1717+ pgsql: 120 tests ran in 1064 ms, 1 skipped, 0 failed
1718+ sqlsrv: skipped, driver not loaded
1719+ sqlite: 120 tests ran in 727 ms, 13 skipped, 0 failed
1720+ ================================================
1721+ Ubuntu 24.04 (PHP 8.3)
1722+ ================================================
1723+ [1/4] Starting MySQL 8. ........ done
1724+ [2/4] Starting PostgreSQL 16.2 .. done
1725+ [3/4] Starting SQLServer 2019 ... skipped
1726+ [4/4] Cloning PHP-CRUD-API v2 ... skipped
1727+ ------------------------------------------------
1728+ mysql: 120 tests ran in 1344 ms, 1 skipped, 0 failed
1729+ pgsql: 120 tests ran in 856 ms, 1 skipped, 0 failed
16981730 sqlsrv: skipped, driver not loaded
1699- sqlite: 120 tests ran in 1923 ms, 13 skipped, 0 failed
1731+ sqlite: 120 tests ran in 722 ms, 13 skipped, 0 failed
17001732
17011733The above test run (including starting up the databases) takes less than 5 minutes on my slow laptop.
17021734
@@ -1718,10 +1750,10 @@ The above test run (including starting up the databases) takes less than 5 minut
17181750 [3/4] Starting SQLServer 2017 ... skipped
17191751 [4/4] Cloning PHP-CRUD-API v2 ... skipped
17201752 ------------------------------------------------
1721- mysql: 120 tests ran in 4151 ms, 1 skipped, 0 failed
1722- pgsql: 120 tests ran in 1798 ms, 1 skipped, 0 failed
1753+ mysql: 120 tests ran in 1296 ms, 1 skipped, 0 failed
1754+ pgsql: 120 tests ran in 1056 ms, 1 skipped, 0 failed
17231755 sqlsrv: skipped, driver not loaded
1724- sqlite: 120 tests ran in 1906 ms, 13 skipped, 0 failed
1756+ sqlite: 120 tests ran in 772 ms, 13 skipped, 0 failed
17251757 root@b7ab9472e08f:/php-crud-api#
17261758
17271759As you can see the "run.sh" script gives you access to a prompt in the chosen docker environment.
0 commit comments