Skip to content

Commit 51c2493

Browse files
committed
Requiring libs/output_data based on env var
1 parent 8316f27 commit 51c2493

File tree

37 files changed

+41
-57
lines changed

37 files changed

+41
-57
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ If you want to see current configuration, run `sudo sysctl -a`.
147147
~~~
148148
<VirtualHost *:80>
149149
DocumentRoot /home/vagrant/public
150+
SetEnv php_framework_benchmark_path /home/vagrant/public/php-framework-benchmark
150151
</VirtualHost>
151152
~~~
152153

aura-2.0/web/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
);
1717
$kernel();
1818

19-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
19+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

bear-0.10/bootstrap/contexts/prod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
//
6666
OK: {
6767
$app->response->setResource($app->page)->render()->send();
68-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
68+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';
6969
exit(0);
7070
}
7171

bear-1.0/bootstrap/bootstrap.php

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

3232
// representation transfer
3333
$page()->transfer($app->responder, $_SERVER);
34-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
34+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';
3535
exit(0);
3636
} catch (\Exception $e) {
3737
$app->error->handle($e, $request)->transfer();

cake-3.0/webroot/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@
3636
new Response()
3737
);
3838

39-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
39+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

cake-3.1/webroot/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@
3636
new Response()
3737
);
3838

39-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
39+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

ci-3.0/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,4 +291,4 @@
291291
*/
292292
require_once BASEPATH.'core/CodeIgniter.php';
293293

294-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
294+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

cygnite-1.3/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@
5959
*/
6060
require_once CF_BOOTSTRAP.DS.'start'.EXT;
6161

62-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
62+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

docker/docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ php_5_6_4:
2020
- "9000"
2121
environment:
2222
stack: 'docker_nginx_php_5_6_4'
23+
php_framework_benchmark_path: /public
2324
working_dir: '/repo'
2425
command: "/stack/php/run-php-fpm.sh"
2526

@@ -33,6 +34,7 @@ hhvm_3_10_1:
3334
- "9000"
3435
environment:
3536
stack: 'docker_nginx_hhvm_3_10_1'
37+
php_framework_benchmark_path: /public
3638
working_dir: '/repo'
3739
command: "/stack/php/run-hhvm.sh"
3840

@@ -46,6 +48,7 @@ php_7_0_0:
4648
- "9000"
4749
environment:
4850
stack: 'docker_nginx_php_7_0_0'
51+
php_framework_benchmark_path: /public
4952
working_dir: '/repo'
5053
command: "/stack/php/run-php-fpm-7.sh"
5154

fatfree-3.5/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
$f3->run();
1111

12-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
12+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

fuel-1.8-dev/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@ class_alias('Fuel\\Core\\Autoloader', 'Autoloader');
101101

102102
$response->send(true);
103103

104-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
104+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

fuel-2.0-dev/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,4 @@
159159
echo $response;
160160
}
161161

162-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
162+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

ice-1.0/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
echo $e->getMessage();
1414
}
1515

16-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
16+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

laravel-4.2/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@
4848

4949
$app->run();
5050

51-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
51+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

laravel-5.0/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@
5656

5757
$kernel->terminate($request, $response);
5858

59-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
59+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

laravel-5.1/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@
5757

5858
$kernel->terminate($request, $response);
5959

60-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
60+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

lumen-5.0/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727

2828
$app->run();
2929

30-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
30+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

lumen-5.1/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727

2828
$app->run();
2929

30-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
30+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

no-framework/index.php

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

33
echo 'Hello World!';
44

5-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
5+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

nofuss-1.2/html/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
$bootstrap->go();
3838

3939
// The if statement is needed for setup.sh
40-
if ($_SERVER['DOCUMENT_ROOT'] !== '') {
41-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
40+
if (getenv('php_framework_benchmark_path') !== '') {
41+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';
4242
}
Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,2 @@
1-
no-framework: 1606.08: 234608: 0.000233: 1
2-
phalcon-2.0: 835.00: 283120: 0.002651: 5
3-
ice-1.0: 749.81: 275680: 0.001453: 4
4-
tipsy-0.10: 988.07: 336808: 0.000606: 18
5-
fatfree-3.5: 520.58: 444136: 0.002025: 9
6-
slim-2.6: 795.92: 499872: 0.000879: 24
7-
ci-3.0: 101.58: 451376: 0.037094: 26
8-
nofuss-1.2: 344.94: 619640: 0.002954: 6
9-
slim-3.0: 498.56: 648136: 0.002141: 56
10-
bear-1.0: 215.44: 791688: 0.410931: 98
11-
lumen-5.1: 318.22: 750968: 0.006660: 32
12-
ze-1.0: 241.72: 823056: 0.009136: 64
13-
radar-1.0-dev: 259.75: 738792: 0.006119: 73
14-
yii-2.0: 313.75: 1399576: 0.006194: 49
15-
silex-1.3: 357.62: 734208: 0.001185: 58
16-
cygnite-1.3: 121.78: 779944: 0.018045: 70
17-
fuel-1.8-dev: 56.56: 730200: 0.065322: 55
18-
phpixie-3.2: 83.94: 1329712: 0.011355: 164
19-
aura-2.0: 127.48: 933160: 0.030256: 68
20-
cake-3.1: 152.83: 1383960: 0.010397: 84
21-
symfony-2.7: 70.54: 2735504: 0.017342: 103
22-
zf-2.5: 43.50: 3070136: 0.029376: 209
1+
no-framework: 1857.66: <b>Fatal error</b>: require(): Failed opening required '/libs/output_data.php' (include_path='.
2+
phalcon-2.0: 804.48: <b>Fatal error</b>: require(): Failed opening required '/libs/output_data.php' (include_path='.

phalcon-1.3/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
echo $e->getMessage();
3131
}
3232

33-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
33+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

phalcon-2.0/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
echo $e->getMessage();
3131
}
3232

33-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
33+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

phpixie-3.2/web/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
$framework->registerDebugHandlers();
77
$framework->processHttpSapiRequest();
88

9-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
9+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

radar-1.0-dev/web/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@
4646
*/
4747
$adr->run(ServerRequestFactory::fromGlobals(), new Response());
4848

49-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
49+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

silex-1.2/web/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
$app->run();
1010

11-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
11+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

silex-1.3/web/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
$app->run();
1010

11-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
11+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

slim-2.6/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010

1111
$app->run();
1212

13-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
13+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

slim-3.0/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010

1111
$app->run();
1212

13-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
13+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

symfony-2.5/web/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
$response->send();
2929
$kernel->terminate($request, $response);
3030

31-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
31+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

symfony-2.6/web/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
$response->send();
3030
$kernel->terminate($request, $response);
3131

32-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
32+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

symfony-2.7/web/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
$response->send();
3030
$kernel->terminate($request, $response);
3131

32-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
32+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

tipsy-0.10/web/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515

1616
$t->start();
1717

18-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
18+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

yii-2.0/web/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111

1212
(new yii\web\Application($config))->run();
1313

14-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
14+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

ze-1.0/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
$app = $container->get('Zend\Expressive\Application');
1818
$app->run();
1919

20-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
20+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

zf-2.4/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
// Run the application!
1717
Zend\Mvc\Application::init(require 'config/application.config.php')->run();
1818

19-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
19+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

zf-2.5/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
// Run the application!
2525
Zend\Mvc\Application::init(require 'config/application.config.php')->run();
2626

27-
require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
27+
require getenv('php_framework_benchmark_path').'/libs/output_data.php';

0 commit comments

Comments
 (0)