当前位置: 首页>>代码示例>>PHP>>正文


PHP cron::setEnable方法代码示例

本文整理汇总了PHP中cron::setEnable方法的典型用法代码示例。如果您正苦于以下问题:PHP cron::setEnable方法的具体用法?PHP cron::setEnable怎么用?PHP cron::setEnable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cron的用法示例。


在下文中一共展示了cron::setEnable方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sonos3_update

function sonos3_update()
{
    $cron = cron::byClassAndFunction('sonos3', 'pull');
    if (!is_object($cron)) {
        $cron = new cron();
    }
    $cron->setClass('sonos3');
    $cron->setFunction('pull');
    $cron->setEnable(1);
    $cron->setDeamon(1);
    $cron->setDeamonSleepTime(5);
    $cron->setTimeout(1440);
    $cron->setSchedule('* * * * *');
    $cron->save();
    $cron->stop();
    foreach (sonos3::byType('sonos3') as $sonos) {
        $sonos->save();
    }
    $files = array('24 LED Bright.ttf', '24 LED Grid.ttf', '24 LED Modul.ttf', '24 LED.ttf', 'advanced_dot_digital-7.ttf', 'AHDN.ttf', 'alpha04.ttf', 'CUBS LED TFB.ttf', 'enhanced_led_board-7.ttf', 'led_counter-7.ttf', 'liquid_crystal_display.ttf', 'liquid.ttf');
    foreach ($files as $file) {
        $path = dirname(__FILE__) . '/../core/template/fonts/' . $file;
        if (file_exists($path)) {
            unlink($path);
        }
    }
}
开发者ID:Masterfion,项目名称:plugin-sonos,代码行数:26,代码来源:install.php

示例2: openzwave_update

function openzwave_update()
{
    if (openzwave::deamonRunning()) {
        echo 'Stop zwave network...';
        openzwave::stopDeamon();
        echo "OK\n";
    }
    echo 'Stop cron...';
    $cron = cron::byClassAndFunction('openzwave', 'pull');
    if (config::byKey('jeeNetwork::mode') != 'slave') {
        if (!is_object($cron)) {
            $cron = new cron();
        }
        $cron->setClass('openzwave');
        $cron->setFunction('pull');
        $cron->setEnable(1);
        $cron->setDeamon(1);
        $cron->setDeamonSleepTime(0.5);
        $cron->setTimeout(1440);
        $cron->setSchedule('* * * * *');
        $cron->save();
        $cron->stop();
    } else {
        if (is_object($cron)) {
            $cron->remove();
        }
    }
    echo "OK\n";
    echo 'Check zwave system...';
    if (count(eqLogic::byType('zwave')) > 0) {
        log::add('openzwave', 'error', 'Attention vous etes sur la nouvelle version d\'openzwave, des actions de votre part sont necessaire merci d\'aller voir https://jeedom.fr/blog/?p=1576');
    }
    if (config::byKey('port', 'openzwave', 'none') != 'none') {
        if (method_exists('openzwave', 'getVersion')) {
            if (version_compare(config::byKey('openzwave_version', 'openzwave'), openzwave::getVersion('openzwave'), '>')) {
                if (jeedom::getHardwareName() == 'Jeedomboard') {
                    config::save('allowStartDeamon', 0, 'openzwave');
                    openzwave::updateOpenzwave(false);
                    config::save('allowStartDeamon', 1, 'openzwave');
                } else {
                    log::add('openzwave', 'error', __('Attention votre version d\'openzwave est dépassée sur le démon local, il faut ABSOLUMENT la mettre à jour', __FILE__));
                }
            }
        }
    }
    if (config::byKey('jeeNetwork::mode') == 'master') {
        foreach (jeeNetwork::byPlugin('openzwave') as $jeeNetwork) {
            try {
                if ($jeeNetwork->configByKey('port', 'openzwave', 'none') != 'none') {
                    if (version_compare($jeeNetwork->sendRawRequest('getVersion', array('plugin' => 'openzwave', 'module' => 'openzwave')), openzwave::getVersion('openzwave'), '>')) {
                        log::add('openzwave', 'error', __('Attention votre version d\'openzwave est dépassée sur', __FILE__) . ' ' . $jeeNetwork->getName() . ' ' . __('il faut ABSOLUMENT la mettre à jour', __FILE__));
                    }
                }
            } catch (Exception $e) {
            }
        }
    }
    echo "OK\n";
}
开发者ID:stef3569,项目名称:plugin-openzwave,代码行数:59,代码来源:install.php

示例3: install

function install()
{
    $cron = cron::byClassAndFunction('alarm', 'pull');
    if (!is_object($cron)) {
        $cron = new cron();
    }
    $cron->setClass('alarm');
    $cron->setFunction('pull');
    $cron->setEnable(1);
    $cron->setDeamon(1);
    $cron->setSchedule('* * * * *');
    $cron->save();
}
开发者ID:Wators,项目名称:jeedom_plugins,代码行数:13,代码来源:install.php

示例4: ewattch_update

function ewattch_update()
{
    $cron = cron::byClassAndFunction('ewattch', 'pull');
    if (!is_object($cron)) {
        $cron = new cron();
        $cron->setClass('ewattch');
        $cron->setFunction('pull');
        $cron->setEnable(1);
        $cron->setSchedule('*/20 * * * *');
        $cron->save();
    }
    $cron->stop();
}
开发者ID:jooooooon,项目名称:plugin-ewattch,代码行数:13,代码来源:install.php

示例5: domogeek_update

function domogeek_update()
{
    $cron = cron::byClassAndFunction('domogeek', 'pull');
    if (!is_object($cron)) {
        $cron = new cron();
        $cron->setClass('domogeek');
        $cron->setFunction('pull');
        $cron->setEnable(1);
        $cron->setDeamon(0);
        $cron->setSchedule('0 */2 * * *');
        $cron->save();
    }
    $cron->stop();
}
开发者ID:jeedom,项目名称:plugin-domogeek,代码行数:14,代码来源:install.php

示例6: install

function install()
{
    $cron = cron::byId(config::byKey('xPLDeamonCronId', 'xPL'));
    if (!is_object($cron)) {
        $cron = new cron();
    }
    $cron->setClass('xpl');
    $cron->setFunction('deamon');
    $cron->setEnable(1);
    $cron->setDeamon(1);
    $cron->setSchedule('* * * * *');
    $cron->save();
    config::save('xPLDeamonCronId', $cron->getId(), 'xPL');
}
开发者ID:Wators,项目名称:jeedom_plugins,代码行数:14,代码来源:install.php

示例7: tesla_update

function tesla_update()
{
    $cron = cron::byClassAndFunction('tesla', 'pull');
    if (!is_object($cron)) {
        $cron = new cron();
        $cron->setClass('tesla');
        $cron->setFunction('pull');
        $cron->setEnable(1);
        $cron->setDeamon(0);
        $cron->setSchedule('* * * * *');
        $cron->save();
    }
    $cron->stop();
}
开发者ID:kaneda-fr,项目名称:jeedom_tesla,代码行数:14,代码来源:install.php

示例8: xpl_update

function xpl_update()
{
    $cron = cron::byClassAndFunction('xpl', 'deamon');
    if (!is_object($cron)) {
        $cron = new cron();
        $cron->setClass('xpl');
        $cron->setFunction('deamon');
        $cron->setEnable(1);
        $cron->setDeamon(1);
        $cron->setSchedule('* * * * *');
        $cron->save();
    }
    $cron->stop();
}
开发者ID:bjacquot,项目名称:plugin-xpl,代码行数:14,代码来源:install.php

示例9: mySensors_update

function mySensors_update()
{
    $cron = cron::byClassAndFunction('mySensors', 'pull');
    if (!is_object($cron)) {
        $cron = new cron();
        $cron->setClass('mySensors');
        $cron->setFunction('pull');
        $cron->setEnable(1);
        $cron->setDeamon(0);
        $cron->setSchedule('*/15 * * * *');
        $cron->save();
    }
    if (method_exists('mySensors', 'stopDeamon')) {
        mySensors::stopDeamon();
    }
    $cron->stop();
}
开发者ID:conselio,项目名称:jeedom_mysensors,代码行数:17,代码来源:install.php

示例10: install

function install()
{
    $cron = cron::byClassAndFunction('zwave', 'pull');
    if (!is_object($cron)) {
        $cron = new cron();
    }
    $cron->setClass('zwave');
    $cron->setFunction('pull');
    $cron->setEnable(1);
    $cron->setDeamon(1);
    $cron->setSchedule('* * * * *');
    $cron->save();
    $cibDir = dirname(__FILE__) . '/../ressources';
    if (file_exists($cibDir)) {
        rrmdir($cibDir);
    }
}
开发者ID:Wators,项目名称:jeedom_plugins,代码行数:17,代码来源:install.php

示例11: arduidom_update

function arduidom_update()
{
    arduidom::stopdaemon();
    $MigrationCheck = config::byKey('db_version', 'arduidom', 0);
    if ($MigrationCheck < 108) {
        arduidom::MigrateDatas();
        arduidom::start();
    }
    if ($MigrationCheck < 145) {
        arduidom::stopdaemon();
        $daemon_path = realpath(dirname(__FILE__) . '/../../ressources');
        log::add('arduidom', 'info', "Suppression de arduidom1.py devenu inutile => " . unlink($daemon_path . "/arduidom1.py"));
        log::add('arduidom', 'info', "Suppression de arduidom2.py devenu inutile => " . unlink($daemon_path . "/arduidom2.py"));
        log::add('arduidom', 'info', "Suppression de arduidom3.py devenu inutile => " . unlink($daemon_path . "/arduidom3.py"));
        log::add('arduidom', 'info', "Suppression de arduidom4.py devenu inutile => " . unlink($daemon_path . "/arduidom4.py"));
        log::add('arduidom', 'info', "Suppression de arduidom5.py devenu inutile => " . unlink($daemon_path . "/arduidom5.py"));
        log::add('arduidom', 'info', "Suppression de arduidom6.py devenu inutile => " . unlink($daemon_path . "/arduidom6.py"));
        log::add('arduidom', 'info', "Suppression de arduidom7.py devenu inutile => " . unlink($daemon_path . "/arduidom7.py"));
        log::add('arduidom', 'info', "Suppression de arduidom8.py devenu inutile => " . unlink($daemon_path . "/arduidom8.py"));
        config::save('db_version', 145, 'arduidom');
        // Inscrit la version de migration dans la config
        arduidom::start();
    }
    arduidom::startdaemon();
    $cron = cron::byClassAndFunction('arduidom', 'checkdaemon');
    if (!is_object($cron)) {
        $cron = new cron();
        $cron->setClass('arduidom');
        $cron->setFunction('checkdaemon');
        $cron->setEnable(1);
        $cron->setDeamon(0);
        $cron->setSchedule('* * * * *');
        $cron->save();
    }
    $cron->stop();
    @exec("sudo usermod -G dialout www-data");
}
开发者ID:cedric222,项目名称:arduidom,代码行数:37,代码来源:install.php

示例12: zwave_update

function zwave_update()
{
    $cron = cron::byClassAndFunction('zwave', 'pull');
    if (config::byKey('jeeNetwork::mode') != 'slave') {
        if (!is_object($cron)) {
            $cron = new cron();
        }
        $cron->setClass('zwave');
        $cron->setFunction('pull');
        $cron->setEnable(1);
        $cron->setDeamon(1);
        $cron->setTimeout(1440);
        $cron->setSchedule('* * * * *');
        $cron->save();
        $cron->stop();
    } else {
        if (is_object($cron)) {
            $cron->remove();
        }
    }
    foreach (zwave::byType('zwave') as $zwave) {
        if ($zwave->getConfiguration('serverID') == '') {
            $zwave->setConfiguration('serverID', 1);
        }
        $zwave->save();
    }
    config::save('zwaveAddr1', config::byKey('zwaveAddr1', 'zwave', config::byKey('zwaveAddr', 'zwave')), 'zwave');
    config::save('zwavePort1', config::byKey('zwavePort1', 'zwave', config::byKey('zwavePort', 'zwave')), 'zwave');
    config::save('isOpenZwave1', config::byKey('isOpenZwave1', 'zwave', config::byKey('isOpenZwave', 'zwave')), 'zwave');
    if (method_exists('zwave', 'listServerZway')) {
        foreach (zwave::listServerZway() as $serverID => $server) {
            if (config::byKey('lastNotificationCheck' . $serverID, 'zwave', 0) == 0) {
                config::save('lastNotificationCheck' . $serverID, strtotime('now'), 'zwave');
            }
        }
    }
}
开发者ID:ksoul78,项目名称:plugin-zwave,代码行数:37,代码来源:install.php

示例13: cron

 $cron->setClass('scenario');
 $cron->setFunction('check');
 $cron->setSchedule('* * * * * *');
 $cron->setEnable(1);
 $cron->setDeamon(0);
 $cron->setTimeout(5);
 $cron->save();
 $cron = cron::byClassAndFunction('jeedom', 'checkAndCollect');
 if (!is_object($cron)) {
     echo "Création de jeedom::checkAndCollect\n";
     $cron = new cron();
 }
 $cron->setClass('jeedom');
 $cron->setFunction('checkAndCollect');
 $cron->setSchedule('*/5 * * * * *');
 $cron->setEnable(1);
 $cron->setDeamon(0);
 $cron->setTimeout(5);
 $cron->save();
 $cron = cron::byClassAndFunction('history', 'archive');
 if (is_object($cron)) {
     $cron->remove();
 }
 $cron = cron::byClassAndFunction('jeedom', 'updateSystem');
 if (is_object($cron)) {
     $cron->remove();
 }
 $cron = cron::byClassAndFunction('jeedom', 'cron');
 if (!is_object($cron)) {
     echo "Création de jeedom::cron\n";
     $cron = new cron();
开发者ID:GaelGRIFFON,项目名称:core,代码行数:31,代码来源:consistency.php


注:本文中的cron::setEnable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。