ultimix
schedule_algorithms.php
Go to the documentation of this file.
1 <?php
2 
3  /*
4  * This source code is a part of the Ultimix Project.
5  * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
6  * it's own license wich could be found from the corresponding files or sources.
7  * This source code is provided "as is" without any warranties or garanties.
8  *
9  * Have a nice day!
10  *
11  * @url http://ultimix.sorceforge.net
12  *
13  * @author Alexey "gdever" Dodonov
14  */
15 
27 
38  var $ScheduleAccess = false;
39  var $Security = false;
40 
51  function __construct()
52  {
53  try
54  {
55  $this->ScheduleAccess = get_package( 'schedule::schedule_access' , 'last' , __FILE__ );
56  $this->Security = get_package( 'security' , 'last' , __FILE__ );
57  }
58  catch( Exception $e )
59  {
60  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
61  }
62  }
63 
82  function get_tasks( $Count )
83  {
84  try
85  {
86  $Count = $this->Security->get( $Count , 'integer' );
87 
88  return(
89  $this->ScheduleAccess->unsafe_select(
90  "processing = 0 AND archived = 0 AND next_processing_time < NOW() ".
91  "ORDER BY next_processing_time ASC LIMIT 0 , $Count"
92  )
93  );
94  }
95  catch( Exception $e )
96  {
97  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
98  }
99  }
100  }
101 
102 ?>