Skip to content
Browse files

* License change

git-svn-id: http://svn.php.net/repository/pear/packages/Net_URL/trunk@90069 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 0aff8fd commit 0528a811fbf0edb2cf7a34eae01f79cbe3051a71 Richard Heyes committed Jul 27, 2002
Showing with 149 additions and 91 deletions.
  1. +47 −20 URL.php
  2. +33 −0 docs/example.php
  3. +69 −71 package.xml
View
67 URL.php
@@ -1,24 +1,38 @@
<?php
-// +----------------------------------------------------------------------+
-// | PHP Version 4 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2002 The PHP 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. |
-// +----------------------------------------------------------------------+
-// | Author: Richard Heyes <richard@phpguru.org> |
-// +----------------------------------------------------------------------+
-//
-// $Id$
+// +-----------------------------------------------------------------------+
+// | Copyright (c) 2002, Richard Heyes |
+// | All rights reserved. |
+// | |
+// | Redistribution and use in source and binary forms, with or without |
+// | modification, are permitted provided that the following conditions |
+// | are met: |
+// | |
+// | o Redistributions of source code must retain the above copyright |
+// | notice, this list of conditions and the following disclaimer. |
+// | o Redistributions in binary form must reproduce the above copyright |
+// | notice, this list of conditions and the following disclaimer in the |
+// | documentation and/or other materials provided with the distribution.|
+// | o The names of the authors may not be used to endorse or promote |
+// | products derived from this software without specific prior written |
+// | permission. |
+// | |
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+// | |
+// +-----------------------------------------------------------------------+
+// | Author: Richard Heyes <richard@phpguru.org> |
+// +-----------------------------------------------------------------------+
//
// Net_URL Class
-//
class Net_URL {
@@ -229,7 +243,13 @@ function getQueryString()
{
if (!empty($this->querystring)) {
foreach ($this->querystring as $name => $value) {
- $querystring[] = $name . '=' . $value;
+ if (is_array($value)) {
+ foreach ($value as $k => $v) {
+ $querystring[] = sprintf('%s[%s]=%s', $name, $k, $v);
+ }
+ } else {
+ $querystring[] = $name . '=' . $value;
+ }
}
$querystring = implode('&', $querystring);
} else {
@@ -251,7 +271,14 @@ function _parseRawQuerystring($querystring)
parse_str($querystring, $qs);
foreach ($qs as $key => $value) {
- $qs[$key] = rawurlencode($value);
+ if (is_array($value)) {
+ foreach ($value as $k => $v) {
+ $value[$k] = rawurlencode($v);
+ }
+ $qs[$key] = $value;
+ } else {
+ $qs[$key] = rawurlencode($value);
+ }
}
return $qs;
View
33 docs/example.php
@@ -1,4 +1,37 @@
<?php
+// +-----------------------------------------------------------------------+
+// | Copyright (c) 2002, Richard Heyes |
+// | All rights reserved. |
+// | |
+// | Redistribution and use in source and binary forms, with or without |
+// | modification, are permitted provided that the following conditions |
+// | are met: |
+// | |
+// | o Redistributions of source code must retain the above copyright |
+// | notice, this list of conditions and the following disclaimer. |
+// | o Redistributions in binary form must reproduce the above copyright |
+// | notice, this list of conditions and the following disclaimer in the |
+// | documentation and/or other materials provided with the distribution.|
+// | o The names of the authors may not be used to endorse or promote |
+// | products derived from this software without specific prior written |
+// | permission. |
+// | |
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+// | |
+// +-----------------------------------------------------------------------+
+// | Author: Richard Heyes <richard@phpguru.org> |
+// +-----------------------------------------------------------------------+
+
/**
* This example will decode the url given and display its
* constituent parts.
View
140 package.xml
@@ -1,71 +1,69 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE package SYSTEM "../package.dtd">
-<package version="1.0">
- <name>Net_URL</name>
- <summary>Easy parsing of Urls</summary>
- <description>
- Provides easy parsing of URLs and their constituent parts.
- </description>
- <license>BSD</license>
- <maintainers>
- <maintainer>
- <user>richard</user>
- <name>Richard heyes</name>
- <email>richard@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
-
- <release>
- <version>1.0.2</version>
- <date>2002-04-28</date>
- <state>stable</state>
- <notes>
- updated to fix a minor irritation when running on windows
- </notes>
- <filelist>
- <dir name="/" baseinstalldir="Net">
- <file role="php">URL.php</file>
- <dir name="docs" role="doc">
- <file role="doc">example.php</file>
- </dir>
- </dir>
- </filelist>
- </release>
-
- <changelog>
- <release>
- <version>1.0.1</version>
- <date>2002-04-28</date>
- <state>stable</state>
- <notes>
- Maintenance release. Bugs fixed with path detection and defaults.
- </notes>
- <filelist>
- <dir name="/" baseinstalldir="Net">
- <file role="php">URL.php</file>
- <dir name="docs" role="doc">
- <file role="doc">example.php</file>
- </dir>
- </dir>
- </filelist>
- </release>
-
- <release>
- <version>1.0</version>
- <date>2002-02-17</date>
- <state>stable</state>
- <notes>
- This is the initial release of the Net_URL package.
- </notes>
- <filelist>
- <dir name="/" baseinstalldir="Net">
- <file role="php">URL.php</file>
- <dir name="docs" role="doc">
- <file role="doc">example.php</file>
- </dir>
- </dir>
- </filelist>
- </release>
- </changelog>
-</package>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE package SYSTEM "../package.dtd">
+<package version="1.0">
+
+ <name>Net_URL</name>
+ <summary>Easy parsing of Urls</summary>
+ <description>
+Provides easy parsing of URLs and their constituent parts.
+ </description>
+
+ <maintainers>
+ <maintainer>
+ <user>richard</user>
+ <name>Richard heyes</name>
+ <email>richard@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ </maintainers>
+
+ <release>
+ <license>BSD</license>
+ <version>1.0.4</version>
+ <date>2002-07-27</date>
+ <state>stable</state>
+ <notes>License change</notes>
+ <filelist>
+ <dir name="/" baseinstalldir="Net">
+ <file role="php">URL.php</file>
+ <dir name="docs" role="doc">
+ <file role="doc">example.php</file>
+ </dir>
+ </dir>
+ </filelist>
+ </release>
+
+ <changelog>
+
+ <release>
+ <license>BSD</license>
+ <version>1.0.3</version>
+ <date>2002-06-20</date>
+ <state>stable</state>
+ <notes>Now uses HTTP_HOST if available.</notes>
+ </release>
+
+ <release>
+ <version>1.0.2</version>
+ <date>2002-04-28</date>
+ <state>stable</state>
+ <notes>updated to fix a minor irritation when running on windows</notes>
+ </release>
+
+ <release>
+ <version>1.0.1</version>
+ <date>2002-04-28</date>
+ <state>stable</state>
+ <notes>Maintenance release. Bugs fixed with path detection and defaults.</notes>
+ </release>
+
+ <release>
+ <version>1.0</version>
+ <date>2002-02-17</date>
+ <state>stable</state>
+ <notes>This is the initial release of the Net_URL package.</notes>
+ </release>
+
+ </changelog>
+
+</package>

0 comments on commit 0528a81

Please sign in to comment.
Something went wrong with that request. Please try again.