Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

16 lines (15 sloc) 0.617 kb
<?php
require_once 'DB.php';
require_once 'Archive/Tar.php';
// before running this file, please run
// ALTER TABLE files ADD packagexml TEXT NOT NULL DEFAULT "";
$dbh = &DB::connect('mysql://pear:pear@localhost/pear');
$rows = $dbh->getAssoc("SELECT fullpath, `release`, id FROM files", false, null, DB_FETCHMODE_ASSOC);
foreach ($rows as $file => $info) {
$tar = &new Archive_Tar($file);
if ($packagexml = $tar->extractInString('package.xml')) {
$dbh->query('UPDATE files SET packagexml = ? WHERE `release` = ? AND id = ?', array($packagexml,
$info['release'], $info['id']));
}
}
?>
Jump to Line
Something went wrong with that request. Please try again.