com web/pecl: more not used legacy stuff: cron/find-documentation.php cron/generate_rss_pwn.php cron/make-packages.php
| From: | Pierre Joye | Date: | Mon, 30 Mar 2015 06:03:53 +0000 |
| Subject: | com web/pecl: more not used legacy stuff: cron/find-documentation.php cron/generate_rss_pwn.php cron/make-packages.php | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-21984@lists.php.net to get a copy of this message | ||
Commit: bfa3eff0900e50b1c19996e4a0a4ac464fdc8285
Author: Pierre Joye <pierre.php@gmail.com> Mon, 30 Mar 2015 08:03:53 +0200
Parents: 3d935d09158d0105f0aab617db6e03643cf7b7ed
Branches: master
Link: http://git.php.net/?p=web/pecl.git;a=commitdiff;h=bfa3eff0900e50b1c19996e4a0a4ac464fdc8285
Log:
more not used legacy stuff
Changed paths:
D cron/find-documentation.php
D cron/generate_rss_pwn..php
D cron/make-packages.php
diff --git a/cron/find-documentation.php b/cron/find-documentation.php deleted file mode 100755 index ead805c..0000000 --- a/cron/find-documentation.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php -/* - * +----------------------------------------------------------------------+ - * | PEAR Web site version 1.0 | - * +----------------------------------------------------------------------+ - * | Copyright (c) 2003 The PEAR Group | - * +----------------------------------------------------------------------+ - * | This source file is subject to version 2.02 of the PHP license, | - * | that is bundled with this package in the file LICENSE, and is | - * | available at through the world-wide-web at | - * | http://www.php.net/license/2_02.txt. | - * | If you did not receive a copy of the PHP license and are unable to | - * | obtain it through the world-wide-web, please send a note to | - * | license@php.net so we can mail you a copy immediately. | - * +----------------------------------------------------------------------+ - * | Authors: Martin Jansen <mj@php.net> | - * +----------------------------------------------------------------------+ - * - * $Id$ - */ - -/** - * Trying to find documentation URLs for PEAR packages in the peardoc Docbook sources - * - * @version $Revision$ - */ -require_once "PEAR.php"; -require_once "VFS.php"; -require_once "VFS/file.php"; -require_once "HTTP/Request.php"; - -require_once "DB.php"; - -$basepath = "/home/mj/cvs/peardoc/en/package/"; - -$vfs = new VFS_file(array("vfsroot" => $basepath)); - -$dbh = DB::connect("mysql://pear:pear@localhost/pear"); -if (DB::isError($dbh)) { - exit(1); -} - -$update = $dbh->prepare("UPDATE packages SET doc_link = ? WHERE name = ?"); - -// {{{ readFolder() - -function readFolder($folder) { - global $vfs, $basepath, $dbh, $update; - - static $level; - $level++; - - $result = $vfs->listFolder($folder); - - if ($folder == ".") { - $folder = ""; - } - - foreach ($result as $file) { - if (is_dir($basepath . $folder . "/" . $file['name'])) { - if ($folder == "") { - $newfolder = $file['name']; - } else { - $newfolder = $folder . "/" . $file['name']; - } - readFolder($newfolder); - $level--; - } else { - if ($level == 2 && preg_match("/\.xml$/", $file['name'])) { - - $path = $basepath . $folder . "/" . $file['name']; - $content = file_get_contents($path); - - preg_match("/<title>(.*)<\/title>/", $content, $matches1); - preg_match("/<sect1 id\=\"(.*)\">/", $content, $matches2); - - $url = "/manual/en/" . $matches2[1] . ".php"; - - $a = &new HTTP_Request("http://pear.php.net" . $url); - $a->sendRequest(); - - if ($a->getResponseCode() == 404) { - $new_url = preg_replace("=\.([^\.]+)\.php$=", ".php", $url); - - $a->reset("http://pear.php.net/" . $new_url); - - if ($a->getResponseCode() != 404) { - $url = $new_url; - } else { - $url = ""; - } - } - - $res = $dbh->execute($update, array($url, $matches1[1])); - } - } - } -} - -// }}} - -readFolder("."); -?> diff --git a/cron/generate_rss_pwn.php b/cron/generate_rss_pwn.php deleted file mode 100644 index 3e47e58..0000000 --- a/cron/generate_rss_pwn.php +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/local/bin/php -Cq -<?php -/* vim: set expandtab tabstop=4 shiftwidth=4; */ -// +---------------------------------------------------------------------+ -// | PHP version 4.0 | -// +---------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 The PHP Group | -// +---------------------------------------------------------------------+ -// | This source file is subject to version 2.0 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +---------------------------------------------------------------------+ -// | Authors: Pierre-Alain Joye <paj@pearfr.org> | -// +---------------------------------------------------------------------+ -// - -require_once dirname(__FILE__) . '/../include/rss.php'; - -foreach($lang_maps as $id_lang=>$lang){ - list($date,$pwn_html_path) = show_latest($id_lang); - $fp = @fopen($pwn_html_path,'r'); - if($fp){ - $content = ""; - while(!feof($fp)){ - $content .= fgets($fp, 1024); - } - fclose($fp); - - $sections = explode("<!-- SECTION -->",$content); - $cnt_sections = sizeof($sections); - $rdfsequences = ""; - $items = ""; - for($i=1;$i<$cnt_sections;$i++){ - preg_match("/<h3>(.*)<\/h3>/",$sections[$i],$titles); - $section = str_replace( array($titles[0],"\n"), - array('',''), - $sections[$i] - ); - - $section = strip_tags(preg_replace('/<p>/si',"\n",$section)); - $rdfsequences .= str_replace('{link}', $titles[1], $rdfseq); - $cur_item = str_replace('{link_about}', PEAR_SITE_PWN.$i, $item); - $cur_item = str_replace('{title}', $titles[1], $cur_item); - $cur_item = str_replace('{link}', $titles[1], $cur_item); - $cur_item = str_replace('{description}',$section, $cur_item); - $items .= str_replace('{date}', '$date', $cur_item); - } - $pub_date = date("Y-m-d, H:i"); - $rss = str_replace('{encoding}',$iso_maps[$id_lang],$head); - $rss = str_replace('{pub_date}',$pub_date,$rss); - $rss = str_replace('{rdfsequences}',$rdfsequences,$rss).$items.$footer; - $rss_file = PEAR_RSS_PATH.'/'.'pwn_'.$id_lang.'.rss'; - $fp = fopen($rss_file,'w'); - if($fp){ - fputs($fp,$rss); - fclose($fp); - } - } -} - -?> \ No newline at end of file diff --git a/cron/make-packages.php b/cron/make-packages.php deleted file mode 100644 index d9a1602..0000000 --- a/cron/make-packages.php +++ /dev/null @@ -1,213 +0,0 @@ -#!/usr/bin/php -Cq -<?php // -*- C++ -*- -/* vim: set expandtab tabstop=4 shiftwidth=4; */ -// +---------------------------------------------------------------------+ -// | PHP version 4.0 | -// +---------------------------------------------------------------------+ -// | Copyright (c) 1997-2001 The PHP Group | -// +---------------------------------------------------------------------+ -// | This source file is subject to version 2.0 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +---------------------------------------------------------------------+ -// | Authors: Christian Stocker <chregu@phant.ch> | -// | Martin Jansen <mj@php.net> | -// +---------------------------------------------------------------------+ -// - -/** - * This script is used to maintain new PEAR packages: - * - * It walks through PEAR_Dir and looks for a package.xml file - * in each directory. If such a file is found, it's contents - * are read. This contents are stored in a database and a tgz - * file with the sources is created. - * - * WARNING: This code is highly experimental and may still contain - * tons of bugs. - mj - */ - - -require_once "PEAR/Packager.php"; -require_once "DB.php"; - -/** - * Directory where the PEAR packages reside - * @var string - */ -$PEAR_Dir = (isset($argv[1])) ? $argv[1] : '/var/cvs/pear'; -if ($PEAR_Dir{0} != '/') { - die ('Only absolute paths allowed'); -} elseif (!@is_dir($PEAR_Dir)) { - die ("Pear dir: $PEAR_Dir is not valid"); -} -/** - * Directory where to store the TGZ files - * @var string - */ -$TgzDir = (isset($argv[2])) ? $argv[2] : '/var/www/pear/download'; -if ($TgzDir{0} != '/') { - die ('Only absolute paths allowed'); -} elseif (!is_dir($TgzDir) || !is_writeable($TgzDir)) { - die ("Pear dir: $TgzDir is not valid"); -} - -/** -* DSN for pear packages database -*/ -$dsn = "mysql://pear:pear@localhost/pear"; - - -PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'pear_error'); - -if (DB::isError($db = DB::connect($dsn))) { - die ("Couldn't open database -> $dsn\n"); -} - -if (!($dir = opendir($PEAR_Dir))) { - die ("Couldn't open Pear Dir: $PEAR_Dir"); -} - -$xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n"; -$xml .= "<Packages>\n"; - -while ($file = readdir($dir)) { - if (!strstr($file, '.') && !strstr($file, 'CVS') ) - { - chdir ($PEAR_Dir."/".$file); - if (!file_exists("package.xml")) { - continue; - } - - /** - * Build the package release - */ - $packager =& new PEAR_Packager(); - $packager->debug = 0; - $pack_name = $packager->Package(); - if (PEAR::isError($pack_name)) { - echo "Reading of {$PEAR_Dir}/package.xml failed!\n".$pack_name->getMessage(); - chdir ('..'); - continue; - } - - $xml .= - " <Package>\n". - " <Name>".$packager->pkginfo['package']."</Name>\n". - " <Summary>".$packager->pkginfo['summary']."</Summary>\n". - " <Release>\n". - " <Version>".$packager->pkginfo['version']."</Version>\n". - " <Date>".$packager->pkginfo['release_date']."</Date>\n". - " <Notes>".$packager->pkginfo['release_notes']."</Notes>\n". - " </Release>\n". - " </Package>\n"; - - /** - * Look if there is already an entry for the author - */ - $sth = $db->query("SELECT handle - FROM users - WHERE handle = lcase('".$packager->pkginfo['maintainer_handle']."')"); - - if (!DB::isError($sth) && ($sth->numRows() == 0)) { - - $query = sprintf("INSERT INTO users - (handle,name,email,created,createdby) - VALUES ('%s','%s','%s','%s','%s')", - strtolower($packager->pkginfo['maintainer_handle']), - $packager->pkginfo['maintainer_name'], - $packager->pkginfo['maintainer_email'], - date('Y-m-d H:i:s'), - 'mj' //who should be createby? - ); - - $db->query($query); - } - - /** - * Store information for new packages - */ - $sth = $db->query("SELECT name - FROM packages - WHERE name = '".$packager->pkginfo['package']."'"); - - if (!DB::isError($sth) && ($sth->numRows() == 0)) { - $package_id = $db->nextID('packages'); - $query = sprintf("INSERT INTO packages - (name,summary,id) - VALUES ('%s','%s','%s')", - $packager->pkginfo['package'], - $packager->pkginfo['summary'], - $package_id - ); - - $db->query($query); - - $query = sprintf("INSERT INTO maintains - (handle,package) - VALUES ('%s','%s')", - strtolower($packager->pkginfo['maintainer_handle']), - $package_id - ); - - $db->query($query); - } - - /** - * Store information about the current release - */ - $sth = $db->query("SELECT package - FROM releases - WHERE package = '".$packager->pkginfo['package']."' - AND version = '".$packager->pkginfo['version']."'" - ); - - if (!DB::isError($sth) && ($sth->numRows() == 0)) { - - $query = sprintf("INSERT INTO releases - (id,package,version,releasedate,releasenotes,doneby) - VALUES ('%s','%s','%s','%s','%s','%s')", - $db->nextID('releases'), - $packager->pkginfo['package'], - $packager->pkginfo['version'], - $packager->pkginfo['release_date'], - $packager->pkginfo['release_notes'], - 'mj' //who should be doneby? - ); - - $db->query($query); - } - - /** - * Move the tgz file to the new destination - */ - $dest = $TgzDir.'/'.basename($pack_name); - copy($pack_name, $dest); - unlink($pack_name); - - chdir ('..'); - } -} -closedir($dir); - -$xml .= "</Packages>\n"; -$fxml = fopen($TgzDir.'/Packages.xml', 'w'); - -fwrite($fxml, $xml); -fclose($fxml); - -if (function_exists('gzopen')) { - $fxml = gzopen($TgzDir.'/Packages.xml.gz', 'wb'); - gzwrite($fxml, $xml); - gzclose($fxml); -} - -function &pear_error($obj) { - echo $obj->getMessage() . "\n" . $obj->getDebugInfo(). "\n"; - return null; -} -?>
diff --git a/cron/find-documentation.php b/cron/find-documentation.php deleted file mode 100755 index ead805c..0000000 --- a/cron/find-documentation.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php -/* - * +----------------------------------------------------------------------+ - * | PEAR Web site version 1.0 | - * +----------------------------------------------------------------------+ - * | Copyright (c) 2003 The PEAR Group | - * +----------------------------------------------------------------------+ - * | This source file is subject to version 2.02 of the PHP license, | - * | that is bundled with this package in the file LICENSE, and is | - * | available at through the world-wide-web at | - * | http://www.php.net/license/2_02.txt. | - * | If you did not receive a copy of the PHP license and are unable to | - * | obtain it through the world-wide-web, please send a note to | - * | license@php.net so we can mail you a copy immediately. | - * +----------------------------------------------------------------------+ - * | Authors: Martin Jansen <mj@php.net> | - * +----------------------------------------------------------------------+ - * - * $Id$ - */ - -/** - * Trying to find documentation URLs for PEAR packages in the peardoc Docbook sources - * - * @version $Revision$ - */ -require_once "PEAR.php"; -require_once "VFS.php"; -require_once "VFS/file.php"; -require_once "HTTP/Request.php"; - -require_once "DB.php"; - -$basepath = "/home/mj/cvs/peardoc/en/package/"; - -$vfs = new VFS_file(array("vfsroot" => $basepath)); - -$dbh = DB::connect("mysql://pear:pear@localhost/pear"); -if (DB::isError($dbh)) { - exit(1); -} - -$update = $dbh->prepare("UPDATE packages SET doc_link = ? WHERE name = ?"); - -// {{{ readFolder() - -function readFolder($folder) { - global $vfs, $basepath, $dbh, $update; - - static $level; - $level++; - - $result = $vfs->listFolder($folder); - - if ($folder == ".") { - $folder = ""; - } - - foreach ($result as $file) { - if (is_dir($basepath . $folder . "/" . $file['name'])) { - if ($folder == "") { - $newfolder = $file['name']; - } else { - $newfolder = $folder . "/" . $file['name']; - } - readFolder($newfolder); - $level--; - } else { - if ($level == 2 && preg_match("/\.xml$/", $file['name'])) { - - $path = $basepath . $folder . "/" . $file['name']; - $content = file_get_contents($path); - - preg_match("/<title>(.*)<\/title>/", $content, $matches1); - preg_match("/<sect1 id\=\"(.*)\">/", $content, $matches2); - - $url = "/manual/en/" . $matches2[1] . ".php"; - - $a = &new HTTP_Request("http://pear.php.net" . $url); - $a->sendRequest(); - - if ($a->getResponseCode() == 404) { - $new_url = preg_replace("=\.([^\.]+)\.php$=", ".php", $url); - - $a->reset("http://pear.php.net/" . $new_url); - - if ($a->getResponseCode() != 404) { - $url = $new_url; - } else { - $url = ""; - } - } - - $res = $dbh->execute($update, array($url, $matches1[1])); - } - } - } -} - -// }}} - -readFolder("."); -?> diff --git a/cron/generate_rss_pwn.php b/cron/generate_rss_pwn.php deleted file mode 100644 index 3e47e58..0000000 --- a/cron/generate_rss_pwn.php +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/local/bin/php -Cq -<?php -/* vim: set expandtab tabstop=4 shiftwidth=4; */ -// +---------------------------------------------------------------------+ -// | PHP version 4.0 | -// +---------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 The PHP Group | -// +---------------------------------------------------------------------+ -// | This source file is subject to version 2.0 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +---------------------------------------------------------------------+ -// | Authors: Pierre-Alain Joye <paj@pearfr.org> | -// +---------------------------------------------------------------------+ -// - -require_once dirname(__FILE__) . '/../include/rss.php'; - -foreach($lang_maps as $id_lang=>$lang){ - list($date,$pwn_html_path) = show_latest($id_lang); - $fp = @fopen($pwn_html_path,'r'); - if($fp){ - $content = ""; - while(!feof($fp)){ - $content .= fgets($fp, 1024); - } - fclose($fp); - - $sections = explode("<!-- SECTION -->",$content); - $cnt_sections = sizeof($sections); - $rdfsequences = ""; - $items = ""; - for($i=1;$i<$cnt_sections;$i++){ - preg_match("/<h3>(.*)<\/h3>/",$sections[$i],$titles); - $section = str_replace( array($titles[0],"\n"), - array('',''), - $sections[$i] - ); - - $section = strip_tags(preg_replace('/<p>/si',"\n",$section)); - $rdfsequences .= str_replace('{link}', $titles[1], $rdfseq); - $cur_item = str_replace('{link_about}', PEAR_SITE_PWN.$i, $item); - $cur_item = str_replace('{title}', $titles[1], $cur_item); - $cur_item = str_replace('{link}', $titles[1], $cur_item); - $cur_item = str_replace('{description}',$section, $cur_item); - $items .= str_replace('{date}', '$date', $cur_item); - } - $pub_date = date("Y-m-d, H:i"); - $rss = str_replace('{encoding}',$iso_maps[$id_lang],$head); - $rss = str_replace('{pub_date}',$pub_date,$rss); - $rss = str_replace('{rdfsequences}',$rdfsequences,$rss).$items.$footer; - $rss_file = PEAR_RSS_PATH.'/'.'pwn_'.$id_lang.'.rss'; - $fp = fopen($rss_file,'w'); - if($fp){ - fputs($fp,$rss); - fclose($fp); - } - } -} - -?> \ No newline at end of file diff --git a/cron/make-packages.php b/cron/make-packages.php deleted file mode 100644 index d9a1602..0000000 --- a/cron/make-packages.php +++ /dev/null @@ -1,213 +0,0 @@ -#!/usr/bin/php -Cq -<?php // -*- C++ -*- -/* vim: set expandtab tabstop=4 shiftwidth=4; */ -// +---------------------------------------------------------------------+ -// | PHP version 4.0 | -// +---------------------------------------------------------------------+ -// | Copyright (c) 1997-2001 The PHP Group | -// +---------------------------------------------------------------------+ -// | This source file is subject to version 2.0 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +---------------------------------------------------------------------+ -// | Authors: Christian Stocker <chregu@phant.ch> | -// | Martin Jansen <mj@php.net> | -// +---------------------------------------------------------------------+ -// - -/** - * This script is used to maintain new PEAR packages: - * - * It walks through PEAR_Dir and looks for a package.xml file - * in each directory. If such a file is found, it's contents - * are read. This contents are stored in a database and a tgz - * file with the sources is created. - * - * WARNING: This code is highly experimental and may still contain - * tons of bugs. - mj - */ - - -require_once "PEAR/Packager.php"; -require_once "DB.php"; - -/** - * Directory where the PEAR packages reside - * @var string - */ -$PEAR_Dir = (isset($argv[1])) ? $argv[1] : '/var/cvs/pear'; -if ($PEAR_Dir{0} != '/') { - die ('Only absolute paths allowed'); -} elseif (!@is_dir($PEAR_Dir)) { - die ("Pear dir: $PEAR_Dir is not valid"); -} -/** - * Directory where to store the TGZ files - * @var string - */ -$TgzDir = (isset($argv[2])) ? $argv[2] : '/var/www/pear/download'; -if ($TgzDir{0} != '/') { - die ('Only absolute paths allowed'); -} elseif (!is_dir($TgzDir) || !is_writeable($TgzDir)) { - die ("Pear dir: $TgzDir is not valid"); -} - -/** -* DSN for pear packages database -*/ -$dsn = "mysql://pear:pear@localhost/pear"; - - -PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'pear_error'); - -if (DB::isError($db = DB::connect($dsn))) { - die ("Couldn't open database -> $dsn\n"); -} - -if (!($dir = opendir($PEAR_Dir))) { - die ("Couldn't open Pear Dir: $PEAR_Dir"); -} - -$xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n"; -$xml .= "<Packages>\n"; - -while ($file = readdir($dir)) { - if (!strstr($file, '.') && !strstr($file, 'CVS') ) - { - chdir ($PEAR_Dir."/".$file); - if (!file_exists("package.xml")) { - continue; - } - - /** - * Build the package release - */ - $packager =& new PEAR_Packager(); - $packager->debug = 0; - $pack_name = $packager->Package(); - if (PEAR::isError($pack_name)) { - echo "Reading of {$PEAR_Dir}/package.xml failed!\n".$pack_name->getMessage(); - chdir ('..'); - continue; - } - - $xml .= - " <Package>\n". - " <Name>".$packager->pkginfo['package']."</Name>\n". - " <Summary>".$packager->pkginfo['summary']."</Summary>\n". - " <Release>\n". - " <Version>".$packager->pkginfo['version']."</Version>\n". - " <Date>".$packager->pkginfo['release_date']."</Date>\n". - " <Notes>".$packager->pkginfo['release_notes']."</Notes>\n". - " </Release>\n". - " </Package>\n"; - - /** - * Look if there is already an entry for the author - */ - $sth = $db->query("SELECT handle - FROM users - WHERE handle = lcase('".$packager->pkginfo['maintainer_handle']."')"); - - if (!DB::isError($sth) && ($sth->numRows() == 0)) { - - $query = sprintf("INSERT INTO users - (handle,name,email,created,createdby) - VALUES ('%s','%s','%s','%s','%s')", - strtolower($packager->pkginfo['maintainer_handle']), - $packager->pkginfo['maintainer_name'], - $packager->pkginfo['maintainer_email'], - date('Y-m-d H:i:s'), - 'mj' //who should be createby? - ); - - $db->query($query); - } - - /** - * Store information for new packages - */ - $sth = $db->query("SELECT name - FROM packages - WHERE name = '".$packager->pkginfo['package']."'"); - - if (!DB::isError($sth) && ($sth->numRows() == 0)) { - $package_id = $db->nextID('packages'); - $query = sprintf("INSERT INTO packages - (name,summary,id) - VALUES ('%s','%s','%s')", - $packager->pkginfo['package'], - $packager->pkginfo['summary'], - $package_id - ); - - $db->query($query); - - $query = sprintf("INSERT INTO maintains - (handle,package) - VALUES ('%s','%s')", - strtolower($packager->pkginfo['maintainer_handle']), - $package_id - ); - - $db->query($query); - } - - /** - * Store information about the current release - */ - $sth = $db->query("SELECT package - FROM releases - WHERE package = '".$packager->pkginfo['package']."' - AND version = '".$packager->pkginfo['version']."'" - ); - - if (!DB::isError($sth) && ($sth->numRows() == 0)) { - - $query = sprintf("INSERT INTO releases - (id,package,version,releasedate,releasenotes,doneby) - VALUES ('%s','%s','%s','%s','%s','%s')", - $db->nextID('releases'), - $packager->pkginfo['package'], - $packager->pkginfo['version'], - $packager->pkginfo['release_date'], - $packager->pkginfo['release_notes'], - 'mj' //who should be doneby? - ); - - $db->query($query); - } - - /** - * Move the tgz file to the new destination - */ - $dest = $TgzDir.'/'.basename($pack_name); - copy($pack_name, $dest); - unlink($pack_name); - - chdir ('..'); - } -} -closedir($dir); - -$xml .= "</Packages>\n"; -$fxml = fopen($TgzDir.'/Packages.xml', 'w'); - -fwrite($fxml, $xml); -fclose($fxml); - -if (function_exists('gzopen')) { - $fxml = gzopen($TgzDir.'/Packages.xml.gz', 'wb'); - gzwrite($fxml, $xml); - gzclose($fxml); -} - -function &pear_error($obj) { - echo $obj->getMessage() . "\n" . $obj->getDebugInfo(). "\n"; - return null; -} -?>