Skip to content

Commit ddd470e

Browse files
Версия 1.0.19:
- попытка выключить буферизацию вывода - заголовок для nginx для выключения буферизации - не подключаем 18-ы тест, если нет файла php5.inc
1 parent 733db4e commit ddd470e

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,15 @@ env PHP_MEMORY_LIMIT=64 PHP_TIME_LIMIT=30 php bench.php
5656

5757
## ChangeLog
5858

59+
@ 2017-05-18, v1.0.19
60+
61+
* Попытка принудительно включить небуферизированный вывод
62+
* Спец-заголовок для nginx для отключения буферизации
63+
* Возможность загрузить основные тесты без файла php5.inc с тестом try/Exception/catch
64+
5965
@ 2017-05-18, v1.0.18
6066

61-
* Проверка на совместимую версию ph
67+
* Проверка на совместимую версию php
6268
* Получение значений для настроек php - `max_execution_time` и `memory_limit` - из
6369
GET / getenv / getopt.
6470

bench.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
# Author : Sergey Dryabzhinsky #
1111
# Company : Rusoft Ltd, Russia #
1212
# Date : May 18, 2017 #
13-
# version : 1.0.18 #
13+
# version : 1.0.19 #
1414
# License : Creative Commons CC-BY license #
1515
# Website : https://github.com/rusoft/php-simple-benchmark-script #
1616
# Website : https://git.rusoft.ru/open-source/php-simple-benchmark-script #
1717
# #
1818
################################################################################
1919
*/
2020

21-
$scriptVersion = '1.0.18';
21+
$scriptVersion = '1.0.19';
2222

2323
// Used in hacks/fixes checks
2424
$phpversion = explode('.', PHP_VERSION);
@@ -125,6 +125,14 @@
125125
set_time_limit($defaultTimeLimit);
126126
@ini_set('memory_limit', $defaultMemoryLimit . 'M');
127127

128+
// Force output flushing, like in CLI
129+
// May help with proxy-pass apache-nginx
130+
@ini_set('output_buffering', 0);
131+
@ini_set('implicit_flush', 1);
132+
ob_implicit_flush(1);
133+
// Special for nginx
134+
header('X-Accel-Buffering: no');
135+
128136
/** ------------------------------- Main Constants ------------------------------- */
129137

130138
$line = str_pad("-", 91, "-");
@@ -938,7 +946,11 @@ function test_17_2_Loop_Undefined_Access()
938946
}
939947

940948
if ((int)$phpversion[0] >= 5) {
941-
include_once 'php5.inc';
949+
if (is_file('php5.inc')) {
950+
include_once 'php5.inc';
951+
} else {
952+
print("<pre>\n<<< WARNING >>>\nMissing file 'php5.inc' with try/Exception/catch loop test!\n It matters only for php version 5+.\n</pre>");
953+
}
942954
}
943955

944956
/** ---------------------------------- Common code -------------------------------------------- */

php5.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?php
22

3+
/**
4+
* Special test only for php 5+.
5+
* php 4.x can't compile try construction.
6+
*/
37
function test_18_Loop_ExceptionTryCatch()
48
{
59
global $testsLoopLimits;

0 commit comments

Comments
 (0)