cant include api/asyncwrapper.php, as #!/usr/bin/php gets echoed and therefore generated cron mails

This commit is contained in:
Ralf Becker 2016-04-07 13:09:23 +00:00
parent 1926a80d70
commit 4fe441085f

View File

@ -11,4 +11,14 @@
* @version $Id$ * @version $Id$
*/ */
include __DIR__.'/../../api/asyncwrapper.php'; $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]);
}
}