/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 admin/loginfo.php

  • Committer: Suren A. Chilingaryan
  • Date: 2008-06-24 22:40:51 UTC
  • Revision ID: csa@dside.dyndns.org-20080624224051-cskdaw8zruv0z4zx
Logger subsystem

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
    function ShowTime($tm) {
 
4
        return $tm->format("F j, Y h:i:s.uP");
 
5
    }
 
6
 
 
7
 
 
8
    $logfile = $_REQUEST['logfile'];
 
9
    $logpos = $_REQUEST['logpos'];
 
10
 
 
11
    $info = adeiGetLogInfo($logfile, $logpos);
 
12
    
 
13
    ?><br/><table class="loginfo"><tr>
 
14
        <tr>
 
15
            <th><?echo translate("Time");?></th>
 
16
            <td><?echo ShowTime($info['time']);?></td>
 
17
        </tr>
 
18
        <tr>
 
19
            <th><?echo translate("Setup");?></th>
 
20
            <td><?echo $info['setup'];?></td>
 
21
        </tr>
 
22
        <tr>
 
23
            <th><?echo translate("Source");?></th>
 
24
            <td><?echo $info['source'];?></td>
 
25
        </tr>
 
26
        <tr>
 
27
            <th><?echo translate("Session");?></th>
 
28
            <td><?echo $info['session'];?></td>
 
29
        </tr>
 
30
        <tr>
 
31
            <th><?echo translate("Priority");?></th>    
 
32
            <td><?echo $info['priority'];?></td>
 
33
        </tr>
 
34
        <tr>
 
35
            <th><?echo translate("Request");?></th>    
 
36
            <td><?
 
37
                if ($info['request']) echo $info['request'];
 
38
                else echo "-";
 
39
            ?></td>
 
40
        </tr>
 
41
            <th><?echo translate("Message");?></th>    
 
42
            <td><?
 
43
                if ($info['message']) echo $info['message'];
 
44
                else echo "-";
 
45
            ?></td>
 
46
        <tr>
 
47
        </tr>
 
48
    </table><br/><?
 
49
    
 
50
    if ($info['exception']) {
 
51
        echo "<h4>" . translate("Exception: ") . "</h4>";
 
52
        
 
53
        $ae = unserialize($info['exception']);
 
54
        echo translate("Code: %d", $ae->getCode()) . "<br/>";
 
55
        echo translate("Message: %s", $ae->getMessage()) . "<br/>";
 
56
        echo translate("Location: %s:%d", $ae->getFile(), $ae->getLine()) . "<br/>";
 
57
        
 
58
        echo "<h4>" . translate("Backtrace: ") . "</h4>";
 
59
        echo "<pre>";
 
60
        print_r($ae->getTrace());
 
61
        echo "</pre>";
 
62
    }
 
63
    
 
64
    if ($info['GET']) {
 
65
        echo "<h4>" . translate("GET options: ") . "</h4>";
 
66
        echo "<pre>";
 
67
        print_r($info['GET']);
 
68
        echo "</pre>";
 
69
    }
 
70
 
 
71
    if ($info['POST']) {
 
72
        echo "<h4>" . translate("POST options: ") . "</h4>";
 
73
        echo "<pre>";
 
74
        print_r($info['POST']);
 
75
        echo "</pre>";
 
76
    }
 
77
 
 
78
    if ($info['RAW_DATA']) {
 
79
        echo "<h4>" . translate("POST data: ") . "</h4>";
 
80
        echo "<pre>";
 
81
        print_r($info['RAW_DATA']);
 
82
        echo "</pre>";
 
83
    }
 
84
 
 
85
    if ($info['object']) {
 
86
        echo "<h4>" . translate("Affected Object: ") . "</h4>";
 
87
 
 
88
        echo "<pre>";
 
89
        print_r(unserialize($info['object']));
 
90
        echo "</pre>";
 
91
    }
 
92
 
 
93
    if ($info['result']) {
 
94
        echo "<h4>" . translate("Result: ") . "</h4>";
 
95
        if (preg_match("/(getimage|getlogo)/", $info['source'])) {
 
96
            $data = pack("H*", $info['result']);
 
97
            $image = new Imagick();
 
98
            if ($image) {
 
99
                $image->readImageBlob($data);
 
100
                $format = $image->getImageFormat();
 
101
                $geometry = $image->getImageGeometry();
 
102
                $size = $image->getImageSize();
 
103
                echo translate("Image Information: %s, %dx%d, %s", $format, $geometry['width'], $geometry['height'], dsPrintSize($size)) . "<br/>";
 
104
#               print_r($image->identifyImage());
 
105
            }    
 
106
            //PNG print_r($image->getImageFormat());
 
107
            
 
108
            echo "<img src=\"logimage.php?logfile=$logfile&logpos=$logpos\"/>";
 
109
        } else {
 
110
            $data = pack("H*", $info['result']);
 
111
            echo "<pre>";
 
112
            echo htmlentities($data);
 
113
            echo "</pre>";
 
114
        }
 
115
    }
 
116
 
 
117
//    print_r($info);
 
118
?>
 
 
b'\\ No newline at end of file'