Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 87fcee6

Browse files
Update kvstorages, changelog, debug+error output
1 parent e5a8808 commit 87fcee6

File tree

7 files changed

+25
-14
lines changed

7 files changed

+25
-14
lines changed

‎CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
@ 2025年06月02日, v1.0.61
44

5-
* Added simple key-value tests and xcache, apcu, shmop
5+
* Added simple key-value tests:memory and xcache, apcu, shmop, memcache, redis
66
* Test selected-run by pattern now not exact name
77

88
@ 2025年05月30日, v1.0.60

‎bench.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -589,14 +589,19 @@ function gethostname() {
589589
$tz = ini_get('date.timezone');
590590
if (!$tz) ini_set('date.timezone', 'Europe/Moscow');
591591

592-
ini_set('display_errors', 0);
593592
@ini_set('error_log', null);
594593
ini_set('implicit_flush', 1);
595594
ini_set('output_buffering', 0);
596595
ob_implicit_flush(1);
597596

598-
// Disable explicit error reporting
599-
error_reporting(E_ERROR | E_WARNING | E_PARSE);
597+
if ($debugMode){
598+
ini_set('display_errors', 1);
599+
error_reporting(E_ERROR | E_WARNING | E_PARSE);
600+
} else {
601+
ini_set('display_errors', 0);
602+
// Disable explicit error reporting
603+
error_reporting(E_ERROR | E_WARNING | E_PARSE);
604+
}
600605

601606
// Check XDebug
602607
$xdebug = (int)ini_get('xdebug.default_enable');
@@ -864,8 +869,8 @@ function gethostname() {
864869
'39_02_kvstorage_xcache' => 2,
865870
'39_03_kvstorage_apcu' => 47,
866871
'39_04_kvstorage_shmop' => 70,
867-
'39_05_kvstorage_memcache' => 4,
868-
'39_06_kvstorage_redis' => 4,
872+
'39_05_kvstorage_memcache' => 47,
873+
'39_06_kvstorage_redis' => 47,
869874
);
870875

871876
/** ---------------------------------- Common functions -------------------------------------------- */

‎kv-apcu.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
function test_39_03_kvstorage_apcu()
1515
{
1616
global $testsLoopLimits, $totalOps, $emptyResult;
17+
global $debugMode;
1718

1819
if (!is_file('kvstorage-apcu.inc')){
1920
return $emptyResult;
@@ -27,6 +28,11 @@ function test_39_03_kvstorage_apcu()
2728
$count = $testsLoopLimits['39_03_kvstorage_apcu'];
2829
$time_start = get_microtime();
2930

31+
if ($debugMode) {
32+
var_dump($count);
33+
var_dump($kvstorage);
34+
}
35+
3036
for ($i = 0; $i < $count; $i++) {
3137
$num = $i / 100.;
3238
$kvstorage->set($i, $num);

‎kv-memcache.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* @since 5.0
1313
*/
14-
function test_39_04_kvstorage_memcache()
14+
function test_39_05_kvstorage_memcache()
1515
{
1616
global $testsLoopLimits, $totalOps, $emptyResult;
1717

@@ -24,7 +24,7 @@ function test_39_04_kvstorage_memcache()
2424
return $emptyResult;
2525
}
2626

27-
$count = $testsLoopLimits['39_04_kvstorage_memcache'];
27+
$count = $testsLoopLimits['39_05_kvstorage_memcache'];
2828
$time_start = get_microtime();
2929

3030
for ($i = 0; $i < $count; $i++) {

‎kv-redis.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* @since 5.0
1313
*/
14-
function test_39_05_kvstorage_redis()
14+
function test_39_06_kvstorage_redis()
1515
{
1616
global $testsLoopLimits, $totalOps, $emptyResult;
1717

@@ -24,7 +24,7 @@ function test_39_05_kvstorage_redis()
2424
return $emptyResult;
2525
}
2626

27-
$count = $testsLoopLimits['39_05_kvstorage_redis'];
27+
$count = $testsLoopLimits['39_06_kvstorage_redis'];
2828
$time_start = get_microtime();
2929

3030
for ($i = 0; $i < $count; $i++) {

‎kvstorage-memcache.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class KVStorageMemcache
1111
$this->available=true;
1212
if (!class_exists('Memcache'))
1313
$this->available=false;
14-
include('memcache.inc');
15-
$this->object=get_memcached_object();
14+
if (!function_exists('get_memcache_object')) include('memcache.inc');
15+
$this->object=get_memcache_object();
1616
}
1717

1818
public function set($key, $value, $timeout=60){

‎kvstorage-redis.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ class KVStorageRedis
1111
$this->available=true;
1212
if (!class_exists('Redis'))
1313
$this->available=false;
14-
include('redis.inc');
14+
if (!function_exists('get_redis_object')) include('redis.inc');
1515
$this->object=get_redis_object();
1616
}
1717

1818
public function set($key, $value, $timeout=60){
19-
return $this->object->set($key, $value,0, $timeout);
19+
return $this->object->set($key, $value, $timeout);
2020
}
2121

2222
public function get($key, $default=null){

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /