10
10
# Author : Sergey Dryabzhinsky #
11
11
# Company : Rusoft Ltd, Russia #
12
12
# Date : Jun 7, 2025 #
13
- # Version : 1.0.65 #
13
+ # Version : 1.0.66-dev #
14
14
# License : Creative Commons CC-BY license #
15
15
# Website : https://github.com/rusoft/php-simple-benchmark-script #
16
16
# Website : https://gitea.rusoft.ru/open-source/php-simple-benchmark-script #
20
20
21
21
include_once ("php-options.php " );
22
22
23
- $ scriptVersion = '1.0.65 ' ;
23
+ $ scriptVersion = '1.0.66-dev ' ;
24
24
25
25
// Special string to flush buffers, nginx for example
26
26
$ flushStr = '<!-- ' .str_repeat (" " , 8192 ).' --> ' ;
134
134
if (file_exists ('kvstorage-redis.inc ' ) && extension_loaded ('redis ' )) {
135
135
@include_once ("kv-redis.inc " );
136
136
}
137
+ if (file_exists ('kvstorage-pgsql.inc ' ) && extension_loaded ('pgsql ' )) {
138
+ @include_once ("kv-pgsql.inc " );
139
+ }
140
+ if (file_exists ('kvstorage-mysql.inc ' ) && extension_loaded ('mysql ' )) {
141
+ @include_once ("kv-mysql-myisam.inc " );
142
+ @include_once ("kv-mysql-innodb.inc " );
143
+ @include_once ("kv-mysql-memory.inc " );
144
+ }
145
+ if (file_exists ('kvstorage-mysqli.inc ' ) && extension_loaded ('mysqli ' )) {
146
+ @include_once ("kv-mysqli-myisam.inc " );
147
+ @include_once ("kv-mysqli-innodb.inc " );
148
+ @include_once ("kv-mysqli-memory.inc " );
149
+ }
137
150
}// php>=5.0
138
151
if ( PHP_VERSION >= '5.3.0 ' ) {
139
152
if (file_exists ('kvstorage-sqlite3.inc ' ) && extension_loaded ('sqlite3 ' )) {
@@ -846,6 +859,13 @@ function gethostname() {
846
859
'42_ctype_isdigit ' => 10000000 ,
847
860
'43_iconv_translit ' => 10000000 ,
848
861
'44_session_time ' => 100000 ,
862
+ '45_01_kvs_mysql_myisam ' => 1000000 ,
863
+ '45_02_kvs_mysql_innodb ' => 1000000 ,
864
+ '45_03_kvs_mysql_memory ' => 1000000 ,
865
+ '46_01_kvs_mysqli_myisam ' => 1000000 ,
866
+ '46_02_kvs_mysqli_innodb ' => 1000000 ,
867
+ '46_03_kvs_mysqli_memory ' => 1000000 ,
868
+ '47_kvs_pgsql ' => 100000 ,
849
869
);
850
870
// Should not be more than X Mb
851
871
// Different PHP could use different amount of memory
@@ -923,6 +943,13 @@ function gethostname() {
923
943
'42_ctype_isdigit ' => 4 ,
924
944
'43_iconv_translit ' => 4 ,
925
945
'44_session_time ' => 4 ,
946
+ '45_01_kvs_mysql_myisam ' => 4 ,
947
+ '45_02_kvs_mysql_innodb ' => 4 ,
948
+ '45_03_kvs_mysql_memory ' => 4 ,
949
+ '46_01_kvs_mysqli_myisam ' => 4 ,
950
+ '46_02_kvs_mysqli_innodb ' => 4 ,
951
+ '46_03_kvs_mysqli_memory ' => 4 ,
952
+ '47_kvs_pgsql ' => 4 ,
926
953
);
927
954
928
955
/** ---------------------------------- Common functions -------------------------------------------- */
@@ -1753,6 +1780,30 @@ function filter_out_name_by_pattern($key)
1753
1780
if ($ v ) define ('REDIS_VERSION ' ,$ v );
1754
1781
else define ('REDIS_VERSION ' ,'-.-.- ' );
1755
1782
}
1783
+ $ has_mysql = "{$ colorYellow }no {$ colorReset }" ;
1784
+ if (extension_loaded ('mysql ' )) {
1785
+ $ has_mysql = "{$ colorGreen }yes {$ colorReset }" ;
1786
+ include_once ('mysql.inc ' );
1787
+ $ v =get_mysql_version ();
1788
+ if ($ v ) define ('MYSQL_VERSION ' ,$ v );
1789
+ else define ('MYSQL_VERSION ' ,'-.-.- ' );
1790
+ }
1791
+ $ has_pgsql = "{$ colorYellow }no {$ colorReset }" ;
1792
+ if (extension_loaded ('pgsql ' )) {
1793
+ $ has_pgsql = "{$ colorGreen }yes {$ colorReset }" ;
1794
+ include_once ('pgsql.inc ' );
1795
+ $ v =get_pgsql_version ();
1796
+ if ($ v ) define ('PGSQL_VERSION ' ,$ v );
1797
+ else define ('PGSQL_VERSION ' ,'-.-.- ' );
1798
+ }
1799
+ $ has_mysqli = "{$ colorYellow }no {$ colorReset }" ;
1800
+ if (extension_loaded ('mysqli ' )) {
1801
+ $ has_mysqli = "{$ colorGreen }yes {$ colorReset }" ;
1802
+ include_once ('mysqli.inc ' );
1803
+ $ v =get_mysqli_version ();
1804
+ if ($ v ) define ('MYSQLI_VERSION ' ,$ v );
1805
+ else define ('MYSQLI_VERSION ' ,'-.-.- ' );
1806
+ }
1756
1807
$ has_sqlite3 = "{$ colorYellow }no {$ colorReset }" ;
1757
1808
if (extension_loaded ('sqlite3 ' )) {
1758
1809
$ has_sqlite3 = "{$ colorGreen }yes {$ colorReset }" ;
@@ -1886,6 +1937,8 @@ function filter_out_name_by_pattern($key)
1886
1937
if (!defined ('MEMCACHE_VERSION ' )) define ('MEMCACHE_VERSION ' , '-.-.- ' );
1887
1938
if (!defined ('REDIS_VERSION ' )) define ('REDIS_VERSION ' , '-.-.- ' );
1888
1939
if (!defined ('SQLITE3_VERSION ' )) define ('SQLITE3_VERSION ' , '-.-.- ' );
1940
+ if (!defined ('MYSQL_VERSION ' )) define ('MYSQL_VERSION ' , '-.-.- ' );
1941
+ if (!defined ('MYSQLI_VERSION ' )) define ('MYSQLI_VERSION ' , '-.-.- ' );
1889
1942
if (!defined ('LIBXML_DOTTED_VERSION ' )) define ('LIBXML_DOTTED_VERSION ' , '-.-.- ' );
1890
1943
if (!defined ('SODIUM_LIBRARY_VERSION ' )) define ('SODIUM_LIBRARY_VERSION ' , '-.-.- ' );
1891
1944
if (!defined ('INTL_ICU_VERSION ' )) define ('INTL_ICU_VERSION ' , '-.- ' );
@@ -1901,7 +1954,7 @@ function print_results_common()
1901
1954
global $ has_gd , $ has_gdgif , $ has_gdpng , $ has_gdjpg , $ has_gdwebp , $ has_gdavif ;
1902
1955
global $ has_imagick , $ has_igb , $ has_msg , $ has_jsond , $ has_jsond_as_json , $ has_ctype , $ has_iconv , $ has_session ;
1903
1956
global $ has_zlib , $ has_uuid , $ has_gzip , $ has_bz2 , $ has_lz4 , $ has_snappy , $ has_zstd , $ has_brotli ;
1904
- global $ has_apcu , $ has_shmop , $ has_memcache , $ has_redis , $ has_sodium , $ has_sqlite3 , $ opcache , $ has_eacc , $ has_xdebug , $ xcache , $ apcache , $ eaccel , $ xdebug , $ xdbg_mode , $ obd_set , $ mbover ;
1957
+ global $ has_apcu , $ has_shmop , $ has_memcache , $ has_redis , $ has_mysql , $ has_pgsql , $ has_mysqli , $ has_sodium , $ has_sqlite3 , $ opcache , $ has_eacc , $ has_xdebug , $ xcache , $ apcache , $ eaccel , $ xdebug , $ xdbg_mode , $ obd_set , $ mbover ;
1905
1958
global $ showOnlySystemInfo , $ padLabel , $ functions , $ runOnlySelectedTests , $ selectedTests , $ totalOps ;
1906
1959
global $ colorGreen , $ colorReset , $ colorRed ;
1907
1960
@@ -1944,11 +1997,14 @@ function print_results_common()
1944
1997
. str_pad ("\t- JPG " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_gdjpg " ."\n"
1945
1998
. str_pad ("\t- WEBP " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_gdwebp " ."\n"
1946
1999
. str_pad ("\t- AVIF " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_gdavif " ."\n"
1947
- . str_pad ("imagick " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_imagick: version: " .IMG_VERSION ."\n"
2000
+ . str_pad ("imagick " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_imagick: version: " .IMG_VERSION ."; \n"
1948
2001
. str_pad ("apcu " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_apcu; \n"
1949
2002
. str_pad ("shmop " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_shmop \n"
1950
2003
. str_pad ("memcache " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_memcache, version: " .MEMCACHE_VERSION ."; \n"
1951
2004
. str_pad ("redis " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_redis, version: " .REDIS_VERSION ."; \n"
2005
+ . str_pad ("mysql " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_mysql, version: " .MYSQL_VERSION ."; \n"
2006
+ . str_pad ("pgsql " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_pgsql, version: " .PGSQL_VERSION ."; \n"
2007
+ . str_pad ("mysqli " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_mysqli, version: " .MYSQLI_VERSION ."; \n"
1952
2008
. str_pad ("sqlite3 " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_sqlite3, version: " .SQLITE3_VERSION ."; \n"
1953
2009
. str_pad ("sodium " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_sodium, version: " .SODIUM_LIBRARY_VERSION ."; \n"
1954
2010
. str_pad ("-alternative-> " , $ padInfo , ' ' , STR_PAD_LEFT ) . "\n"
0 commit comments