• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP cron类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: initcronjobs

 public function initcronjobs()
 {
     global $init;
     require_once PATH_CORE . '/classes/cron.class.php';
     $cObj = new cron($init['apiKey']);
     $cObj->initJobs();
     set_flash(array('notice' => "Finished initializing cron jobs."));
     redirect(url_for($this->name, 'cronjobs'));
 }
开发者ID:smbale,项目名称:open-social-media-toolkit,代码行数:9,代码来源:admin_controller.php


示例2: syncallocations

 public function syncallocations()
 {
     global $init;
     require_once PATH_CORE . '/classes/cron.class.php';
     $cObj = new cron($init['apiKey']);
     $cObj->forceJob('facebookAllocations');
     echo 'Completed';
     set_flash(array('notice' => "Finished synching allocations"));
     redirect(url_for($this->name, 'index'));
 }
开发者ID:smbale,项目名称:open-social-media-toolkit,代码行数:10,代码来源:facebook_controller.php


示例3: downloadUrl

 public static function downloadUrl($url, $path, $name)
 {
     if (empty($url)) {
         throw new Exception('[ERROR] Class cron, function downloadUrl, $url is empty !');
     }
     if (empty($path)) {
         throw new Exception('[ERROR] Class cron, function downloadUrl, $path is empty !');
     }
     cron::message(sprintf("Class cron, function downloadUrl, de volgende url word aangeroepen: %s, naar %s/%s !", $url, $path, $name));
     if (!($fp = fopen($path . '/' . $name, 'w+'))) {
         //This is the file where we save the information
         cron::message(sprintf("Class cron, function downloadUrl, fopen error !"), 'error');
         fclose($fp);
         return false;
     }
     $ch = curl_init(str_replace(' ', '%20', $url));
     //Here is the file we are downloading, replace spaces with %20
     curl_setopt($ch, CURLOPT_TIMEOUT, 50);
     curl_setopt($ch, CURLOPT_FILE, $fp);
     // write curl response to file
     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
     if (false === curl_exec($ch)) {
         cron::message(sprintf("Class cron, function downloadUrl, curl_exec error: %s", curl_error($ch)), 'error');
         // Close handle
         curl_close($ch);
         fclose($fp);
         return false;
     }
     // Close handle
     curl_close($ch);
     fclose($fp);
     return true;
 }
开发者ID:jvos,项目名称:nl.bosqom.server,代码行数:33,代码来源:cron.php


示例4: ewattch_remove

function ewattch_remove()
{
    $cron = cron::byClassAndFunction('ewattch', 'pull');
    if (is_object($cron)) {
        $cron->remove();
    }
}
开发者ID:jooooooon,项目名称:plugin-ewattch,代码行数:7,代码来源:install.php


示例5: tesla_remove

function tesla_remove()
{
    $cron = cron::byClassAndFunction('tesla', 'pull');
    if (is_object($cron)) {
        $cron->remove();
    }
}
开发者ID:kaneda-fr,项目名称:jeedom_tesla,代码行数:7,代码来源:install.php


示例6: run

 function run()
 {
     //called by outside cron NOT autocron
     Cron::MailFetcher();
     Cron::TicketMonitor();
     cron::PurgeLogs();
 }
开发者ID:supaket,项目名称:helpdesk,代码行数:7,代码来源:class.cron.php


示例7: xpl_remove

function xpl_remove()
{
    $cron = cron::byClassAndFunction('xpl', 'deamon');
    if (is_object($cron)) {
        $cron->remove();
    }
}
开发者ID:bjacquot,项目名称:plugin-xpl,代码行数:7,代码来源:install.php


示例8: callback_inactive

function callback_inactive()
{
    global $m;
    $m->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "pch18_relist`");
    $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "options` WHERE `name`= 'relist'");
    cron::del('pch18_relist');
}
开发者ID:chajianku,项目名称:pch18_relist,代码行数:7,代码来源:pch18_relist_callback.php


示例9: health

 public static function health()
 {
     $return = array();
     $demon_state = self::deamonRunning();
     $return[] = array('test' => __('Démon local', __FILE__), 'result' => $demon_state ? __('OK', __FILE__) : __('NOK', __FILE__), 'advice' => $demon_state ? '' : __('Peut être normal si vous êtes en déporté', __FILE__), 'state' => $demon_state);
     $version = openzwave::getVersion('openzwave');
     $return[] = array('test' => __('Version d\'openzwave', __FILE__), 'result' => $version, 'advice' => $demon_state ? '' : __('Mettez à jour les dépendances', __FILE__), 'state' => version_compare(config::byKey('openzwave_version', 'openzwave'), $version, '<='));
     $compilation = openzwave::compilationOk();
     $return[] = array('test' => __('Compilation', __FILE__), 'result' => $compilation ? __('OK', __FILE__) : __('NOK', __FILE__), 'advice' => $compilation ? '' : __('Mettez à jour les dépendances', __FILE__), 'state' => $compilation);
     if (config::byKey('jeeNetwork::mode') == 'master') {
         $cron = cron::byClassAndFunction('openzwave', 'pull');
         $running = false;
         if (is_object($cron)) {
             $running = $cron->running();
         }
         $return[] = array('test' => __('Tâche Z-Wave', __FILE__), 'result' => $running ? __('OK', __FILE__) : __('NOK', __FILE__), 'advice' => $running ? '' : __('Allez sur la page du moteur des tâches et vérifiez lancer la tache openzwave::pull', __FILE__), 'state' => $running);
         foreach (jeeNetwork::byPlugin('openzwave') as $jeeNetwork) {
             try {
                 $demon_state = $jeeNetwork->sendRawRequest('deamonRunning', array('plugin' => 'openzwave'));
             } catch (Exception $e) {
                 $demon_state = false;
             }
             $return[] = array('test' => __('Démon sur ', __FILE__) . $jeeNetwork->getName(), 'result' => $demon_state ? __('OK', __FILE__) : __('NOK', __FILE__), 'advice' => '', 'state' => $demon_state);
             $version = $jeeNetwork->sendRawRequest('getVersion', array('plugin' => 'openzwave', 'module' => 'openzwave'));
             $return[] = array('test' => __('Version d\'openzwave sur ', __FILE__) . $jeeNetwork->getName(), 'result' => $version, 'advice' => $demon_state ? '' : __('Mettez à jour les dépendances', __FILE__), 'state' => version_compare(config::byKey('openzwave_version', 'openzwave'), $version, '<='));
             $compilation = $jeeNetwork->sendRawRequest('compilationOk', array('plugin' => 'openzwave'));
             $return[] = array('test' => __('Compilation sur', __FILE__) . $jeeNetwork->getName(), 'result' => $compilation ? __('OK', __FILE__) : __('NOK', __FILE__), 'advice' => $compilation ? '' : __('Mettez à jour les dépendances', __FILE__), 'state' => $compilation);
         }
     }
     return $return;
 }
开发者ID:stef3569,项目名称:plugin-openzwave,代码行数:31,代码来源:openzwave.class.php


示例10: weather_update

function weather_update()
{
    $crons = cron::searchClassAndFunction('weather', 'updateWeatherData');
    foreach ($crons as $cron) {
        $cron->remove();
    }
}
开发者ID:slobberbone,项目名称:plugin-weather,代码行数:7,代码来源:install.php


示例11: domogeek_remove

function domogeek_remove()
{
    $cron = cron::byClassAndFunction('domogeek', 'pull');
    if (is_object($cron)) {
        $cron->remove();
    }
}
开发者ID:jeedom,项目名称:plugin-domogeek,代码行数:7,代码来源:install.php


示例12: remove

function remove()
{
    $cron = cron::byClassAndFunction('zwave', 'pull');
    if (is_object($cron)) {
        $cron->remove();
    }
}
开发者ID:Wators,项目名称:jeedom_plugins,代码行数:7,代码来源:install.php


示例13: sonos3_remove

function sonos3_remove()
{
    $cron = cron::byClassAndFunction('sonos3', 'pull');
    if (is_object($cron)) {
        $cron->remove();
    }
}
开发者ID:Masterfion,项目名称:plugin-sonos,代码行数:7,代码来源:install.php


示例14: remove

function remove()
{
    $cron = cron::byId(config::byKey('xPLDeamonCronId', 'xPL'));
    if (is_object($cron)) {
        $cron->remove();
    }
    config::remove('xPLDeamonCronId', 'xPL');
}
开发者ID:Wators,项目名称:jeedom_plugins,代码行数:8,代码来源:install.php


示例15: callback_init

function callback_init()
{
    option::add('wmzz_mailer_title');
    option::add('wmzz_mailer_text');
    option::set('wmzz_mailer_limit', '5');
    option::set('wmzz_mailer_last', '0');
    cron::set('wmzz_mailer', 'plugins/wmzz_mailer/wmzz_mailer_cron.php', 0, 0, 0);
}
开发者ID:noinlijin,项目名称:tiebaSign,代码行数:8,代码来源:wmzz_mailer_callback.php


示例16: callback_remove

function callback_remove()
{
    cron::del('reg_supervise');
    option::xdel('reg_supervise');
    global $m;
    $m->query('DROP TABLE `' . DB_NAME . '`.`' . DB_PREFIX . 'reg`');
    option::del('reg_supervise_run');
}
开发者ID:chajianku,项目名称:reg_supervise,代码行数:8,代码来源:reg_supervise_callback.php


示例17: run_all

    function run_all()
    {
        # ensure that tasks complete and dont hang on
        # running=1
        set_time_limit(2 * 60 * 60);
        # Loop through the tasks:
        global $VAR;
        $db =& DB();
        $sql = 'SELECT * FROM ' . AGILE_DB_PREFIX . 'task WHERE
					site_id     = ' . $db->qstr(DEFAULT_SITE) . ' AND
					( running = 0 OR running IS NULL )';
        $result = $db->Execute($sql);
        if ($result->RecordCount() > 0) {
            include_once PATH_INCLUDES . 'cron/cron.inc.php';
            $cron = new cron();
            while (!$result->EOF) {
                $_r = false;
                $_s = (int) $result->fields['date_start'];
                $_e = (int) $result->fields['date_expire'];
                $_l = (int) $result->fields['date_last'];
                $_c = $result->fields['int_min'] . " ";
                $_c .= $result->fields['int_hour'] . " ";
                $_c .= $result->fields['int_month_day'] . " ";
                $_c .= $result->fields['int_month'] . " ";
                $_c .= $result->fields['int_week_day'];
                $_n = (int) time();
                if (!$_l > 0) {
                    $_l = $_n - 86400 * 365;
                }
                # Verify it has not expired:
                if ($_s <= $_n || $_s == "" || $_s == "0") {
                    # Verify it is past the start date:
                    if ($_e >= $_n || $_e == "" || $_e == "0") {
                        # Verify that it is time to run:
                        if ($cron->due($_l, $_n, $_c)) {
                            # Run the task:
                            $this->id = $result->fields['id'];
                            $this->run($VAR, $this);
                        }
                    }
                }
                $result->MoveNext();
            }
        }
    }
开发者ID:hbustun,项目名称:agilebill,代码行数:45,代码来源:task.inc.php


示例18: openzwave_remove

function openzwave_remove()
{
    if (openzwave::deamonRunning()) {
        openzwave::stopDeamon();
    }
    $cron = cron::byClassAndFunction('openzwave', 'pull');
    if (is_object($cron)) {
        $cron->remove();
    }
}
开发者ID:kaneda-fr,项目名称:plugin-openzwave,代码行数:10,代码来源:install.php


示例19: mySensors_remove

function mySensors_remove()
{
    $cron = cron::byClassAndFunction('mySensors', 'pull');
    if (is_object($cron)) {
        $cron->remove();
    }
    if (method_exists('mySensors', 'stopDeamon')) {
        mySensors::stopDeamon();
    }
}
开发者ID:conselio,项目名称:jeedom_mysensors,代码行数:10,代码来源:install.php


示例20: health

 public static function health()
 {
     $return = array();
     $cron = cron::byClassAndFunction('ewattch', 'pull');
     $running = false;
     if (is_object($cron)) {
         $running = $cron->running();
     }
     $return[] = array('test' => __('Tâche de synchronisation', __FILE__), 'result' => $running ? __('OK', __FILE__) : __('NOK', __FILE__), 'advice' => $running ? '' : __('Allez sur la page du moteur des tâches et vérifiez lancer la tache ewattch::pull', __FILE__), 'state' => $running);
     return $return;
 }
开发者ID:jooooooon,项目名称:plugin-ewattch,代码行数:11,代码来源:ewattch.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP cronBase类代码示例发布时间:2022-05-23
下一篇:
PHP coursecat类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap