當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。