19 require_once(BASE.
"wcmf/application/controller/class.BatchController.php");
49 for ($i=0; $i<5*($number+1); $i++)
50 array_push($oids, $number.
"-".$i);
54 $callback =
'createFileA';
56 $callback =
'createFileB';
58 return array(
'name' =>
'File '.$number,
'size' => 3,
'oids' => $oids,
'callback' => $callback);
71 foreach ($oids as $oid)
73 $curNum = sprintf(
"%04s",$oid);
74 $fh = fopen(
"result".$curNum.
"_A.txt",
"a");
75 fputs($fh, date(
"F j, Y, g:i a").
": SimpleBatchController created file A #".$curNum.
"\n");
87 foreach ($oids as $oid)
89 $curNum = sprintf(
"%04s",$oid);
90 $fh = fopen(
"result".$curNum.
"_B.txt",
"a");
91 fputs($fh, date(
"F j, Y, g:i a").
": SimpleBatchController created file B #".$curNum.
"\n");
SimpleBatchController is a controller demonstrating the use of BatchController for cutting a long tas...
BatchController allows to define work packages that will be processed in a sequence. It simplifies the usage of LongTaskController functionality for splitting different bigger tasks into many smaller (similar) tasks where the whole number of tasks isn't known at designtime.