/openshift/adei

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

« back to all changes in this revision

Viewing changes to setups/katrin/classes/kdbrunidentifier.php

  • Committer: Suren A. Chilingaryan
  • Date: 2012-02-07 22:44:15 UTC
  • Revision ID: csa@dside.dyndns.org-20120207224415-sy360wa1ammhd1ph
Use localization subsystem, updated Katrin configs

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
class KDBRunIdentifier
8
8
{
9
 
    private $fSystem = kSystemInvalid;
10
 
    private $fRun = 0;
11
 
    private $fSubrun = 0;
 
9
    public $system = kSystemInvalid;
 
10
    public $number = 0;
 
11
    public $subRun = 0;
12
12
    
13
13
    function __construct()
14
14
    {
17
17
        }
18
18
        else {
19
19
            if (func_num_args() >= 1) {
20
 
                $this->fSystem = func_get_arg(0);
 
20
                $this->system = func_get_arg(0);
21
21
            }
22
22
            if (func_num_args() >= 2) {
23
 
                $this->fRun = func_get_arg(1);
 
23
                $this->number = func_get_arg(1);
24
24
            }
25
25
            if (func_num_args() >= 3) {
26
 
                $this->fSubrun = func_get_arg(2);
 
26
                $this->subRun = func_get_arg(2);
27
27
            }
28
28
        }
29
29
    }
30
30
 
31
31
    function GetRun()
32
32
    {
33
 
        return $this->fRun;
 
33
        return $this->number;
34
34
    }
35
35
 
36
36
    function GetSubRun()
37
37
    {
38
 
        return $this->fSubrun;
 
38
        return $this->subRun;
39
39
    }
40
40
 
41
41
    function SetSubRun($subrun)
42
42
    {
43
 
        $this->fSubrun = $subrun;
 
43
        $this->subRun = $subrun;
44
44
    }
45
45
 
46
46
    function GetSystem()
47
47
    {
48
 
        return $this->fSystem;
 
48
        return $this->system;
49
49
    }
50
50
 
51
51
    function GetRunName()
52
52
    {
53
 
        return sprintf("%s%08d", $this->GetSystemName(), $this->fRun);
 
53
        return sprintf("%s%08d", $this->GetSystemName(), $this->number);
54
54
    }
55
55
 
56
56
    function GetName()
57
57
    {
58
58
        $name = $this->GetRunName();
59
 
        if ($this->fSubrun != 0) {
60
 
            $name .= sprintf(".%05d", $this->fSubrun);
 
59
        if ($this->subRun != 0) {
 
60
            $name .= sprintf(".%05d", $this->subRun);
61
61
        }
62
62
 
63
63
        return $name;
65
65
 
66
66
    function IsValid()
67
67
    {
68
 
        return $this->fSystem != kSystemInvalid && $this->fRun != 0;
 
68
        return $this->system != kSystemInvalid && $this->number != 0;
69
69
    }
70
70
 
71
71
    private function ParseString($text)
74
74
        
75
75
        if (preg_match($pattern, $text, $matches)) {
76
76
            try {
77
 
                $this->fSystem =
 
77
                $this->system =
78
78
                    KDBConstants::OrcaSystemValue($matches['system']);
79
79
            }
80
80
            catch (ADEIException $e) {
81
 
                $this->fSystem = kSystemInvalid;
 
81
                $this->system = kSystemInvalid;
82
82
            }
83
83
            
84
 
            $this->fRun = (int) $matches['run'];
 
84
            $this->number = (int) $matches['run'];
85
85
            if (array_key_exists('subrun', $matches)) {
86
 
                $this->fSubrun = (int) $matches['subrun'];
 
86
                $this->subRun = (int) $matches['subrun'];
87
87
            }
88
88
        }
89
89
    }
90
90
 
91
91
    private function GetSystemName()
92
92
    {
93
 
        switch ($this->fSystem) {
94
 
            case kSystemMainSpec:
95
 
                return 'kms';
96
 
            case kSystemPreSpec:
97
 
                return 'kps';
98
 
            default:
99
 
                return 'xxx';
100
 
        }
 
93
        return KDBConstants::OrcaSystemName($this->system);
101
94
    }
102
95
}
103
 
 
104
 
?>
 
96
?>
 
 
b'\\ No newline at end of file'