/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to system/cache.php

  • Committer: Suren A. Chilingaryan
  • Date: 2018-02-22 19:40:13 UTC
  • Revision ID: csa@suren.me-20180222194013-48h84dboijcylyqj
Initial release of scheduling service

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#adeiLogOutput();
24
24
 
25
25
$verbose = 0;
 
26
$archives = 0;
26
27
$list_flags = 0;
27
28
$user_req = new REQUEST($config);
28
29
$source_param = "";
32
33
    $pos = array_search("-verbose", $_SERVER['argv']);
33
34
    if ($pos) $verbose = 1;
34
35
 
35
 
    $pos = array_search("-archives", $_SERVER['argv']);
36
 
    if ($pos) $list_flags = REQUEST::LIST_ALL|REQUEST::LIST_WILDCARDED;
 
36
    $archives = array_search("-archives", $_SERVER['argv']);
 
37
    if ($archives) $list_flags = REQUEST::LIST_ALL|REQUEST::LIST_WILDCARDED;
37
38
 
38
39
    $pos = array_search("-source", $_SERVER['argv']);
39
40
 
47
48
    }
48
49
 
49
50
    $pos = array_search("-parallel", $_SERVER['argv']);
50
 
    if ($pos) {
 
51
    if ((!$ADEI_CACHE_SCHEDULER)&&($pos)) {
51
52
        if ($source_param)
52
53
            throw new ADEIException(translate("The source can't be specified in the parallel mode"));
53
54
        
274
275
}
275
276
 
276
277
$list = $user_req->GetSources($list_flags);
277
 
foreach ($list as $sreq) {
278
 
    if (isset($user_req->props['db_server'])&&($user_req->props['db_server'] != $sreq->props['db_server'])) continue;
279
 
    if (isset($user_req->props['db_name'])&&($user_req->props['db_name'] != $sreq->props['db_name'])) continue;
280
 
    $err = DoCache($sreq);
281
 
    if ($err) echo "$err\n\n\n";
 
278
if ($ADEI_CACHE_SCHEDULER) {
 
279
    $sched = new SCHEDULER($user_req, ($archives?SCHEDULER::FLAG_ARCHIVES:SCHEDULER::FLAGS_STANDARD));
 
280
    $sched->Schedule($list);
 
281
} else {
 
282
    foreach ($list as $sreq) {
 
283
        if (isset($user_req->props['db_server'])&&($user_req->props['db_server'] != $sreq->props['db_server'])) continue;
 
284
        if (isset($user_req->props['db_name'])&&($user_req->props['db_name'] != $sreq->props['db_name'])) continue;
 
285
 
 
286
        $err = DoCache($sreq);
 
287
        if ($err) echo "$err\n\n\n";
 
288
    }
282
289
}
 
290
 
 
291
    
 
292
 
 
293
 
 
294
 
283
295
?>
 
 
b'\\ No newline at end of file'