Exemple #1
0
 public static function load($forceReload = false)
 {
     if (Environment::$currentEnvironment != null and !$forceReload) {
         return;
     }
     if (file_exists(Util::getRootPath() . "plugins/Cloud/Cloud.class.php")) {
         //!defined("PHYNX_VIA_INTERFACE") removed because of ZPush/lightCRM 03.07.2013
         require_once Util::getRootPath() . "plugins/Cloud/Cloud.class.php";
         require_once Util::getRootPath() . "plugins/Cloud/mCloud.class.php";
         require_once Util::getRootPath() . "plugins/Cloud/CloudStorage.class.php";
         Environment::$currentEnvironment = mCloud::getEnvironment();
         return;
     }
     $h = "Environment" . str_replace(array(":", "-"), "_", implode("", array_map("ucfirst", explode(".", isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "NonExistentABCDEF"))));
     if (defined("PHYNX_VIA_INTERFACE")) {
         if (file_exists(Util::getRootPath() . "specifics/{$h}.class.php")) {
             require_once Util::getRootPath() . "specifics/{$h}.class.php";
             Environment::$currentEnvironment = new $h();
         } else {
             Environment::$currentEnvironment = new Environment();
         }
         return;
     }
     try {
         try {
             Environment::$currentEnvironment = new $h();
         } catch (ClassNotFoundException $e) {
             Environment::$currentEnvironment = new EnvironmentCurrent();
         }
     } catch (ClassNotFoundException $e) {
         Environment::$currentEnvironment = new Environment();
     }
 }
Exemple #2
0
$fp = fopen("/home/nemiah/globalCronRSSParser.lock", "a");
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";
 public static function load()
 {
     if (Environment::$currentEnvironment != null) {
         return;
     }
     if (file_exists(Util::getRootPath() . "plugins/Cloud/Cloud.class.php") and !defined("PHYNX_VIA_INTERFACE")) {
         require_once Util::getRootPath() . "plugins/Cloud/Cloud.class.php";
         require_once Util::getRootPath() . "plugins/Cloud/mCloud.class.php";
         Environment::$currentEnvironment = mCloud::getEnvironment();
     } else {
         try {
             Environment::$currentEnvironment = new EnvironmentCurrent();
         } catch (ClassNotFoundException $e) {
             Environment::$currentEnvironment = new Environment();
         }
     }
 }
Exemple #4
0
    $status = file_get_contents("/var/www/status/cron_" . gethostname());
    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");