4 * reads pear package dependencies from deps.txt and copies them into lib/
6 $deps = file(__DIR__ . '/../deps.txt');
7 $libdir = __DIR__ . '/../lib/';
9 error_reporting(error_reporting() & ~E_STRICT & ~E_DEPRECATED);
10 require_once 'PEAR/Registry.php';
11 $reg = new PEAR_Registry();
13 foreach ($deps as $dep) {
15 list($channel, $pkgname) = explode('/', $dep);
16 $pkginfo = $reg->packageInfo($pkgname, null, $channel);
17 if ($pkginfo === null) {
18 echo 'Package not found: ' . $dep . "\n";
22 echo "Copying " . $channel . '/' . $pkgname . "\n";
24 foreach ($pkginfo['filelist'] as $fileinfo) {
25 if ($fileinfo['role'] != 'php') {
29 $orig = $fileinfo['installed_as'];
30 $path = $libdir . ltrim(
31 $fileinfo['baseinstalldir'] . '/' . $fileinfo['name'], '/'
33 $dir = dirname($path);
35 mkdir($dir, 0777, true);
37 if (!copy($orig, $path)) {
38 echo " Error copying $orig to $path\n";
43 echo " copied $files files\n";