From 2965d271d968ba950245e86ab2461e3356a593c1 Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 7 Oct 2009 21:44:54 +0000 Subject: [PATCH] MDL-12886 fixed param typo and adding new timeout method --- lib/externallib.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/externallib.php b/lib/externallib.php index 80d154ee05..45d6091e90 100644 --- a/lib/externallib.php +++ b/lib/externallib.php @@ -48,10 +48,22 @@ class external_api { * @param stdClass $contex * @return void */ - public static function set_context_restriction($contex) { + public static function set_context_restriction($context) { self::$contextrestriction = $context; } + /** + * This method has to be called before every operation + * that takes a longer time to finish! + * + * @param int $seconds max expected time the next operation needs + * @return void + */ + public static function set_timeout($seconds=360) { + $seconds = ($seconds < 300) ? 300 : $seconds; + set_time_limit($seconds); + } + /** * Validates submitted function parameters, if anything is incorrect * invalid_parameter_exception is thrown. -- 2.39.5