4 error_reporting(E_ALL
& ~
(E_DEPRECATED|E_STRICT
));
7 fprintf(STDERR
, "Usage: %s <path/to/package.xml>\n", $argv[0]);
11 require_once "PEAR/Config.php";
12 require_once "PEAR/PackageFile.php";
14 define("PACKAGE_XML", $argv[1]);
15 define("PACKAGE_DIR", dirname(PACKAGE_XML
));
17 $factory = new PEAR_PackageFile(PEAR_Config
::singleton());
18 $pf = $factory->fromPackageFile($argv[1], PEAR_VALIDATE_NORMAL
);
20 if (PEAR
::isError($pf)) {
21 fprintf(STDERR
, "ERROR: %s\n", $pf->getMessage());
22 if (is_array($infos = $pf->getUserInfo())) {
23 foreach ($infos as $info) {
24 fprintf(STDERR
, " %s\n", $info["message"]);
26 } elseif (strlen($infos)) {
27 fprintf(STDERR
, " %s\n", $infos);
32 foreach ($pf->getValidationWarnings() as $warning) {
33 fprintf(STDERR
, "%s: %s\n", strtoupper($warning["level"]), $warning["message"]);
37 foreach ($pf->getFilelist() as $file => $attr) {
38 if (!file_exists(PACKAGE_DIR
."/".$file)) {
40 fprintf(STDERR
, "File '%s' with role '%s' not found in '%s'\n",
41 $file, $attr["role"], PACKAGE_DIR
);
46 fprintf(STDERR
, "%3d failure(s)\n", $exit);