function hosting_queues_cron_removal

7.x-3.x hosting.queues.inc hosting_queues_cron_removal($crontab)

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 220
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;
}