-
Notifications
You must be signed in to change notification settings - Fork 138
Expand file tree
/
Copy pathgenerate_dma.php
More file actions
26 lines (21 loc) · 838 Bytes
/
generate_dma.php
File metadata and controls
26 lines (21 loc) · 838 Bytes
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
<?php
/**
* A very simple script in charge of generating the DMA configuration based on environment variables.
* The script is run on each start of the container.
*/
require __DIR__.'/utils.php';
$found = false;
foreach ($_SERVER as $key => $value) {
if (strpos($key, 'DMA_') === 0) {
$found = true;
}
if (strpos($key, 'DMA_CONF_') === 0) {
$suffix = substr($key, 9);
echo $suffix." ".$value."\n";
}
}
if (($found === true) && !file_exists('/usr/sbin/dma')) {
// Let's check DMA is installed (it could be not installed is we are using the slim version...)
error_log('DMA is not available in this image. If you are using the thecodingmachine/php "slim" variant, do not forget to add "ARG INSTALL_DMA=1" in your Dockerfile. Check the documentation for more details.');
exit(1);
}