예제 #1
0
파일: messenger.php 프로젝트: nemiah/fheME
}
session_name("ExtConnNuntius");
require_once realpath(dirname(__FILE__) . "/../../system/connect.php");
register_shutdown_function('cronShutdownHandler');
function cronShutdownHandler()
{
    $last_error = error_get_last();
    if ($last_error['type'] !== E_ERROR) {
        return;
    }
    print_r(SysMessages::i()->getMessages());
}
$absolutePathToPhynx = realpath(dirname(__FILE__) . "/../../") . "/";
$e = new ExtConn($absolutePathToPhynx);
#$e->addClassPath($absolutePathToPhynx."/lightCRM/Mail");
$e->loadPlugin("fheME", "Nuntius");
$e->useDefaultMySQLData();
$e->useUser();
$caller = "";
if ($_GET["from"] == "FritzBox") {
    $data = explode(",", $_GET["message"]);
    $xml = file_get_contents("ftp://*****:*****@{$_SERVER['REMOTE_ADDR']}/phonebook.xml");
    $xml = str_replace("<?xml\nversion=\"1.0\" encoding=\"utf-8\">", "<?xml version=\"1.0\" encoding=\"utf-8\" ?><pb>", $xml) . "</pb>";
    libxml_use_internal_errors(false);
    try {
        $S = new SimpleXMLElement($xml);
        foreach ($S->phonebook as $PB) {
            foreach ($PB->contact as $C) {
                foreach ($C->telephony->number as $N) {
                    if (ltrim($N . "", "0") == ltrim($data[1], "0")) {
                        $caller = $C->person->realName . "";
예제 #2
0
파일: websocket.php 프로젝트: nemiah/fheME
if (isset($argv[2])) {
    $_SERVER["HTTP_HOST"] = $argv[2];
}
session_name("ExtConnTinkerforge");
require_once realpath(dirname(__FILE__) . "/../../system/connect.php");
register_shutdown_function('cronShutdownHandler');
function cronShutdownHandler()
{
    $last_error = error_get_last();
    if ($last_error['type'] !== E_ERROR) {
        return;
    }
    print_r(SysMessages::i()->getMessages());
}
$e = new ExtConn(realpath(dirname(__FILE__) . "/../../") . "/");
$e->loadPlugin("fheME", "Tinkerforge");
$e->useDefaultMySQLData();
$e->useUser();
require_once __DIR__ . '/lib/IPConnection.php';
require_once __DIR__ . '/lib/BrickletTemperatureIR.php';
#require_once(__DIR__.'/lib/BrickletAnalogOut.php');
#require_once(__DIR__.'/lib/BrickletIO4.php');
declare (ticks=1);
function callback($value, $data)
{
    $bricklet = $data[0];
    $type = $data[1];
    $entryData = array('topic' => "tinkerforge", 'value' => $value, 'bricklet' => $bricklet, 'type' => $type, 'time' => time());
    $context = new ZMQContext();
    $socket = $context->getSocket(ZMQ::SOCKET_PUSH, 'my pusher');
    $socket->connect("tcp://localhost:5555");
예제 #3
0
if (isset($argv[1])) {
    $_SERVER["HTTP_HOST"] = $argv[1];
}
require_once realpath(dirname(__FILE__) . "/../../system/connect.php");
$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;
예제 #4
0
파일: cronjob.php 프로젝트: nemiah/fheME
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  2007 - 2015, Rainer Furtmeier - Rainer@Furtmeier.IT
 */
if (isset($argv[1])) {
    $_GET["cloud"] = $argv[1];
}
if (isset($argv[2])) {
    $_SERVER["HTTP_HOST"] = $argv[2];
}
session_name("ExtConnUPnP");
define("PHYNX_LOW_FOOTPRINT", true);
require_once realpath(dirname(__FILE__) . "/../../system/connect.php");
#print_r(get_included_files());
register_shutdown_function('cronShutdownHandler');
function cronShutdownHandler()
{
    $last_error = error_get_last();
    if ($last_error['type'] !== E_ERROR) {
        return;
    }
    print_r(SysMessages::i()->getMessages());
}
$e = new ExtConn(realpath(dirname(__FILE__) . "/../../") . "/");
$e->loadPlugin("fheME", "UPnP");
$e->useDefaultMySQLData();
$e->useUser();
$U = new mUPnP();
$U->discoverNow(null, true, true);
$e->cleanUp();
예제 #5
0
 *
 *  2007 - 2016, Rainer Furtmeier - Rainer@Furtmeier.IT
 */
if (file_exists("/var/www/status/cron_" . gethostname())) {
    $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");
}
예제 #6
0
파일: rc.php 프로젝트: nemiah/fheME
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  2007 - 2013, Rainer Furtmeier - Rainer@Furtmeier.IT
 */
if (isset($argv[1])) {
    $_GET["cloud"] = $argv[1];
}
if (isset($argv[2])) {
    $_SERVER["HTTP_HOST"] = $argv[2];
}
session_name("ExtConnRC");
require_once realpath(dirname(__FILE__) . "/../../system/connect.php");
register_shutdown_function('cronShutdownHandler');
function cronShutdownHandler()
{
    $last_error = error_get_last();
    if ($last_error['type'] !== E_ERROR) {
        return;
    }
    print_r(SysMessages::i()->getMessages());
}
$absolutePathToPhynx = realpath(dirname(__FILE__) . "/../../") . "/";
$e = new ExtConn($absolutePathToPhynx);
$e->loadPlugin("fheME", "RC");
$e->useDefaultMySQLData();
$e->useUser();
$e->cleanUp();