schneespur/vendor/thecodingmachine/safe/generated/8.1/rrd.php
Michael 2c63440ed8 Revert: move code back to project root from schneespur/ subdirectory
- Reverts the schneespur/ subdirectory restructure (b8e426b)
- Restores package.json and vite.config.js (needed for npm build, were
  removed in an earlier cleanup before the restructure)
- Updates public/build/ assets with current Vite output (new content hashes)
2026-05-17 18:24:26 +00:00

160 lines
3.1 KiB
PHP

<?php
namespace Safe;
use Safe\Exceptions\RrdException;
/**
* @param string $filename
* @param array $options
* @throws RrdException
*
*/
function rrd_create(string $filename, array $options): void
{
error_clear_last();
$safeResult = \rrd_create($filename, $options);
if ($safeResult === false) {
throw RrdException::createFromPhpError();
}
}
/**
* @param string $file
* @param int $raaindex
* @return int
* @throws RrdException
*
*/
function rrd_first(string $file, int $raaindex = 0): int
{
error_clear_last();
$safeResult = \rrd_first($file, $raaindex);
if ($safeResult === false) {
throw RrdException::createFromPhpError();
}
return $safeResult;
}
/**
* @param string $filename
* @param array $options
* @return array
* @throws RrdException
*
*/
function rrd_graph(string $filename, array $options): array
{
error_clear_last();
$safeResult = \rrd_graph($filename, $options);
if ($safeResult === false) {
throw RrdException::createFromPhpError();
}
return $safeResult;
}
/**
* @param string $filename
* @return array
* @throws RrdException
*
*/
function rrd_info(string $filename): array
{
error_clear_last();
$safeResult = \rrd_info($filename);
if ($safeResult === false) {
throw RrdException::createFromPhpError();
}
return $safeResult;
}
/**
* @param string $filename
* @return array
* @throws RrdException
*
*/
function rrd_lastupdate(string $filename): array
{
error_clear_last();
$safeResult = \rrd_lastupdate($filename);
if ($safeResult === false) {
throw RrdException::createFromPhpError();
}
return $safeResult;
}
/**
* @param string $xml_file
* @param string $rrd_file
* @param array $options
* @throws RrdException
*
*/
function rrd_restore(string $xml_file, string $rrd_file, ?array $options = null): void
{
error_clear_last();
if ($options !== null) {
$safeResult = \rrd_restore($xml_file, $rrd_file, $options);
} else {
$safeResult = \rrd_restore($xml_file, $rrd_file);
}
if ($safeResult === false) {
throw RrdException::createFromPhpError();
}
}
/**
* @param string $filename
* @param array $options
* @throws RrdException
*
*/
function rrd_tune(string $filename, array $options): void
{
error_clear_last();
$safeResult = \rrd_tune($filename, $options);
if ($safeResult === false) {
throw RrdException::createFromPhpError();
}
}
/**
* @param string $filename
* @param array $options
* @throws RrdException
*
*/
function rrd_update(string $filename, array $options): void
{
error_clear_last();
$safeResult = \rrd_update($filename, $options);
if ($safeResult === false) {
throw RrdException::createFromPhpError();
}
}
/**
* @param array $options
* @return array
* @throws RrdException
*
*/
function rrd_xport(array $options): array
{
error_clear_last();
$safeResult = \rrd_xport($options);
if ($safeResult === false) {
throw RrdException::createFromPhpError();
}
return $safeResult;
}