Example #1
0
                $jumpto = $field;
                break 2;
            }
        }
        $_POST['license'] = trim($_POST['license']);
        if (!strcasecmp($_POST['license'], "GPL") || !strcasecmp($_POST['license'], "LGPL")) {
            display_error("Illegal license type.  PECL packages CANNOT be GPL/LGPL licensed and thus MUST NOT be linked to GPL code.  Talk to pecl-dev@lists.php.net for more information.");
            $jumpto = 'license';
            break;
        }
        if (!preg_match(PEAR_COMMON_PACKAGE_NAME_PREG, $_POST['name'])) {
            display_error("Invalid package name.  PECL package names must be " . "all-lowercase, starting with a letter.");
            break;
        }
        $dbh->expectError(DB_ERROR_ALREADY_EXISTS);
        $pkg = package::add(array('name' => $_POST['name'], 'type' => 'pecl', 'category' => $_POST['category'], 'license' => $_POST['license'], 'summary' => $_POST['summary'], 'description' => $_POST['desc'], 'homepage' => $_POST['homepage'], 'cvs_link' => $_POST['cvs_link'], 'lead' => $auth_user->handle));
        $dbh->popExpect();
        if (DB::isError($pkg) && $pkg->getCode() == DB_ERROR_ALREADY_EXISTS) {
            error_handler("The `" . htmlspecialchars($_POST['name'], ENT_QUOTES) . "' package already exists!", "Package already exists");
            exit;
        }
        $display_form = false;
        response_header("Package Registered");
        print "The package `" . htmlspecialchars($_POST['name'], ENT_QUOTES) . "' has been registered in PECL.<br />\n";
        print "You have been assigned as lead developer.<br />\n";
    }
} while (false);
if ($display_form) {
    $title = "New Package";
    response_header($title);
    print "<h1>{$title}</h1>\n\n<p>Use this form to register a new package.</p>\n\n\n<p>\n<b>Before proceeding</b>, make sure you pick the right name for your\npackage.  This is usually done through \"community consensus\", which\nmeans posting a suggestion to the pecl-dev mailing list and have\npeople agree with you.\n</p>\n\n\n";
Example #2
0
HTTP;HTTP;ssb;Miscellaneous HTTP utilities
HTTP_Uploader;HTTP;cox;Easy and secure managment of files submitted via HTML Forms
IO_Async;Networking;ssb;Backgrounded asynchronous socket IO
Log;Logging;jon;Logging utilities
Net_CheckIP;Networking;mj;Check the syntax of IPv4 adresses
Net_IPv6;Networking;alexmerz;Class to validate and to work with IPv6
Net_NNTP;Networking;kaltroft;Communicate with an NNTP server
Net_Ping;Networking;mj;Execute ping
Net_Whois;Networking;sn;The PEAR::Net_Whois class provides a tool for querying Whois Servers
PEAR;PEAR;ssb;PEAR base classes
Science_Chemistry;Science;jmcastagnetto;Classes to manipulated chemical objects: atoms, molecules, etc.
XML_fo2pdf;XML;chregu;Convert a xsl-fo file to pdf with the help of apache-fop
XML_RPC;XML;ssb;A PEAR-ified version of Useful inc\'s xmlrpc implementation for PHP.
XML_sql2xml;XML;chregu;Represent DB results with XML
XML_Tree;XML;sebastian;Represent XML data in a tree structure
';
$catmap = $dbh->getAssoc("SELECT name,id FROM categories");
foreach (explode("\n", $packages) as $line) {
    if (trim($line) == '') {
        continue;
    }
    list($name, $category, $lead, $summary) = explode(";", trim($line));
    if (empty($catmap[$category])) {
        print "Package: {$name}: skipped - unknown category `{$category}'\n";
        continue;
    } else {
        $catid = $catmap[$category];
    }
    package::add(array('name' => $name, 'type' => 'pear', 'license' => 'PEAR License', 'description' => '', 'summary' => $summary, 'category' => $catid, 'lead' => $lead));
    print "Package: {$name}\n";
}
Example #3
0
 public function popolate($more = array())
 {
     $allpackage = array();
     $pack = new package();
     if (!$this->pkgsfile) {
         $this->pkgsfile = new internet(((substr($this->packages, 0, 7) == "http://" or substr($this->packages, 0, 6) == "ftp://") ? "" : $this->url) . $this->packages);
     }
     if (!$this->pkgsfile->exists()) {
         return false;
     }
     $i = 0;
     while (!is_null($pkg = $pack->fetch($this->pkgsfile))) {
         if ($pkg) {
             $id = $pack->add($pkg, array('repository' => $this->id), $more);
             if (!$id) {
                 return false;
             }
             if (isset($_SERVER['DEBUG'])) {
                 echo $id . " -> " . $pack->filename . "               \n";
             }
             if (isset($_SERVER["_"])) {
                 echo "\r(packages {$i}: " . $pkg['name'] . "               ";
             } else {
                 echo ".";
             }
             $allpackage[$pack->filename] = $id;
             $i++;
         }
     }
     $this->pkgsfile->close();
     if (!$this->db->query("update #__repository set npkgs='{$i}' where id='{$this->id}'")) {
         var_dump($this->db);
     }
     if (isset($_SERVER["_"])) {
         echo "\r(packages: {$i}                                            \n";
     } else {
         echo "\n [{$i} packages] \n";
     }
     $list = new filelist();
     if ($this->manifest) {
         $this->manifile = new internet($this->url . $this->manifest);
         if (!($i = $list->addall($allpackage, $this))) {
             var_dump($i);
             return false;
         }
         if (!$this->db->query("update #__repository set nfiles='{$i}' where id='{$this->id}'")) {
             var_dump($this->db);
         }
     }
     if (!$this->pkgsfile->exists()) {
         return false;
     }
     $this->mtime = $this->pkgsfile->head['Last-Modified'];
     $repo['mtime'] = $this->mtime;
     if (!$this->db->query("update #__repository set mtime='" . $this->mtime . "' where id=" . $this->id)) {
         return false;
     }
     return true;
 }