示例#1
0
            }
            $lastLabel = end($times);
            $count++;
        }
    }
    $first = false;
}
mysql_close();
// check
if (!$count) {
    syslog(LOG_DEBUG, "p4: No data in range " . strftime("%d. %b %Y  %H:%M", $from) . "  -  " . strftime("%d. %b %Y %H:%M", $to) . " aborting");
    return;
}
// -------------------------
// charting
if (!chkDir($cache_dir)) {
    syslog(LOG_DEBUG, "Can't create directory " . $cache_dir);
}
$data = new pData();
$cache = new pCache(array("CacheFolder" => $cache_dir));
// fill data struct
$data->addPoints($times, "Timestamps");
foreach ($series as $sensor => $serie) {
    $data->addPoints($serie, $sensor);
}
$chartHash = $cache->getHash($data);
if ($cache->isInCache($chartHash)) {
    syslog(LOG_DEBUG, "p4: got from cache");
    $cache->strokeFromCache($chartHash);
} else {
    $points = $data->getSerieCount("Timestamps");
示例#2
0
<?php

include "functions.php";
chkDir("/home/wendel/test-php");
示例#3
0
文件: ctrl.php 项目: simpart/trut
 */
namespace ini;

/*** require ***/
require_once __DIR__ . '/../com/loader/class.php';
require_once __DIR__ . '/param.php';
require_once __DIR__ . '/genShell.php';
try {
    $prm = getParam($argv);
    if (0 === strcmp('-h', $prm)) {
        /* display help of install.sh, if specified '-h' option */
        showHelp();
        return;
    }
    /* check directory */
    chkDir($prm);
    /* create spac shell script */
    genShell();
    setSymLink($prm);
    echo 'successful install spac' . PHP_EOL;
} catch (\err\ComErr $ce) {
    $ce->showConts();
} catch (\Exception $e) {
    $err = new \err\ComErr('unknown', '-');
    $err->showConts();
}
function showHelp()
{
    try {
        echo 'Usage : install.sh [dir]' . PHP_EOL;
        echo '        dir  Installation directory' . PHP_EOL;