wincachedrupal-8.0.2/wincachedrupal.module

wincachedrupal.module
<?php

/**
 * @file
 * WinCacheDrupal module functions.
 */

module_load_include('inc', 'wincachedrupal', 'wincache');

/**
 * Implements hook_cron().
 */
function wincachedrupal_cron() {
  $keyvalue = Drupal::keyValue('wincachedrupal');
  $lastrun = $keyvalue->get('cron_last_run', 0);
  if (time() - $lastrun < (3600 * 24)) {
    return;
  }

  $netphp = \Drupal::service('netphp');
  if ($netphp->hasNetPhpSupport() === TRUE) {
    try {
      $netphp->getRuntime()->Cron();
    }
    catch (\Exception $e) {

    }
  }

  $keyvalue->set('cron_last_run', time());
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc