]> granicus.if.org Git - php/commitdiff
* Add support for <provides />
authorMartin Jansen <mj@php.net>
Thu, 5 Jun 2003 06:32:10 +0000 (06:32 +0000)
committerMartin Jansen <mj@php.net>
Thu, 5 Jun 2003 06:32:10 +0000 (06:32 +0000)
# Bug: #23933

pear/PEAR/Command/Registry.php

index 20860cf4a2340a669be14800c5d9245d691e9ebd..01029df1ac2bab4f356dda65699bd6bf76732bbf 100644 (file)
@@ -284,6 +284,36 @@ installed package.'
                         $info[$key] = $dstr;
                         break;
                     }
+                    case 'provides' : {
+                        $debug = $this->config->get('verbose');
+                        if ($debug < 2) {
+                            $pstr = 'Classes: ';
+                        } else {
+                            $pstr = '';
+                        }
+                        foreach ($info[$key] as $p) {
+                            if ($debug < 2 && $p['type'] != "class") {
+                                continue;
+                            }
+                            // Only print classes when verbosity mode is < 2
+                            if ($debug < 2) {
+                                if ($i++ > 0) {
+                                    $pstr .= ", ";
+                                }
+                                $pstr .= $p['name'];
+                            } else {
+                                if ($i++ > 0) {
+                                    $pstr .= "\n";
+                                }
+                                $pstr .= ucfirst($p['type']) . " " . $p['name'];
+                                if (isset($p['explicit']) && $p['explicit'] == 1) {
+                                    $pstr .= " (explicit)";
+                                }
+                            }
+                        }
+                        $info[$key] = $pstr;
+                        break;
+                    }
                     default: {
                         $info[$key] = implode(", ", $info[$key]);
                         break;