/adei/ui

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

« back to all changes in this revision

Viewing changes to system/clean.php

  • Committer: Suren A. Chilingaryan
  • Date: 2008-04-02 10:23:22 UTC
  • Revision ID: csa@dside.dyndns.org-20080402102322-okib92sicg2dx3o3
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
require("../adei.php");
 
3
 
 
4
/*
 
5
$config = array (
 
6
    "db_server" => "katrin",
 
7
    "db_name" => "hauptspektrometer"
 
8
);
 
9
*/
 
10
 
 
11
function DoClean(&$req) {
 
12
    try {
 
13
        $reader = $req->CreateReader(REQUEST::READER_FORBID_CACHEREADER);
 
14
 
 
15
        $list = $req->GetGroupList();
 
16
        foreach ($list as $greq) {
 
17
            $lg = $reader->CreateGroup($greq->GetGroupInfo());
 
18
            $reader->Clean($lg);
 
19
        }
 
20
    } catch(ADEIException $e) {
 
21
        $error = $e->getMessage();
 
22
    }
 
23
 
 
24
    return $error?$error:0;
 
25
}
 
26
 
 
27
$req = new REQUEST($config);
 
28
$list = $req->GetSourceList();
 
29
 
 
30
foreach ($list as $sreq) {
 
31
    $err = DoClean($sreq);
 
32
    if ($err) 
 
33
        echo $sreq->GetLocationString() . ", Error: $err\n";
 
34
}
 
35
 
 
36
?>
 
 
b'\\ No newline at end of file'