|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56599 license should be a drop down
Submitted: 2005-10-18 06:27 UTC Modified: 2006-02-18 09:07 UTC
From: Assigned: mj (profile)
Status: Not a bug Package: PECL website (PECL)
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2005-10-18 06:27 UTC]
The license field should be a drop down with all allowed choices. Also there should be a note somewhere on pearweb that the license listed on the package choice is irrelevant if the license headers in the actual source code is different.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-18 11:21 UTC]
I should add that this fix is somewhat pressing .. as the form currently is too short to add "APACHE LICENSE VERSION 2.0" for example ..
 [2005-10-18 12:12 UTC]
Since I am still a pearweb n00b .. with no local pearweb running .. here goes a diff ..

Index: public_html/package-edit.php
RCS file: /repository/pearweb/public_html/package-edit.php,v
retrieving revision 1.35
diff -w -b -r1.35 package-edit.php
<     <?php $form->displayText('license', $row['license'], 50, 20); ?>
> <?php
> $sth = $dbh->query('SELECT name FROM licenses ORDER BY name');
> while ($license_row = $sth->fetchRow(DB_FETCHMODE_ASSOC)) {
>     $rows[$license_row['name']] = $license_row['name'];
> }
> $form->displaySelect("license", $rows, (int)$row['license']);
> ?>
>     <?php $form->displayText('license', $row['license'], 50, 50); ?>
Index: public_html/package-new.php
RCS file: /repository/pearweb/public_html/package-new.php,v
retrieving revision 1.35
diff -w -b -r1.35 package-new.php
>     $licenses = $dbh->getAssoc("SELECT name AS id,name FROM licenses ORDER BY name");
<     $bb->horizHeadRow("License", $form->returnText("license", get("license"), 20));
>     $lics = $form->returnSelect("license", $licenses, get("license"), 1,
>                                 "--Select License--");
>     $bb->horizHeadRow("License", $lics);
Index: sql/packages.sql
RCS file: /repository/pearweb/sql/packages.sql,v
retrieving revision 1.17
diff -w -b -r1.17 packages.sql
<   license varchar(20) default NULL,
>   license varchar(50) default NULL,
Index: include/pear-format-html.php
RCS file: /repository/pearweb/include/pear-format-html.php,v
retrieving revision 1.176
diff -w -b -r1.176 pear-format-html.php
<     switch ($license) {
<         case 'PHP License' :
<         case 'PHP 2.02' :
<             $link = '';
<             break;
<         case 'GPL' :
<         case 'GNU General Public License' :
<             $link = '';
<             break;
<         case 'LGPL' :
<         case 'GNU Lesser General Public License' :
<             $link = '';
<             break;
<         default :
<             $link = '';
<             break;
<     }
>     global $dbh;
>     $link = $dbh->getOne("SELECT link FROM licenses WHERE name = ?", array($license));
 [2005-10-18 14:54 UTC]
As a start, the packages table on has been altered so that the license field now takes up to 50 characters.
 [2005-10-18 15:07 UTC]
I don't think that converting the text box into a select field is a wise idea, because we allow *all* BSD-style licenses for PEAR packages and thus everybody could come up with some flavour of the original BSD license which would be not included in our select field.  Another problem is that we would have to maintain a huge number of entries for the field because usually every license exists in different versions.  (Think of PHP 2.02 vs. 3.0.)
 [2005-10-18 15:18 UTC]
either way .. get_license_link() suffers form the same issue ..
 [2006-02-18 09:07 UTC]
Sorry, but your problem does not imply a bug in PEAR itself.  For a
list of more appropriate places to ask for help using PEAR, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PEAR.

I agree with Martin here, but either the PEAR Group or QA should review the licenses for every new package.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 16:03:36 2021 UTC