Rename Backgroundjobs to BackgroundJob

This commit is contained in:
Jakob Sack 2012-08-08 23:59:30 +02:00
parent 4f90860001
commit 6025d2ebc3
3 changed files with 10 additions and 11 deletions

View File

@ -23,7 +23,7 @@
/**
* This class manages the regular tasks.
*/
class OC_Backgroundjobs_RegularTask{
class OC_BackgroundJob_RegularTask{
static private $registered = array();
/**
@ -32,7 +32,7 @@ class OC_Backgroundjobs_RegularTask{
* @param $method method name
* @return true
*/
static public function create( $klass, $method ){
static public function register( $klass, $method ){
// Create the data structure
self::$registered["$klass-$method"] = array( $klass, $method );

View File

@ -1,5 +1,4 @@
<?php
/**
* ownCloud - Background Job
*
@ -24,7 +23,7 @@
/**
* This class manages our scheduled tasks.
*/
class OC_Backgroundjobs_ScheduledTask{
class OC_BackgroundJob_ScheduledTask{
/**
* @brief Gets one scheduled task
* @param $id ID of the task

View File

@ -25,7 +25,7 @@
*
* TODO: locking in doAllSteps
*/
class OC_Backgroundjobs_Worker{
class OC_BackgroundJob_Worker{
/**
* @brief executes all tasks
* @return boolean
@ -36,16 +36,16 @@ class OC_Backgroundjobs_Worker{
*/
public static function doAllSteps(){
// Do our regular work
$regular_tasks = OC_Backgroundjobs_RegularTask::all();
$regular_tasks = OC_BackgroundJob_RegularTask::all();
foreach( $regular_tasks as $key => $value ){
call_user_func( $value );
}
// Do our scheduled tasks
$scheduled_tasks = OC_Backgroundjobs_ScheduledTask::all();
$scheduled_tasks = OC_BackgroundJob_ScheduledTask::all();
foreach( $scheduled_tasks as $task ){
call_user_func( array( $task['klass'], $task['method'] ), $task['parameters'] );
OC_Backgroundjobs_ScheduledTask::delete( $task['id'] );
OC_BackgroundJob_ScheduledTask::delete( $task['id'] );
}
return true;
@ -67,7 +67,7 @@ class OC_Backgroundjobs_Worker{
$lasttask = OC_Appconfig::getValue( 'core', 'backgroundjobs_task', '' );
// What's the next step?
$regular_tasks = OC_Backgroundjobs_RegularTask::all();
$regular_tasks = OC_BackgroundJob_RegularTask::all();
ksort( $regular_tasks );
$done = false;
@ -87,12 +87,12 @@ class OC_Backgroundjobs_Worker{
}
}
else{
$tasks = OC_Backgroundjobs_ScheduledTask::all();
$tasks = OC_BackgroundJob_ScheduledTask::all();
if( length( $tasks )){
$task = $tasks[0];
// delete job before we execute it. This prevents endless loops
// of failing jobs.
OC_Backgroundjobs_ScheduledTask::delete($task['id']);
OC_BackgroundJob_ScheduledTask::delete($task['id']);
// execute job
call_user_func( array( $task['klass'], $task['method'] ), $task['parameters'] );