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


PHP cron类代码示例

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


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


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