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());
25 foreach ($pf->getValidationWarnings() as $warning) {
26 fprintf(STDERR
, "%s: %s\n", strtoupper($warning["level"]), $warning["message"]);
30 foreach ($pf->getFilelist() as $file => $attr) {
31 if (!file_exists(PACKAGE_DIR
."/".$file)) {
33 fprintf(STDERR
, "File '%s' with role '%s' not found in '%s'\n",
34 $file, $attr["role"], PACKAGE_DIR
);
39 fprintf(STDERR
, "%3d failure(s)\n", $exit);