You are here

function hosting_queues_cron_removal in Hosting 7.3

Same name and namespace in other branches
  1. 7.4 hosting.queues.inc \hosting_queues_cron_removal()

Remove Aegir lines from a crontab.

Parameters

array $crontab: Multi line array of the current crontab entry.

Return value

array The left over non-Aegir lines.

See also

hosting_queues_cron_cmd()

Related topics

1 call to hosting_queues_cron_removal()
_hosting_setup_cron in ./hosting.module
Set up the hosting-dispatch command in the aegir user's crontab.

File

./hosting.queues.inc, line 244
This file defines an API for defining new queues.

Code

function hosting_queues_cron_removal($crontab) {
  foreach ($crontab as $k => $cron) {
    if (preg_match('|SHELL=/bin/sh|', $cron)) {
      unset($crontab[$k]);
    }
    if (preg_match("|PATH={$_SERVER['PATH']}|", $cron)) {
      unset($crontab[$k]);
    }
    if (preg_match('|hosting-dispatch|', $cron)) {
      unset($crontab[$k]);
    }
  }
  return $crontab;
}