105105if (file_exists ('UUID.php ' ) && PHP_VERSION >= '5.0.0 ' ) {
106106 @include_once ("php-uuid.inc " );
107107}
108- if (file_exists ('kvstorage-mem.inc ' ) && PHP_VERSION >= '5.0.0 ' ) {
108+ if ( PHP_VERSION >= '5.0.0 ' ) {
109+
110+ if (file_exists ('kvstorage-mem.inc ' )) {
109111 @include_once ("kv-memory.inc " );
110112}
113+ if (file_exists ('kvstorage-xcache.inc ' ) && extension_loaded ('xCache ' )) {
114+ @include_once ("kv-xcache.inc " );
115+ }
116+ }// php>=5.0
117+
111118if (extension_loaded ('uuid ' )) {
112119 @include_once ("mod-uuid.inc " );
113120}
@@ -778,6 +785,7 @@ function gethostname() {
778785 '38_01_php_uuid ' => 1000000 ,
779786 '38_02_mod_uuid ' => 1000000 ,
780787 '39_01_kvstorage_memory ' => 1000000 ,
788+ '39_02_kvstorage_xcache ' => 1000000 ,
781789);
782790// Should not be more than X Mb
783791// Different PHP could use different amount of memory
@@ -837,6 +845,7 @@ function gethostname() {
837845 '38_01_php_uuid ' => 4 ,
838846 '38_02_mod_uuid ' => 4 ,
839847 '39_01_kvstorage_memory ' => 4 ,
848+ '39_02_kvstorage_xcache ' => 4 ,
840849);
841850
842851/** ---------------------------------- Common functions -------------------------------------------- */
@@ -1522,18 +1531,18 @@ function format_result_test($diffSeconds, $opCount, $memory = 0)
15221531// fiter in tests
15231532function filter_in_name_by_pattern ($ key )
15241533{
1525- global $ runTests , $ debugMode , $ availableFunctions ;
1534+ global $ selectedTests , $ debugMode , $ availableFunctions ;
15261535 $ var = $ availableFunctions [$ key ];
15271536 $ ret = 0 ;
1528- foreach ($ runTests as $ pattern ){
1537+ foreach ($ selectedTests as $ pattern ){
15291538 // simple test - str in name
15301539 $ c =strpos ($ var ,$ pattern );
15311540 if ($ debugMode ) {
15321541 $ d =var_export ($ c ,true );
15331542 print ("Search ' $ pattern' inside ' $ var': $ d \n" );
15341543 }
15351544 if ($ c !==false ) {
1536- $ ret = 0 ;
1545+ $ ret = 1 ;
15371546 break ;
15381547 };
15391548 }
@@ -1565,7 +1574,7 @@ function filter_out_name_by_pattern($key)
15651574 if (!$ ret ) unset($ availableFunctions [$ key ]);
15661575 return $ ret ;
15671576}
1568- if ($ runTests ) array_filter ($ availableFunctions , "filter_in_name_by_pattern " ,ARRAY_FILTER_USE_KEY );
1577+ if ($ selectedTests ) array_filter ($ availableFunctions , "filter_in_name_by_pattern " ,ARRAY_FILTER_USE_KEY );
15691578if ($ skipTests ) array_filter ($ availableFunctions , "filter_out_name_by_pattern " ,ARRAY_FILTER_USE_KEY );
15701579/** ------------------------------- Early checks ------------------------------- */
15711580
@@ -1617,7 +1626,7 @@ function filter_out_name_by_pattern($key)
16171626 $ has_json = "{$ colorRed }no {$ colorReset }" ;
16181627 if ($ printJson ) {
16191628 print_pre ("{$ colorRed }<<< ERROR >>> {$ colorReset } Extension 'json' is mandatory for JSON output! " );
1620- print ("\"messages_count \": {$ messagesCnt }, \n" );
1629+ print ("\"messag0es_count \": {$ messagesCnt }, \n" );
16211630 print ("\"end \":true \n} " . PHP_EOL );
16221631 exit (-1 );
16231632 }
@@ -1631,7 +1640,7 @@ function filter_out_name_by_pattern($key)
16311640if (extension_loaded ('Zend OPcache ' )) {
16321641 $ has_opcache = "{$ colorYellow }yes {$ colorReset }" ;
16331642}
1634- $ has_xcache = "{$ colorGreen }no {$ colorReset }" ;
1643+ $ has_xcache = "{$ colorYellow }no {$ colorReset }" ;
16351644if (extension_loaded ('XCache ' )) {
16361645 $ has_xcache = "{$ colorYellow }yes {$ colorReset }" ;
16371646}
@@ -1814,11 +1823,11 @@ function print_results_common()
18141823 foreach ($ availableFunctions as $ user ) {
18151824 if (strpos ($ user , 'test_ ' ) === 0 ) {
18161825 $ testName = str_replace ('test_ ' , '' , $ user );
1817- if ($ runOnlySelectedTests ) {
1826+ /* if ($runOnlySelectedTests) {
18181827 if (!in_array($testName, $selectedTests)) {
18191828 continue;
18201829 }
1821- }
1830+ }*/
18221831 echo str_pad ($ testName , $ padLabel ) . " : " ;
18231832 list ($ resultSec , $ resultSecFmt , $ resultOps , $ resultOpMhz , $ memory ) = $ user ();
18241833 $ total += $ resultSec ;
0 commit comments