$filename = "{$name}-{$version}.tgz"; $destfilename = "{$dist_dir}/PEAR/go-pear-bundle/{$filename}"; if (file_exists($destfilename)) { continue; } $url = "http://pear.php.net/get/{$filename}"; echo "Downloading {$name} from {$url}\n"; flush(); copy($url, $destfilename); } echo "Download complete. Extracting bootstrap files\n"; /* Now, we want PEAR.php, Getopt.php (Console_Getopt) and Tar.php (Archive_Tar) * broken out of the tarballs */ extract_file_from_tarball('PEAR', 'PEAR.php', "{$dist_dir}/PEAR/go-pear-bundle"); extract_file_from_tarball('Archive_Tar', 'Archive/Tar.php', "{$dist_dir}/PEAR/go-pear-bundle"); extract_file_from_tarball('Console_Getopt', 'Console/Getopt.php', "{$dist_dir}/PEAR/go-pear-bundle"); } /* add extras from the template dir */ if (file_exists($snapshot_template)) { $items = glob("{$snapshot_template}/*"); print_r($items); foreach ($items as $item) { $bi = basename($item); if (is_dir($item)) { if ($bi == 'dlls' || $bi == 'symbols') { continue; } else { if ($bi == 'PEAR') { if ($use_pear_template) { /* copy to top level */ copy_dir($item, "{$dist_dir}/{$bi}");
echo "Downloading go-pear.bat\n"; copy("http://cvs.php.net/viewvc.cgi/pear-core/scripts/go-pear.bat?revision=1.1", "{$dist_dir}/go-pear.bat"); /* This is a list of packages and versions * that will be used to create the PEAR folder * in the windows snapshot. */ $packages = array("PEAR" => "1.5.1", "Console_Getopt" => "1.2.1", "Archive_Tar" => "1.3.2", "Structures_Graph" => "1.0.2", "PEAR_Frontend_Web" => "0.5.1", "HTML_Template_IT" => "1.1.4", "Net_UserAgent_Detect" => "2.0.1"); /* download the packages into the destination */ echo "Fetching packages\n"; foreach ($packages as $name => $version) { $filename = "{$name}-{$version}.tgz"; $destfilename = "{$dist_dir}/PEAR/go-pear-bundle/{$filename}"; if (file_exists($destfilename)) { continue; } $url = "http://pear.php.net/get/{$filename}"; echo "Downloading {$name} from {$url}\n"; flush(); copy($url, $destfilename); } echo "Download complete. Extracting bootstrap files\n"; /* Now, we want PEAR.php, Getopt.php (Console_Getopt) and Tar.php (Archive_Tar) * broken out of the tarballs */ extract_file_from_tarball('PEAR', 'PEAR.php', "{$dist_dir}/PEAR/go-pear-bundle"); extract_file_from_tarball('Archive_Tar', 'Archive/Tar.php', "{$dist_dir}/PEAR/go-pear-bundle"); extract_file_from_tarball('Console_Getopt', 'Console/Getopt.php', "{$dist_dir}/PEAR/go-pear-bundle"); extract_file_from_tarball('Structures_Graph', 'Structures/Graph.php', "{$dist_dir}/PEAR/go-pear-bundle"); extract_file_from_tarball('Structures_Graph', 'Structures/Graph/Node.php', "{$dist_dir}/PEAR/go-pear-bundle"); extract_file_from_tarball('Structures_Graph', 'Structures/Graph/Manipulator/AcyclicTest.php', "{$dist_dir}/PEAR/go-pear-bundle"); extract_file_from_tarball('Structures_Graph', 'Structures/Graph/Manipulator/TopologicalSorter.php', "{$dist_dir}/PEAR/go-pear-bundle");