| 1 |
<?php |
| 2 |
|
| 3 |
namespace Safe; |
| 4 |
|
| 5 |
use Safe\Exceptions\RrdException; |
| 6 |
|
| 7 |
/** |
| 8 |
* Creates the rdd database file. |
| 9 |
* |
| 10 |
* @param string $filename Filename for newly created rrd file. |
| 11 |
* @param array $options Options for rrd create - list of strings. See man page of rrd create |
| 12 |
* for whole list of options. |
| 13 |
* @throws RrdException |
| 14 |
* |
| 15 |
*/ |
| 16 |
function rrd_create(string $filename, array $options): void |
| 17 |
{ |
| 18 |
error_clear_last(); |
| 19 |
$result = \rrd_create($filename, $options); |
| 20 |
if ($result === false) { |
| 21 |
throw RrdException::createFromPhpError(); |
| 22 |
} |
| 23 |
} |
| 24 |
|