File: pear_registry_inc.php.inc

package info (click to toggle)
php-pear 1%3A1.10.13%2Bsubmodules%2Bnotgz%2B2022032202-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 18,516 kB
  • sloc: php: 52,984; ansic: 39,986; xml: 33,175; yacc: 677; pascal: 452; makefile: 122; sh: 114
file content (48 lines) | stat: -rw-r--r-- 1,435 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php

// ------------------------------------------------------------------------- //

function dumpall(&$reg)
{
    print "dumping registry...\n";
    $infos = $reg->allPackageInfo();
    foreach ($infos as $channel => $info) {
        echo "channel $channel:\n";
        foreach ($info as $pkg) {
            print $pkg["name"] . ":";
            unset($pkg["name"]);
            foreach ($pkg as $k => $v) {
                if ($k == '_lastmodified') continue;
                if (is_array($v) && $k == 'filelist') {
                    print " $k=array(";
                    $i = 0;
                    foreach ($v as $k2 => $v2) {
                        if ($i++ > 0) print ",";
                        print "{$k2}[";
                        $j = 0;
                        foreach ($v2 as $k3 => $v3) {
                            if ($j++ > 0) print ",";
                            print "$k3=$v3";
                        }
                        print "]";
                    }
                    print ")";
                } else {
                    print " $k=\"$v\"";
                }
            }
            print "\n";
        }
    }
    print "dump done\n";
}

require_once 'PEAR/ErrorStack.php';
function dump_error($err)
{
    echo "caught ErrorStack error:\n";
    echo "message: ". $err['message'] . "\n";
    echo "code: ". $err['code'] . "\n";
}
PEAR_ErrorStack::setDefaultCallback('dump_error');
?>