echo 'Unexpected error!' . PHP_EOL; } else { OC_JSON::error(array('data' => array('message' => 'Unexpected error!'))); } } } require_once 'lib/base.php'; session_write_close(); // Don't do anything if ownCloud has not been installed if (!OC_Config::getValue('installed', false)) { exit(0); } // Handle unexpected errors register_shutdown_function('handleUnexpectedShutdown'); // Delete temp folder OC_Helper::cleanTmpNoClean(); // Exit if background jobs are disabled! $appmode = OC_BackgroundJob::getExecutionType(); if ($appmode == 'none') { my_temporary_cron_class::$sent = true; if (OC::$CLI) { echo 'Background Jobs are disabled!' . PHP_EOL; } else { OC_JSON::error(array('data' => array('message' => 'Background jobs disabled!'))); } exit(1); } if (OC::$CLI) { // Create lock file first my_temporary_cron_class::$lockfile = OC_Config::getValue("datadirectory", OC::$SERVERROOT . '/data') . '/cron.lock'; // We call ownCloud from the CLI (aka cron)