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


PHP cache::deleteBySearch方法代码示例

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


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

示例1: setCollect

 public function setCollect($collect)
 {
     if ($collect == 1) {
         cache::set('collect' . $this->getId(), $this->getId());
     } else {
         cache::deleteBySearch('collect' . $this->getId());
     }
 }
开发者ID:jimibi,项目名称:core,代码行数:8,代码来源:cmd.class.php

示例2: cron

    $cron = cron::byClassAndFunction('plugin', 'cron30');
    if (!is_object($cron)) {
        echo "Création de plugin::cron30\n";
        $cron = new cron();
    }
    $cron->setClass('plugin');
    $cron->setFunction('cron30');
    $cron->setSchedule('*/30 * * * * *');
    $cron->setTimeout(60);
    $cron->save();
    $dynamic_apache_path = dirname(__FILE__) . '/../core/config/apache_jeedom_dynamic_rules';
    if (!file_exists($dynamic_apache_path)) {
        touch($dynamic_apache_path);
    }
    if (jeedom::isCapable('sudo')) {
        if (!file_exists('/var/log/auth.log')) {
            exec('sudo touch /var/log/auth.log');
            exec('sudo service fail2ban restart');
        }
        exec('sudo service cron restart');
    }
    cache::deleteBySearch('widgetHtml');
    cache::deleteBySearch('cmdWidgetdashboard');
    cache::deleteBySearch('cmdWidgetmobile');
    cache::deleteBySearch('scenarioHtmldashboard');
    config::save('hardware_name', '');
} catch (Exception $e) {
    echo "Error : ";
    echo $e->getMessage();
}
echo "[END CONSISTENCY]\n";
开发者ID:GaelGRIFFON,项目名称:core,代码行数:31,代码来源:consistency.php

示例3: cron

 public static function cron()
 {
     if (!self::isStarted()) {
         echo date('Y-m-d H:i:s') . ' starting Jeedom';
         config::save('enableScenario', 1);
         config::save('enableCron', 1);
         cache::deleteBySearch('widgetHtml');
         cache::deleteBySearch('cmdWidgetdashboard');
         cache::deleteBySearch('cmdWidgetmobile');
         cache::deleteBySearch('scenarioHtmldashboard');
         $cache = cache::byKey('jeedom::usbMapping');
         $cache->remove();
         foreach (cron::all() as $cron) {
             if ($cron->running() && $cron->getClass() != 'jeedom' && $cron->getFunction() != 'cron') {
                 try {
                     $cron->halt();
                 } catch (Exception $e) {
                 }
             }
         }
         try {
             jeedom::start();
         } catch (Exception $e) {
         }
         touch('/tmp/jeedom_start');
         self::event('start');
         log::add('core', 'info', 'Démarrage de Jeedom OK');
         try {
             plugin::start();
         } catch (Exception $e) {
         }
     }
     self::isDateOk();
     try {
         $c = new Cron\CronExpression(config::byKey('update::check'), new Cron\FieldFactory());
         if ($c->isDue()) {
             $lastCheck = strtotime(config::byKey('update::lastCheck'));
             if (strtotime('now') - $lastCheck > 3600) {
                 update::checkAllUpdate();
                 $updates = update::byStatus('update');
                 if (count($updates) > 0) {
                     $toUpdate = '';
                     foreach ($updates as $update) {
                         $toUpdate .= $update->getLogicalId() . ',';
                     }
                 }
                 $updates = update::byStatus('update');
                 if (count($updates) > 0) {
                     message::add('update', __('De nouvelles mises à jour sont disponibles : ', __FILE__) . trim($toUpdate, ','), '', 'newUpdate');
                 }
                 config::save('update::check', rand(1, 59) . ' ' . rand(6, 7) . ' * * *');
             }
         }
         $c = new Cron\CronExpression('35 00 * * 0', new Cron\FieldFactory());
         if ($c->isDue()) {
             cache::clean();
             DB::optimize();
         }
         $c = new Cron\CronExpression('02 02 * * *', new Cron\FieldFactory());
         if ($c->isDue()) {
             try {
                 log::chunk();
                 cron::clean();
             } catch (Exception $e) {
                 log::add('log', 'error', $e->getMessage());
             }
         }
         $c = new Cron\CronExpression('21 23 * * *', new Cron\FieldFactory());
         if ($c->isDue()) {
             try {
                 scenario::cleanTable();
                 user::cleanOutdatedUser();
                 scenario::consystencyCheck();
             } catch (Exception $e) {
                 log::add('scenario', 'error', $e->getMessage());
             }
         }
     } catch (Exception $e) {
     }
 }
开发者ID:saez0pub,项目名称:core,代码行数:80,代码来源:jeedom.class.php


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