#!/usr/bin/env php packageInfo($pkgname, null, $channel); if ($pkginfo === null) { echo 'Package not found: ' . $dep . "\n"; exit(1); } echo "Copying " . $channel . '/' . $pkgname . "\n"; $files = 0; foreach ($pkginfo['filelist'] as $fileinfo) { if ($fileinfo['role'] != 'php') { continue; } $orig = $fileinfo['installed_as']; $path = $libdir . ltrim( $fileinfo['baseinstalldir'] . '/' . $fileinfo['name'], '/' ); $dir = dirname($path); if (!is_dir($dir)) { mkdir($dir, 0777, true); } if (!copy($orig, $path)) { echo " Error copying $orig to $path\n"; exit(2); } ++$files; } echo " copied $files files\n"; } ?>