php.net |  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: lsmith@php.net Assigned: mj (profile)
Status: Not a bug Package: PECL website (PECL)
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
 [2005-10-18 06:27 UTC] lsmith@php.net
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-18 11:21 UTC] lsmith@php.net
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] lsmith@php.net
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
216c216,225
<     <?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
120a121
>     $licenses = $dbh->getAssoc("SELECT name AS id,name FROM licenses ORDER BY name");
128c129,131
<     $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
11c11
<   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
701,721c701,702
<     switch ($license) {
< 
<         case 'PHP License' :
<         case 'PHP 2.02' :
<             $link = 'http://www.php.net/license/2_02.txt';
<             break;
< 
<         case 'GPL' :
<         case 'GNU General Public License' :
<             $link = 'http://www.gnu.org/licenses/gpl.html';
<             break;
< 
<         case 'LGPL' :
<         case 'GNU Lesser General Public License' :
<             $link = 'http://www.gnu.org/licenses/lgpl.html';
<             break;
< 
<         default :
<             $link = '';
<             break;
<     }
---
>     global $dbh;
>     $link = $dbh->getOne("SELECT link FROM licenses WHERE name = ?", array($license));
 [2005-10-18 14:54 UTC] mj@php.net
As a start, the packages table on pear.php.net has been altered so that the license field now takes up to 50 characters.
 [2005-10-18 15:07 UTC] mj@php.net
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] lsmith@php.net
either way .. get_license_link() suffers form the same issue ..
 [2006-02-18 09:07 UTC] pajoye@php.net
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 http://pear.php.net/support/ 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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC