This repository has been archived by the owner on Apr 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.dist.php
42 lines (37 loc) · 1.99 KB
/
config.dist.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php declare(strict_types = 1);
function get_env_array(string $name, array $default) {
return array_map(
function (string $str) { return trim($str); },
isset($_SERVER[$name]) ? explode(',', $_SERVER[$name]) : $default
);
}
function get_env_integer(string $name, int $default) {
return isset($_SERVER[$name]) ? (int) $_SERVER[$name] : $default;
}
function get_env_boolean(string $name, bool $default) {
return isset($_SERVER[$name]) ? (bool) $_SERVER[$name] : $default;
}
function get_env_string(string $name, string $default) {
return isset($_SERVER[$name]) ? (string) $_SERVER[$name] : $default;
}
return [
// PhantomJS
'skipped_headers' => get_env_array('FP_SKIPPED_HEADERS', [
'content-length',
'host',
'connection',
'accept-encoding',
'x-frontend-prerenderer',
'user-agent'
]),
'allowed_domains' => get_env_array('FP_ALLOWED_DOMAINS', ['localhost']),
'delay' => get_env_integer('FP_DELAY', 0), // Chromium (0 to wait for DOM to load, recommended), PhantomJS
'timeout' => get_env_integer('FP_TIMEOUT', 0), // PhantomJS
'with_images' => get_env_boolean('FP_WITH_IMAGES', false), // Chromium, PhantomJS
'debug' => get_env_boolean('FP_DEBUG', false), // PhantomJS
'renderer' => get_env_string('FP_RENDERER', 'chromium'), // decides which browser to use (values: chromium|phantomjs)
'chromium_binary' => get_env_string('FP_CHROMIUM_BINARY', 'chromium-browser'), // Chromium (examples: chromium|chrome|chromium-browser)
'window_size' => get_env_string('FP_WINDOW_SIZE', '1920x1080'), // Chromium
'open_process_limit' => get_env_integer('FP_OPEN_PROCESS_LIMIT', 3), // Chromium
'wait_for_process_time' => get_env_integer('FP_WAIT_FOR_PROCESS_TIME', 4) // Chromium
];