diff --git a/lib/backgroundjob.php b/lib/backgroundjob.php new file mode 100644 index 0000000000..992a2484ea --- /dev/null +++ b/lib/backgroundjob.php @@ -0,0 +1,52 @@ +. +* +*/ + +/** + * This class does the dirty work. + */ +class OC_BackgroundJob{ + /** + * @brief get the type of background jobs + * @return string + * + * This method returns the type how background jobs are executed. If the user + * did not select something, the type is ajax. + */ + public static function getType() { + return OC_Appconfig::getValue( 'core', 'backgroundjobs_mode', 'ajax' ); + } + + /** + * @brief sets the background jobs type + * @param $type type of background jobs + * @return boolean + * + * This method sets the type of the background jobs. Possible types are + * "none", "ajax", "webcron", "cron" + */ + public static function setType( $type ) { + if( !in_array( $type, array('none', 'ajax', 'webcron', 'cron'))){ + return false; + } + return OC_Appconfig::setValue( 'core', 'backgroundjobs_mode', $type ); + } +}