Пример #1
0
if (!$fp) {
    syslog(LOG_ERR, "Could not create lock file /home/nemiah/globalCronRSSParser.lock! Exiting.");
    throw new Exception("Could not create lock file /home/nemiah/globalCronRSSParser.lock");
}
if (!flock($fp, LOCK_EX | LOCK_NB)) {
    syslog(LOG_WARNING, "Could not acquire lock! Exiting.");
    throw new Exception("Could not acquire lock!");
}
syslog(LOG_INFO, "Lock acquired.");
$e = new ExtConn(Util::getRootPath());
$e->loadPlugin("plugins", "Cloud");
$absolutePathToPhynx = Util::getRootPath();
$e->addClassPath(FileStorage::getFilesDir());
$e->useDefaultMySQLData();
$ACC = new mCloud();
$ACC->addAssocV3("CloudOption", "=", "allowedPlugins");
$ACC->addAssocV3("CloudValue", "REGEXP", "(^mRSSParser,)|(,mRSSParser,)|(,mRSSParser\$)|(^mRSSParser\$)");
$ACC->lCV3();
$zugaenge = array();
while ($C = $ACC->getNextEntry()) {
    $zugaenge[] = $C->A("CloudUser");
}
syslog(LOG_INFO, "Checked accounts: " . implode(", ", $zugaenge));
$e->loadPlugin("ubiquitous", "RSSParser");
$lastUser = null;
$lastDir = null;
$lastZugang = null;
foreach ($zugaenge as $zugang) {
    #echo "-----------------\n";
    #echo $zugang."\n";
    $_GET["cloud"] = $zugang;
Пример #2
0
    if (trim($status) !== "active") {
        die;
    }
}
session_name("ExtConnGlobalOWM");
if (isset($argv[1])) {
    $_SERVER["HTTP_HOST"] = $argv[1];
}
require_once realpath(dirname(__FILE__) . "/../../system/connect.php");
$e = new ExtConn(Util::getRootPath());
$e->loadPlugin("plugins", "Cloud");
$absolutePathToPhynx = Util::getRootPath();
$e->addClassPath(FileStorage::getFilesDir());
$e->useDefaultMySQLData();
$ACC = new mCloud();
$ACC->addAssocV3("CloudOption", "=", "allowedPlugins");
$ACC->addAssocV3("CloudValue", "REGEXP", "(^mOpenWeatherMap,)|(,mOpenWeatherMap,)|(,mOpenWeatherMap\$)|(^mOpenWeatherMap\$)");
$ACC->lCV3();
$zugaenge = array();
while ($C = $ACC->getNextEntry()) {
    $zugaenge[] = $C->A("CloudUser");
}
$fp = fopen("/home/nemiah/globalCronOWM.lock", "a");
if (!$fp) {
    throw new Exception("Could not create lock file /home/nemiah/globalCronOWM.lock");
}
if (!flock($fp, LOCK_EX | LOCK_NB)) {
    throw new Exception("Could not acquire lock!");
}
$e->loadPlugin("ubiquitous", "OWM");
$lastUser = null;