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


PHP wordfence::scheduleScans方法代码示例

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


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

示例1: wordfenceStartScheduledScan

 public static function wordfenceStartScheduledScan()
 {
     //If scheduled scans are not enabled in the global config option, then don't run a scheduled scan.
     if (wfConfig::get('scheduledScansEnabled') != '1') {
         return;
     }
     //This prevents scheduled scans from piling up on low traffic blogs and all being run at once.
     //Only one scheduled scan runs within a given 60 min window. Won't run if another scan has run within 30 mins.
     $lastScanStart = wfConfig::get('lastScheduledScanStart', 0);
     if ($lastScanStart && time() - $lastScanStart < 1800) {
         //A scheduled scan was started in the last 30 mins, so skip this one.
         return;
     }
     wfConfig::set('lastScheduledScanStart', time());
     wordfence::status(1, 'info', "Scheduled Wordfence scan starting at " . date('l jS \\of F Y h:i:s A', current_time('timestamp')));
     //We call this before the scan actually starts to advance the schedule for the next week.
     //This  ensures that if the scan crashes for some reason, the schedule will hold.
     wordfence::scheduleScans();
     wfScanEngine::startScan();
 }
开发者ID:ashenkar,项目名称:sanga,代码行数:20,代码来源:wordfenceClass.php


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