From 4fe441085fe4438cb02cc2ddef882ccd09e22446 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 7 Apr 2016 13:09:23 +0000 Subject: [PATCH] cant include api/asyncwrapper.php, as #!/usr/bin/php gets echoed and therefore generated cron mails --- phpgwapi/cron/asyncwrapper.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/phpgwapi/cron/asyncwrapper.php b/phpgwapi/cron/asyncwrapper.php index d03e711f46..1a95443cdf 100644 --- a/phpgwapi/cron/asyncwrapper.php +++ b/phpgwapi/cron/asyncwrapper.php @@ -11,4 +11,14 @@ * @version $Id$ */ -include __DIR__.'/../../api/asyncwrapper.php'; \ No newline at end of file +$path_to_egroupware = realpath(__DIR__.'/../..'); // need to be adapted if this script is moved somewhere else +$php = isset($_ENV['_']) ? $_ENV['_'] : $_SERVER['_']; + +foreach(file($path_to_egroupware. '/header.inc.php') as $line) +{ + if(preg_match("/GLOBALS\['egw_domain']\['(.*)']/", $line, $matches)) + { + // -d memory_limit=-1 --> no memory limit + system($php. ' -q -d memory_limit=-1 '.$path_to_egroupware.'/api/asyncservices.php '. $matches[1]); + } +}