/** * {@inheritdoc} */ public static function isEnabled() { // Don't load AcquiaPurgeCronProcessor when AcquiaPurgeRuntimeProcessor is // enabled as well, since this can lead to double processing during cron. // Although running AcquiaPurgeService::process() twice during the same // request won't harm because of the built-in capacity calculation, it would // mean that the second run won't purge anything as the former already did. // See Drupal.org issue #2292773. if (_acquia_purge_variable('acquia_purge_lateruntime')) { return FALSE; } return (bool) _acquia_purge_variable('acquia_purge_cron'); }
/** * Determine if the interactive UI should be visible or not. * * When the interactive UI is not presented to the end-user, processing of the * queue via AJAX still happens. It happens silently in the background for as * long as the administrative user that triggered it, has tabs to Drupal open. * * @return bool * Either TRUE or FALSE. */ protected function isUiVisible() { // Always hide the processor in case this is requested. if (_acquia_purge_variable('acquia_purge_silentmode') === TRUE) { return FALSE; } // Only users with the 'purge on-screen' permission will actually see the // UI, since it could be confusing for some users. return user_access('purge on-screen'); }
/** * Retrieve the loaded queue backend object. * * @return AcquiaPurgeQueueInterface * The queue backend. */ public function queue() { if (is_null($this->queue)) { // Assure that all dependent code is loaded, lets not rely on registry. $state = $this->state(); // Load the configured smart or normal backend. if (_acquia_purge_variable('acquia_purge_smartqueue')) { _acquia_purge_load('queue/backend/AcquiaPurgeSmartQueue.php'); $this->queue = new AcquiaPurgeSmartQueue($state); } else { _acquia_purge_load('queue/backend/AcquiaPurgeEfficientQueue.php'); $this->queue = new AcquiaPurgeEfficientQueue($state); } } return $this->queue; }
/** * {@inheritdoc} */ public static function isEnabled() { return (bool) _acquia_purge_variable('acquia_purge_lateruntime'); }