Projects
Kolab:3.4:Updates
php-pear-Net-URL2
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 11
View file
php5-pear-Net_URL2.changes
Deleted
@@ -1,21 +0,0 @@ -------------------------------------------------------------------- -Fri Feb 1 09:31:30 UTC 2013 - aj@ajaissle.de - -- New upstream version 2.0.0 - -- Changelog 2.0.0 - * Fixed the version of the release. Follow the convention for Package2. - * Fixed Bug #18917: URL2.php moved to ./Net/Net (davidc) - -- Changelog 1.0.0 - * Fixed Bug #17036: Problem with parsed query string - * Fixed Bug #17087: setOption() function is gone - * Fixed #17166: Fluent Interface - * Fixed #17167: Refactor __construct - * Fixed Bug #18267: setQueryVariables() fails to encode array values - * Fixed Bug #14399: Fixed multiple bugs in Net_URL2 (Missing setOption value, unused properties, etc.) - -------------------------------------------------------------------- -* Sat Sep 10 16:54:27 CEST 2011 - gerrit.beine@gmx.de - -- initial version 1.7.12
View file
php-pear-Net-URL2.spec
Added
@@ -0,0 +1,205 @@ +# spec file for php-pear-Net-URL2 +# +# Copyright (c) 2009-2014 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/3.0/ +# +# Please, preserve the changelog entries +# +%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}} + +# Needed for openSUSE +%if 0%{?suse_version} +%{!?pear_cfgdir: %global pear_cfgdir %(%{__pear} config-get cfg_dir 2> /dev/null || echo undefined)} +%{!?pear_datadir: %global pear_datadir %(%{__pear} config-get data_dir 2> /dev/null || echo undefined)} +%{!?pear_docdir: %global pear_docdir %(%{__pear} config-get doc_dir 2> /dev/null || echo undefined)} +%{!?pear_metadir: %global pear_metadir %(%{__pear} config-get metadata_dir 2> /dev/null || echo undefined)} +%{!?pear_phpdir: %global pear_phpdir %(%{__pear} config-get php_dir 2> /dev/null || echo undefined)} +%{!?pear_testdir: %global pear_testdir %(%{__pear} config-get test_dir 2> /dev/null || echo undefined)} +%{!?pear_wwwdir: %global pear_wwwdir %(%{__pear} config-get www_dir 2> /dev/null || echo undefined)} +%{!?pear_xmldir: %global pear_xmldir %{_localstatedir}/lib/pear/pkgxml} +%endif + +%{!?pear_metadir: %global pear_metadir %{pear_phpdir}} +%{!?__pear: %global __pear %{_bindir}/pear} +%global pear_name Net_URL2 +%global with_tests %{?_with_tests:1}%{!?_with_tests:0} + +Name: php-pear-Net-URL2 +Version: 2.1.1 +Release: 1%{?dist} +Summary: Class for parsing and handling URL + +Group: Development/Libraries +License: BSD +URL: http://pear.php.net/package/Net_URL2 +Source0: http://pear.php.net/get/%{pear_name}-%{version}.tgz + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch +BuildRequires: php-pear +%if %{with_tests} +BuildRequires: php-phpunit-PHPUnit +%endif + +Requires(post): %{__pear} +Requires(postun): %{__pear} +Requires: php-pear(PEAR) +# From phpcompatinfo report for 2.1.1 +Requires: php-pcre + +Provides: php-pear(%{pear_name}) = %{version} +Provides: php-composer(pear/net_url2) = %{version} + + +%description +Provides parsing of URLs into their constituent parts (scheme, host, path +etc.), URL generation, and resolving of relative URLs. + + +%prep +%setup -q -c + +cd %{pear_name}-%{version} +# Package is V2 +mv ../package.xml %{name}.xml + + +%build +cd %{pear_name}-%{version} +# Empty build section, most likely nothing required. + + +%install +rm -rf %{buildroot} +cd %{pear_name}-%{version} +%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml + +# Clean up unnecessary files +rm -rf %{buildroot}%{pear_metadir}/.??* +%{__rm} -rf %{buildroot}/usr/share/php5/PEAR/.{filemap,lock,registry,channels,depdb,depdblock} + +# Install XML package description +mkdir -p %{buildroot}%{pear_xmldir} +install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir} + + +%check +%if %{with_tests} +# test suite cannot run in mock (use network) +# Version 2.1.1 : OK (113 tests, 270 assertions) +cd %{buildroot}%{pear_testdir}/%{pear_name}/tests +phpunit \ + -d date.timezone=UTC \ + --include-path=%{buildroot}%{pear_phpdir} \ + AllTests.php +%else +echo 'Test suite disabled (missing "--with tests" option)' +%endif + + +%clean +rm -rf %{buildroot} + + +%post +%{__pear} install --nodeps --soft --force --register-only \ + %{pear_xmldir}/%{name}.xml >/dev/null || : + +%postun +if [ $1 -eq 0 ] ; then + %{__pear} uninstall --nodeps --ignore-errors --register-only \ + pear.php.net/%{pear_name} >/dev/null || : +fi + + +%files +%defattr(-,root,root,-) +%doc %{pear_docdir}/%{pear_name} +%{pear_xmldir}/%{name}.xml +%{pear_phpdir}/Net +%{pear_testdir}/%{pear_name} +%{pear_xmldir} + +%changelog +* Sun Dec 28 2014 Remi Collet <remi@fedoraproject.org> - 2.1.1-1 +- Update to 2.1.1 + +* Mon Oct 27 2014 Remi Collet <remi@fedoraproject.org> - 2.1.0-1 +- Update to 2.1.0 (no change, for semver) + +* Sat Oct 18 2014 Remi Collet <remi@fedoraproject.org> - 2.0.11-1 +- Update to 2.0.11 + +* Fri Oct 10 2014 Remi Collet <remi@fedoraproject.org> - 2.0.10-1 +- Update to 2.0.10 (stable) - no change +- provide php-composer(pear/net_url2) + +* Thu Oct 9 2014 Remi Collet <remi@fedoraproject.org> - 2.0.9-1 +- Update to 2.0.9 (stable) + +* Wed Oct 8 2014 Remi Collet <remi@fedoraproject.org> - 2.0.8-1 +- Update to 2.0.8 (stable) + +* Mon Sep 8 2014 Remi Collet <remi@fedoraproject.org> - 2.0.7-1 +- Update to 2.0.7 (stable) + +* Mon Jun 23 2014 Remi Collet <remi@fedoraproject.org> - 2.0.6-1 +- Update to 2.0.6 (stable) + +* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu Jan 2 2014 Remi Collet <remi@fedoraproject.org> - 2.0.5-1 +- Update to 2.0.5 (stable) + +* Tue Dec 31 2013 Remi Collet <remi@fedoraproject.org> - 2.0.4-1 +- Update to 2.0.4 (stable) + +* Mon Dec 30 2013 Remi Collet <remi@fedoraproject.org> - 2.0.3-1 +- Update to 2.0.3 (stable) + +* Sat Dec 28 2013 Remi Collet <remi@fedoraproject.org> - 2.0.2-1 +- Update to 2.0.2 (stable) + +* Wed Dec 25 2013 Remi Collet <remi@fedoraproject.org> - 2.0.1-1 +- Update to 2.0.1 (stable) + +* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue Feb 19 2013 Remi Collet <remi@fedoraproject.org> - 2.0.0-6 +- fix metadata location + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Aug 14 2012 Remi Collet <remi@fedoraproject.org> - 2.0.0-4 +- rebuilt for new pear_testdir + +* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Sat Oct 22 2011 Remi Collet <remi@fedoraproject.org> - 2.0.0-1 +- Version 2.0.0 (stable) - API 2.0.0 (stable) +- add tests option to run tests during rpmbuild + +* Mon Apr 18 2011 Remi Collet <Fedora@FamilleCollet.com> 0.3.1-4 +- doc in /usr/share/doc/pear +- set date.timezone during build + +* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sat May 22 2010 Remi Collet <Fedora@FamilleCollet.com> 0.3.1-2 +- spec cleanup +
View file
php5-pear-Net_URL2.spec
Deleted
@@ -1,97 +0,0 @@ -# -# spec file for package php5-pear-Net_URL2 -# -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via http://bugs.opensuse.org/ -# - - -Name: php5-pear-Net_URL2 -%define pear_name Net_URL2 -%define pear_sname Net_URL2 -Summary: Class for parsing and handling URL -Version: 2.0.0 -Release: 0 -License: PHP-3.01 -Group: Development/Libraries/PHP -BuildArch: noarch -Url: http://pear.php.net/package/%{pear_name} -Source: %{pear_name}-%{version}.tgz - -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: php >= 5.0 -%if 0%{?sles_version} == 10 -BuildRequires: php-macros -%else -BuildRequires: php-devel >= 5.0 -%endif -BuildRequires: php-pear >= 1.4.0 -Requires: php >= 5.0 -Requires: php-pear >= 1.4.0 - -Provides: php-pear-%{pear_name} pear-%{pear_name} -Provides: php5-pear-%{pear_sname} = %{version} -Provides: php-pear-%{pear_sname} = %{version} -Provides: php-pear(%{pear_name}) = %{version} -Provides: pear-%{pear_sname} = %{version} -Obsoletes: php5-pear-%{pear_sname} < %{version} -Obsoletes: php-pear-%{pear_sname} < %{version} -Obsoletes: pear-%{pear_sname} < %{version} - -%description -Provides parsing of URLs into their constituent parts (scheme, host, path etc.), URL generation, and resolving of relative URLs. - -%prep -%setup -c - -%build - -%install -%{__mv} package*.xml %{pear_name}-%{version} -cd %{pear_name}-%{version} -PHP_PEAR_PHP_BIN="$(which php) -d memory_limit=50m" -%{__pear} -v \ - -d bin_dir=%{_bindir} \ - -d data_dir=%{php_peardir}/data \ - -d test_dir=%{peardir}/tests \ - install --offline --nodeps -R "%{buildroot}" package.xml - -%{__install} -D -m 0644 package.xml %{buildroot}%{php_pearxmldir}/%{pear_name}.xml - -%{__rm} -rf %{buildroot}/{doc,tmp} -%{__rm} -rf %{buildroot}%{php_peardir}/.{filemap,lock,registry,channels,depdb,depdblock} - -cd .. - -%php_pear_gen_filelist - -%post -if [ "$1" = "1" ]; then - %{__pear} install --nodeps --soft --force --register-only %{php_pearxmldir}/%{pear_name}.xml -fi -if [ "$1" = "2" ]; then - %{__pear} upgrade --offline --register-only %{php_pearxmldir}/%{pear_name}.xml -fi - -%postun -if [ "$1" = "0" ]; then - %{__pear} uninstall --nodeps --ignore-errors --register-only pear.php.net/%{pear_name} -fi - -%clean -%{__rm} -rf %{buildroot} - -%files -f %{name}.files -%defattr(-, root, root) - -%changelog
View file
Net_URL2-2.0.0.tgz/Net_URL2-2.0.0/Net/URL2.php
Deleted
@@ -1,942 +0,0 @@ -<?php -/** - * Net_URL2, a class representing a URL as per RFC 3986. - * - * PHP version 5 - * - * LICENSE: - * - * Copyright (c) 2007-2009, Peytz & Co. A/S - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of the Net_URL2 nor the names of its contributors may - * 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. - * - * @category Networking - * @package Net_URL2 - * @author Christian Schmidt <schmidt@php.net> - * @copyright 2007-2009 Peytz & Co. A/S - * @license http://www.opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: URL2.php 309223 2011-03-14 14:26:32Z till $ - * @link http://www.rfc-editor.org/rfc/rfc3986.txt - */ - -/** - * Represents a URL as per RFC 3986. - * - * @category Networking - * @package Net_URL2 - * @author Christian Schmidt <schmidt@php.net> - * @copyright 2007-2009 Peytz & Co. A/S - * @license http://www.opensource.org/licenses/bsd-license.php New BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/Net_URL2 - */ -class Net_URL2 -{ - /** - * Do strict parsing in resolve() (see RFC 3986, section 5.2.2). Default - * is true. - */ - const OPTION_STRICT = 'strict'; - - /** - * Represent arrays in query using PHP's [] notation. Default is true. - */ - const OPTION_USE_BRACKETS = 'use_brackets'; - - /** - * URL-encode query variable keys. Default is true. - */ - const OPTION_ENCODE_KEYS = 'encode_keys'; - - /** - * Query variable separators when parsing the query string. Every character - * is considered a separator. Default is "&". - */ - const OPTION_SEPARATOR_INPUT = 'input_separator'; - - /** - * Query variable separator used when generating the query string. Default - * is "&". - */ - const OPTION_SEPARATOR_OUTPUT = 'output_separator'; - - /** - * Default options corresponds to how PHP handles $_GET. - */ - private $_options = array( - self::OPTION_STRICT => true, - self::OPTION_USE_BRACKETS => true, - self::OPTION_ENCODE_KEYS => true, - self::OPTION_SEPARATOR_INPUT => '&', - self::OPTION_SEPARATOR_OUTPUT => '&', - ); - - /** - * @var string|bool - */ - private $_scheme = false; - - /** - * @var string|bool - */ - private $_userinfo = false; - - /** - * @var string|bool - */ - private $_host = false; - - /** - * @var string|bool - */ - private $_port = false; - - /** - * @var string - */ - private $_path = ''; - - /** - * @var string|bool - */ - private $_query = false; - - /** - * @var string|bool - */ - private $_fragment = false; - - /** - * Constructor. - * - * @param string $url an absolute or relative URL - * @param array $options an array of OPTION_xxx constants - * - * @return $this - * @uses self::parseUrl() - */ - public function __construct($url, array $options = array()) - { - foreach ($options as $optionName => $value) { - if (array_key_exists($optionName, $this->_options)) { - $this->_options[$optionName] = $value; - } - } - - $this->parseUrl($url); - } - - /** - * Magic Setter. - * - * This method will magically set the value of a private variable ($var) - * with the value passed as the args - * - * @param string $var The private variable to set. - * @param mixed $arg An argument of any type. - * @return void - */ - public function __set($var, $arg) - { - $method = 'set' . $var; - if (method_exists($this, $method)) { - $this->$method($arg); - } - } - - /** - * Magic Getter. - * - * This is the magic get method to retrieve the private variable - * that was set by either __set() or it's setter... - * - * @param string $var The property name to retrieve. - * @return mixed $this->$var Either a boolean false if the - * property is not set or the value - * of the private property. - */ - public function __get($var) - { - $method = 'get' . $var; - if (method_exists($this, $method)) { - return $this->$method(); - } - - return false; - } - - /** - * Returns the scheme, e.g. "http" or "urn", or false if there is no - * scheme specified, i.e. if this is a relative URL. - * - * @return string|bool - */ - public function getScheme() - {
View file
Net_URL2-2.0.0.tgz/Net_URL2-2.0.0/docs/6470.php
Deleted
@@ -1,75 +0,0 @@ -<?php -// +-----------------------------------------------------------------------+ -// | Copyright (c) 2002-2003, 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 at php net> | -// +-----------------------------------------------------------------------+ -// $Id: 6470.php 235190 2007-05-08 00:04:54Z davidc $ -/** -* This example will decode the url given and display its -* constituent parts. -*/ - error_reporting(E_ALL | E_STRICT); - - require_once 'Net/URL2.php'; - - //$url = &new Net_URL2('https://www.example.com/foo/bar/index.php?foo=bar'); - Net_URL2::setOption('encode_query_keys', true); - $url = new Net_URL2; - -?> -<html> -<body> - -<pre> -Protocol...: <?php echo $url->protocol; ?> - -Username...: <?php echo $url->user; ?> - -Password...: <?php echo $url->pass; ?> - -Server.....: <?php echo $url->host; ?> - -Port.......: <?php $url->port; ?> - -File/path..: <?php $url->path; ?> - -Querystring: <?php print_r($url->querystring); ?> - -Anchor.....: <?php echo $url->anchor;?> - -Full URL...: <?php echo $url->getUrl(); ?> - - -Resolve path (/.././/foo/bar/joe/./././../jabba): <b><?php Net_URL2::resolvePath('/.././/foo/bar/joe/./././../jabba'); ?></b> -</pre> - -</body> -</html>
View file
Net_URL2-2.0.0.tgz/Net_URL2-2.0.0/docs/example.php
Deleted
@@ -1,74 +0,0 @@ -<?php -// +-----------------------------------------------------------------------+ -// | Copyright (c) 2002-2003, 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 at php net> | -// +-----------------------------------------------------------------------+ -// $Id: example.php 235190 2007-05-08 00:04:54Z davidc $ -/** -* This example will decode the url given and display its -* constituent parts. -*/ - error_reporting(E_ALL | E_STRICT); - - //include('../URL2.php'); - include('Net/URL2.php'); - - //$url = &new Net_URL2('https://www.example.com/foo/bar/index.php?foo=bar'); - $url = new Net_URL2('https://example.com/pls/portal30/PORTAL30.wwpob_page.changetabs?p_back_url=http%3A%2F%2Fexample.com%2Fservlet%2Fpage%3F_pageid%3D360%2C366%2C368%2C382%26_dad%3Dportal30%26_schema%3DPORTAL30&foo=bar'); -?> -<html> -<body> - -<pre> -Protocol...: <?php echo $url->protocol; ?> - -Username...: <?php echo $url->user; ?> - -Password...: <?php echo $url->pass; ?> - -Server.....: <?php echo $url->host; ?> - -Port.......: <?php $url->port; ?> - -File/path..: <?php $url->path; ?> - -Querystring: <?php print_r($url->querystring); ?> - -Anchor.....: <?php echo $url->anchor;?> - -Full URL...: <?php echo $url->getUrl(); ?> - - -Resolve path (/.././/foo/bar/joe/./././../jabba): <b><?php Net_URL2::resolvePath('/.././/foo/bar/joe/./././../jabba'); ?></b> -</pre> - -</body> -</html>
View file
Net_URL2-2.0.0.tgz/Net_URL2-2.0.0/tests/AllTests.php
Deleted
@@ -1,35 +0,0 @@ -<?php - -if (!defined('PHPUnit_MAIN_METHOD')) { - define('PHPUnit_MAIN_METHOD', 'Net_URL2_AllTests::main'); -} - - -require_once 'PHPUnit/Autoload.php'; - -chdir(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR); -require_once 'Net/URL2Test.php'; - - -class Net_URL2_AllTests -{ - public static function main() - { - - PHPUnit_TextUI_TestRunner::run(self::suite()); - } - - public static function suite() - { - $suite = new PHPUnit_Framework_TestSuite('Net_URL2 tests'); - /** Add testsuites, if there is. */ - $suite->addTestSuite('Net_URL2Test'); - - return $suite; - } -} - -if (PHPUnit_MAIN_METHOD == 'Net_URL2_AllTests::main') { - Net_URL2_AllTests::main(); -} -?>
View file
Net_URL2-2.0.0.tgz/Net_URL2-2.0.0/tests/Net/URL2Test.php
Deleted
@@ -1,314 +0,0 @@ -<?php -// Call Net_URL2Test::main() if this source file is executed directly. -if (!defined("PHPUnit_MAIN_METHOD")) { - define("PHPUnit_MAIN_METHOD", "Net_URL2Test::main"); -} - -require_once 'PHPUnit/Autoload.php'; - -$classFile = ''; -if (strstr('@package_version@', '@package')) { - // we run from a svn checkout - $classFile .= __DIR__ . './../../Net/URL2.php'; -} else { - $classFile .= 'Net/URL2.php'; -} -require_once $classFile; - -/** - * Test class for Net_URL2. - */ -class Net_URL2Test extends PHPUnit_Framework_TestCase -{ - /** - * Runs the test methods of this class. - * - * @access public - * @static - */ - public static function main() - { - require_once "PHPUnit/TextUI/TestRunner.php"; - - $suite = new PHPUnit_Framework_TestSuite("Net_URL2Test"); - $result = PHPUnit_TextUI_TestRunner::run($suite); - } - - /** - * Sets up the fixture, for example, open a network connection. - * This method is called before a test is executed. - * - * @access protected - */ - protected function setUp() { - } - - /** - * Tears down the fixture, for example, close a network connection. - * This method is called after a test is executed. - * - * @access protected - */ - protected function tearDown() { - } - - /** - * Tests setQueryVariable(). - */ - public function testSetQueryVariable() { - $url = new Net_URL2('http://www.example.com/'); - $url->setQueryVariable('pear','fun'); - $this->assertEquals($url->getURL(), 'http://www.example.com/?pear=fun'); - } - - /** - * Tests setQueryVariables(). - */ - public function testSetQueryVariables() { - $url = new Net_URL2('http://www.example.com/'); - $url->setQueryVariables(array('pear'=>'fun')); - $this->assertEquals('http://www.example.com/?pear=fun', $url->getURL()); - $url->setQueryVariables(array('pear'=>'fun for sure')); - $this->assertEquals('http://www.example.com/?pear=fun%20for%20sure', $url->getURL()); - } - - /** - * Tests unsetQueryVariable() - */ - public function testUnsetQueryVariable() { - $url = new Net_URL2('http://www.example.com/?name=david&pear=fun&fish=slippery'); - $url->unsetQueryVariable('pear'); - $this->assertEquals($url->getURL(), 'http://www.example.com/?name=david&fish=slippery'); - $url->unsetQueryVariable('name'); - $this->assertEquals($url->getURL(), 'http://www.example.com/?fish=slippery'); - $url->unsetQueryVariable('fish'); - $this->assertEquals($url->getURL(), 'http://www.example.com/'); - } - - /** - * Tests setQuery(). - */ - public function testSetQuery() { - $url = new Net_URL2('http://www.example.com/'); - $url->setQuery('flapdoodle&dilly%20all%20day'); - $this->assertEquals($url->getURL(), 'http://www.example.com/?flapdoodle&dilly%20all%20day'); - } - - /** - * Tests getQuery(). - */ - public function testGetQuery() { - $url = new Net_URL2('http://www.example.com/?foo'); - $this->assertEquals($url->getQuery(),'foo'); - $url = new Net_URL2('http://www.example.com/?pear=fun&fruit=fruity'); - $this->assertEquals($url->getQuery(),'pear=fun&fruit=fruity'); - } - - /** - * Tests setScheme(). - */ - public function testSetScheme() { - $url = new Net_URL2('http://www.example.com/'); - $url->setScheme('ftp'); - $this->assertEquals($url->getURL(), 'ftp://www.example.com/'); - $url->setScheme('gopher'); - $this->assertEquals($url->getURL(), 'gopher://www.example.com/'); - } - - /** - * Tests setting the fragment. - */ - public function testSetFragment() { - $url = new Net_URL2('http://www.example.com/'); - $url->setFragment('pear'); - $this->assertEquals('http://www.example.com/#pear', $url->getURL()); - } - - /** - * Test the resolve() function. - */ - public function testResolve() - { - // Examples from RFC 3986, section 5.4. - // relative URL => absolute URL - $tests = array( - "" => "http://a/b/c/d;p?q", - "g:h" => "g:h", - "g" => "http://a/b/c/g", - "./g" => "http://a/b/c/g", - "g/" => "http://a/b/c/g/", - "/g" => "http://a/g", - "//g" => "http://g", - "?y" => "http://a/b/c/d;p?y", - "g?y" => "http://a/b/c/g?y", - "#s" => "http://a/b/c/d;p?q#s", - "g#s" => "http://a/b/c/g#s", - "g?y#s" => "http://a/b/c/g?y#s", - ";x" => "http://a/b/c/;x", - "g;x" => "http://a/b/c/g;x", - "g;x?y#s" => "http://a/b/c/g;x?y#s", - "" => "http://a/b/c/d;p?q", - "." => "http://a/b/c/", - "./" => "http://a/b/c/", - ".." => "http://a/b/", - "../" => "http://a/b/", - "../g" => "http://a/b/g", - "../.." => "http://a/", - "../../" => "http://a/", - "../../g" => "http://a/g", - "../../../g" => "http://a/g", - "../../../../g" => "http://a/g", - "/./g" => "http://a/g", - "/../g" => "http://a/g", - "g." => "http://a/b/c/g.", - ".g" => "http://a/b/c/.g", - "g.." => "http://a/b/c/g..", - "..g" => "http://a/b/c/..g", - "./../g" => "http://a/b/g", - "./g/." => "http://a/b/c/g/", - "g/./h" => "http://a/b/c/g/h", - "g/../h" => "http://a/b/c/h", - "g;x=1/./y" => "http://a/b/c/g;x=1/y", - "g;x=1/../y" => "http://a/b/c/y", - "g?y/./x" => "http://a/b/c/g?y/./x", - "g?y/../x" => "http://a/b/c/g?y/../x", - "g#s/./x" => "http://a/b/c/g#s/./x", - "g#s/../x" => "http://a/b/c/g#s/../x", - "http:g" => "http:g", - ); - $baseURL = 'http://a/b/c/d;p?q'; - $base = new Net_URL2($baseURL); - foreach ($tests as $relativeURL => $absoluteURL) { - $this->assertEquals($absoluteURL, $base->resolve($relativeURL)->getURL()); - } - - $base = new Net_URL2($baseURL, array(Net_URL2::OPTION_STRICT => false)); - $relativeURL = 'http:g'; - $this->assertEquals('http://a/b/c/g', $base->resolve($relativeURL)->getURL()); - } - - /** - * @return void - * @link http://pear.php.net/bugs/bug.php?id=18267 - */ - public function testUrlEncoding() - { - $url = new Net_URL2('http://localhost/bug.php'); - $url->setQueryVariables( - array( - 'indexed' => array('first value', 'second value', array('foo', 'bar'))
View file
Net_URL2-2.1.1.tgz/Net_URL2-2.1.1/Net/URL2.php
Added
@@ -0,0 +1,1219 @@ +<?php +/** + * Net_URL2, a class representing a URL as per RFC 3986. + * + * PHP version 5 + * + * LICENSE: + * + * Copyright (c) 2007-2009, Peytz & Co. A/S + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the Net_URL2 nor the names of its contributors may + * 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. + * + * @category Networking + * @package Net_URL2 + * @author Christian Schmidt <schmidt@php.net> + * @copyright 2007-2009 Peytz & Co. A/S + * @license https://spdx.org/licenses/BSD-3-Clause BSD-3-Clause + * @version CVS: $Id$ + * @link https://tools.ietf.org/html/rfc3986 + */ + +/** + * Represents a URL as per RFC 3986. + * + * @category Networking + * @package Net_URL2 + * @author Christian Schmidt <schmidt@php.net> + * @copyright 2007-2009 Peytz & Co. A/S + * @license https://spdx.org/licenses/BSD-3-Clause BSD-3-Clause + * @version Release: 2.1.1 + * @link https://pear.php.net/package/Net_URL2 + */ +class Net_URL2 +{ + /** + * Do strict parsing in resolve() (see RFC 3986, section 5.2.2). Default + * is true. + */ + const OPTION_STRICT = 'strict'; + + /** + * Represent arrays in query using PHP's [] notation. Default is true. + */ + const OPTION_USE_BRACKETS = 'use_brackets'; + + /** + * Drop zero-based integer sequences in query using PHP's [] notation. Default + * is true. + */ + const OPTION_DROP_SEQUENCE = 'drop_sequence'; + + /** + * URL-encode query variable keys. Default is true. + */ + const OPTION_ENCODE_KEYS = 'encode_keys'; + + /** + * Query variable separators when parsing the query string. Every character + * is considered a separator. Default is "&". + */ + const OPTION_SEPARATOR_INPUT = 'input_separator'; + + /** + * Query variable separator used when generating the query string. Default + * is "&". + */ + const OPTION_SEPARATOR_OUTPUT = 'output_separator'; + + /** + * Default options corresponds to how PHP handles $_GET. + */ + private $_options = array( + self::OPTION_STRICT => true, + self::OPTION_USE_BRACKETS => true, + self::OPTION_DROP_SEQUENCE => true, + self::OPTION_ENCODE_KEYS => true, + self::OPTION_SEPARATOR_INPUT => '&', + self::OPTION_SEPARATOR_OUTPUT => '&', + ); + + /** + * @var string|bool + */ + private $_scheme = false; + + /** + * @var string|bool + */ + private $_userinfo = false; + + /** + * @var string|bool + */ + private $_host = false; + + /** + * @var string|bool + */ + private $_port = false; + + /** + * @var string + */ + private $_path = ''; + + /** + * @var string|bool + */ + private $_query = false; + + /** + * @var string|bool + */ + private $_fragment = false; + + /** + * Constructor. + * + * @param string $url an absolute or relative URL + * @param array $options an array of OPTION_xxx constants + * + * @uses self::parseUrl() + */ + public function __construct($url, array $options = array()) + { + foreach ($options as $optionName => $value) { + if (array_key_exists($optionName, $this->_options)) { + $this->_options[$optionName] = $value; + } + } + + $this->parseUrl($url); + } + + /** + * Magic Setter. + * + * This method will magically set the value of a private variable ($var) + * with the value passed as the args + * + * @param string $var The private variable to set. + * @param mixed $arg An argument of any type. + * + * @return void + */ + public function __set($var, $arg) + { + $method = 'set' . $var; + if (method_exists($this, $method)) { + $this->$method($arg); + } + } + + /** + * Magic Getter. + * + * This is the magic get method to retrieve the private variable + * that was set by either __set() or it's setter... + * + * @param string $var The property name to retrieve. + * + * @return mixed $this->$var Either a boolean false if the + * property is not set or the value + * of the private property. + */ + public function __get($var) + { + $method = 'get' . $var; + if (method_exists($this, $method)) { + return $this->$method(); + } + + return false; + } +
View file
Net_URL2-2.1.1.tgz/Net_URL2-2.1.1/docs/6470.php
Added
@@ -0,0 +1,56 @@ +<?php +/** + * Net_URL2, a class representing a URL as per RFC 3986. + * + * PHP version 5 + * + * This file contains code Copyright (c) 2002-2003, Richard Heyes, + * See BSD-3-CLAUSE-Heyes, + * Author: Richard Heyes <richard at php net> + * + * @category Networking + * @package Net_URL2 + * @author Some Pear Developers <pear@php.net> + * @license https://spdx.org/licenses/BSD-3-Clause BSD-3-Clause + * @link https://tools.ietf.org/html/rfc3986 + */ + +/** +* This example will decode the url given and display its +* constituent parts. +*/ + error_reporting(E_ALL | E_STRICT); + + require_once 'Net/URL2.php'; + + $url = new Net_URL2('https://www.example.com/foo/bar/index.php?foo=bar'); + +?> +<html> +<body> + +<pre> +Protocol...: <?php echo $url->protocol; ?> + +Username...: <?php echo $url->user; ?> + +Password...: <?php echo $url->pass; ?> + +Server.....: <?php echo $url->host; ?> + +Port.......: <?php $url->port; ?> + +File/path..: <?php $url->path; ?> + +Querystring: <?php print_r($url->querystring); ?> + +Anchor.....: <?php echo $url->anchor;?> + +Full URL...: <?php echo $url->getUrl(); ?> + +Resolve path (/.././/foo/bar/joe/./././../jabba): <b><?php + echo $url->resolve('/.././/foo/bar/joe/./././../jabba'); ?></b> +</pre> + +</body> +</html>
View file
Net_URL2-2.1.1.tgz/Net_URL2-2.1.1/docs/BSD-3-CLAUSE-Heyes
Added
@@ -0,0 +1,27 @@ +Copyright (c) 2002-2003, 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: + +1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2) 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. +3) Neither the name of the Richard Heyes nor the names of his + contributors may 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 +HOLDER 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.
View file
Net_URL2-2.1.1.tgz/Net_URL2-2.1.1/docs/example.php
Added
@@ -0,0 +1,62 @@ +<?php +/** + * Net_URL2, a class representing a URL as per RFC 3986. + * + * PHP version 5 + * + * This file contains code Copyright (c) 2002-2003, Richard Heyes, + * See BSD-3-CLAUSE-Heyes, + * Author: Richard Heyes <richard at php net> + * + * @category Networking + * @package Net_URL2 + * @author Some Pear Developers <pear@php.net> + * @license https://spdx.org/licenses/BSD-3-Clause BSD-3-Clause + * @link https://tools.ietf.org/html/rfc3986 + */ + +/** +* This example will decode the url given and display its +* constituent parts. +*/ + +error_reporting(E_ALL | E_STRICT); + +require 'Net/URL2.php'; + +$url = new Net_URL2( + 'https://example.com/pls/portal30/PORTAL30.wwpob_page.changetabs?' + .'p_back_url=http%3A%2F%2Fexample.com%2Fservlet%2Fpage%3F_pageid%3D360' + .'%2C366%2C368%2C382%26_dad%3Dportal30%26_schema%3DPORTAL30&foo=bar' +); + +?> +<html> +<body> + +<pre> +Protocol...: <?php echo $url->protocol; ?> + +Username...: <?php echo $url->user; ?> + +Password...: <?php echo $url->pass; ?> + +Server.....: <?php echo $url->host; ?> + +Port.......: <?php $url->port; ?> + +File/path..: <?php $url->path; ?> + +Querystring: <?php print_r($url->querystring); ?> + +Anchor.....: <?php echo $url->anchor;?> + +Full URL...: <?php echo $url->getUrl(); ?> + + +Resolve path (.././/foo/bar/joe/./././../jabba): <b><?php + echo $url->resolve('.././/foo/bar/joe/./././../jabba'); ?></b> +</pre> + +</body> +</html>
View file
Net_URL2-2.1.1.tgz/Net_URL2-2.1.1/tests/AllTests.php
Added
@@ -0,0 +1,59 @@ +<?php +/** + * Net_URL2, a class representing a URL as per RFC 3986. + * + * PHP version 5 + * + * @category Networking + * @package Net_URL2 + * @author Some Pear Developers <pear@php.net> + * @license https://spdx.org/licenses/BSD-3-Clause BSD-3-Clause + * @link https://tools.ietf.org/html/rfc3986 + */ + +require_once 'PHPUnit/Autoload.php'; + +chdir(dirname(__FILE__) . '/../'); + +require_once 'Net/URL2Test.php'; +require_once 'Net/URL2.php'; + +/** + * Test class for Net_URL2. + * + * @category Networking + * @package Net_URL2 + * @author Some Pear Developers <pear@php.net> + * @license https://spdx.org/licenses/BSD-3-Clause BSD-3-Clause + * @version Release: @package_version@ + * @link https://pear.php.net/package/Net_URL2 + */ +class Net_URL2_AllTests +{ + /** + * main() + * + * @return void + */ + public static function main() + { + + PHPUnit_TextUI_TestRunner::run(self::suite()); + } + + /** + * suite() + * + * @return PHPUnit_Framework_TestSuite + */ + public static function suite() + { + $suite = new PHPUnit_Framework_TestSuite('Net_URL2 tests'); + /** Add testsuites, if there is. */ + $suite->addTestSuite('Net_URL2Test'); + + return $suite; + } +} + +Net_URL2_AllTests::main();
View file
Net_URL2-2.1.1.tgz/Net_URL2-2.1.1/tests/Net/URL2Test.php
Added
@@ -0,0 +1,1088 @@ +<?php +/** + * Net_URL2, a class representing a URL as per RFC 3986. + * + * PHP version 5 + * + * @category Networking + * @package Net_URL2 + * @author Some Pear Developers <pear@php.net> + * @license https://spdx.org/licenses/BSD-3-Clause BSD-3-Clause + * @link https://tools.ietf.org/html/rfc3986 + */ + +/** + * Test class for Net_URL2. + * + * @category Networking + * @package Net_URL2 + * @author Some Pear Developers <pear@php.net> + * @license https://spdx.org/licenses/BSD-3-Clause BSD-3-Clause + * @version Release: 2.1.1 + * @link https://pear.php.net/package/Net_URL2 + */ +class Net_URL2Test extends PHPUnit_Framework_TestCase +{ + /** + * Tests setting a zero-length string and false as authority + * Also: Regression test for Bug #20420 + * + * @covers Net_URL2::setAuthority + * @return void + * @link https://pear.php.net/bugs/bug.php?id=20420 + */ + public function testSetEmptyAuthority() + { + $url = new Net_URL2('http://www.example.com/'); + $url->setAuthority(''); + $this->assertSame('', $url->getAuthority()); + $this->assertSame('', $url->getHost()); + $this->assertSame(false, $url->getPort()); + $this->assertSame(false, $url->getUserinfo()); + $this->assertSame(false, $url->getUser()); + + $url->setAuthority(false); + $this->assertSame(false, $url->getAuthority()); + } + + /** + * Tests setting an empty userinfo part + * Also: Regression test for Bug #20013 and Bug #20399 + * + * @covers Net_URL2::setUserinfo + * @covers Net_URL2::getUserinfo + * @covers Net_URL2::getURL + * @return void + * @link https://pear.php.net/bugs/bug.php?id=20013 + * @link https://pear.php.net/bugs/bug.php?id=20399 + */ + public function testSetEmptyUserinfo() + { + $url = new Net_URL2('http://@www.example.com/'); + $this->assertSame('http://www.example.com/', $url->getURL()); + + $url = new Net_URL2('http://www.example.com/'); + $this->assertSame('http://www.example.com/', $url->getURL()); + $url->setUserinfo(''); + $this->assertSame('http://www.example.com/', $url->getURL()); + $this->assertSame('', $url->getUserinfo()); + $url->setUserinfo(false); + $this->assertSame('http://www.example.com/', $url->getURL()); + $this->assertFalse($url->getUserinfo()); + } + + /** + * Tests an URL with no userinfo and normalization + * + * Also: Regression test for Bug #20385 + * + * @covers Net_URL2::getUserinfo + * @covers Net_URL2::normalize + * @covers Net_URL2::getNormalizedURL + * @return void + * @link https://pear.php.net/bugs/bug.php?id=20385 + */ + public function testNoUserinfoAndNormalize() + { + $testUrl = 'http://www.example.com/'; + + $url = new Net_URL2($testUrl); + $this->assertFalse($url->getUserinfo()); + + $url->normalize(); + $this->assertFalse($url->getUserinfo()); + + $this->assertEquals($testUrl, $url->getURL()); + $this->assertEquals($testUrl, $url->getNormalizedURL()); + } + + /** + * Tests setQueryVariable(). + * + * @return void + */ + public function testSetQueryVariable() + { + + $url = new Net_URL2('http://www.example.com/'); + $url->setQueryVariable('pear', 'fun'); + $this->assertEquals($url->getURL(), 'http://www.example.com/?pear=fun'); + } + + /** + * Tests setQueryVariables(). + * + * @return void + */ + public function testSetQueryVariables() + { + + $url = new Net_URL2('http://www.example.com/'); + $url->setQueryVariables(array('pear' => 'fun')); + $this->assertEquals('http://www.example.com/?pear=fun', $url->getURL()); + $url->setQueryVariables(array('pear' => 'fun for sure')); + $this->assertEquals( + 'http://www.example.com/?pear=fun%20for%20sure', $url->getURL() + ); + } + + /** + * Tests unsetQueryVariable() + * + * @return void + */ + public function testUnsetQueryVariable() + { + $url = new Net_URL2( + 'http://www.example.com/?name=david&pear=fun&fish=slippery' + ); + + $removes = array( + 'pear' => 'http://www.example.com/?name=david&fish=slippery', + 'name' => 'http://www.example.com/?fish=slippery', + 'fish' => 'http://www.example.com/', + ); + + foreach ($removes as $name => $expected) { + $url->unsetQueryVariable($name); + $this->assertEquals($expected, $url); + } + } + + /** + * Tests setQuery(). + * + * @return void + */ + public function testSetQuery() + { + + $url = new Net_URL2('http://www.example.com/'); + $url->setQuery('flapdoodle&dilly%20all%20day'); + $this->assertEquals( + $url->getURL(), 'http://www.example.com/?flapdoodle&dilly%20all%20day' + ); + } + + /** + * Tests getQuery(). + * + * @return void + */ + public function testGetQuery() + { + + $url = new Net_URL2('http://www.example.com/?foo'); + $this->assertEquals($url->getQuery(), 'foo'); + $url = new Net_URL2('http://www.example.com/?pear=fun&fruit=fruity'); + $this->assertEquals($url->getQuery(), 'pear=fun&fruit=fruity'); + } + + /** + * Tests setScheme(). + * + * @return void + */ + public function testSetScheme() + { + + $url = new Net_URL2('http://www.example.com/'); + $url->setScheme('ftp'); + $this->assertEquals($url->getURL(), 'ftp://www.example.com/'); + $url->setScheme('gopher'); + $this->assertEquals($url->getURL(), 'gopher://www.example.com/'); + } + + /** + * Tests setting the fragment. + * + * @return void
View file
Net_URL2-2.0.0.tgz/package.xml -> Net_URL2-2.1.1.tgz/package.xml
Changed
@@ -4,47 +4,58 @@ <channel>pear.php.net</channel> <extends>Net_URL</extends> <summary>Class for parsing and handling URL.</summary> - <description>Provides parsing of URLs into their constituent parts (scheme, host, path etc.), URL generation, and resolving of relative URLs.</description> + <description>Provides parsing of URLs into their constituent parts (scheme, host, path etc.), URL generation, and resolving of + relative URLs.</description> + <lead> + <name>Tom Klingenberg</name> + <user>tkli</user> + <email>tkli@php.net</email> + <active>yes</active> + </lead> <lead> <name>David Coallier</name> <user>davidc</user> <email>davidc@php.net</email> - <active>yes</active> + <active>no</active> </lead> <lead> <name>Christian Schmidt</name> <user>schmidt</user> <email>schmidt@php.net</email> - <active>yes</active> + <active>no</active> </lead> - <date>2011-10-20</date> - <time>09:16:17</time> + <date>2014-12-27</date> + <time>14:07:56</time> <version> - <release>2.0.0</release> - <api>2.0.0</api> + <release>2.1.1</release> + <api>2.1.0</api> </version> <stability> <release>stable</release> <api>stable</api> </stability> - <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license> + <license uri="https://spdx.org/licenses/BSD-3-Clause">BSD-3-Clause</license> <notes> -* Fixed the version of the release. Follow the convention for Package2. -* Fixed Bug #18917: URL2.php moved to ./Net/Net (davidc) +* Fixed #20473: Normalize query and fragment broken </notes> <contents> <dir name="/"> - <file baseinstalldir="Net" md5sum="587a224d39fbffa47cacb9fb67b51da1" name="docs/example.php" role="doc" /> - <file baseinstalldir="Net" md5sum="ea8b73061588566519fd0e55a230f2a6" name="docs/6470.php" role="doc" /> - <file md5sum="637af3fb6a678dd1665ad13f2ec8c7c8" name="tests/Net/URL2Test.php" role="test" /> - <file md5sum="e25e538f2e5b06788f1e71333c9498bc" name="tests/AllTests.php" role="test" /> - <file md5sum="294c727633c67bd963151b9d5e7ab801" name="Net/URL2.php" role="php" /> + <file baseinstalldir="Net" md5sum="f7b6eb4ad5d4c485e702c887b788588b" name="docs/example.php" role="doc" /> + <file baseinstalldir="Net" md5sum="250f2fe2b0553c05f3de2f330d36ee61" name="docs/6470.php" role="doc" /> + <file baseinstalldir="Net" md5sum="a812699bcaecdb7a4ad8d849ebcc9280" name="docs/BSD-3-CLAUSE-Heyes" role="doc" /> + <file md5sum="de0e0a887e755f592133cde39a443b0c" name="tests/Net/URL2Test.php" role="test"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file md5sum="17cb79734eb0584894d2bfea2a8eda42" name="tests/AllTests.php" role="test" /> + <file md5sum="4f6903b12b83b63b6fb40f6cae83f55e" name="Net/URL2.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> </dir> </contents> <dependencies> <required> <php> - <min>5.0</min> + <min>5.1.4</min> </php> <pearinstaller> <min>1.4.0b1</min> @@ -54,6 +65,270 @@ <phprelease /> <changelog> <release> + <date>2014-12-27</date> + <time>14:00:00</time> + <version> + <release>2.1.1</release> + <api>2.1.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="https://spdx.org/licenses/BSD-3-Clause">BSD-3-Clause</license> + <notes> +* Fixed #20473: Normalize query and fragment broken + </notes> + </release> + <release> + <date>2014-10-21</date> + <time>18:09:00</time> + <version> + <release>2.1.0</release> + <api>2.1.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="https://spdx.org/licenses/BSD-3-Clause">BSD-3-Clause</license> + <notes> +* New: OPTION_DROP_SEQUENCE + </notes> + </release> + <release> + <date>2014-10-21</date> + <time>18:06:00</time> + <version> + <release>2.0.12</release> + <api>2.0.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="https://spdx.org/licenses/BSD-3-Clause">BSD-3-Clause</license> + <notes> +* Removed: OPTION_DROP_SEQUENCE + </notes> + </release> + <release> + <date>2014-10-18</date> + <time>08:39:00</time> + <version> + <release>2.0.11</release> + <api>2.0.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="https://spdx.org/licenses/BSD-3-Clause">BSD-3-Clause</license> + <notes> +* New: OPTION_DROP_SEQUENCE + </notes> + </release> + <release> + <date>2014-10-09</date> + <time>22:12:00</time> + <version> + <release>2.0.10</release> + <api>2.0.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="https://spdx.org/licenses/BSD-3-Clause">BSD-3-Clause</license> + <notes> +* Imp: composer for pear +* Fix: Documentation problem + </notes> + </release> + <release> + <date>2014-10-08</date> + <time>15:52:00</time> + <version> + <release>2.0.9</release> + <api>2.0.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="https://spdx.org/licenses/BSD-3-Clause">BSD-3-Clause</license> + <notes> +* Fixed #20418: Incorrect normalization of URI with missing authority +* Upd: Test for RFC 3986 Section 1.1.2 Examples +* Upd: Travis CI - PHP 5.6 added + </notes> + </release> + <release> + <date>2014-10-07</date> + <time>23:25:00</time> + <version> + <release>2.0.8</release> + <api>2.0.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="https://spdx.org/licenses/BSD-3-Clause">BSD-3-Clause</license> + <notes> +* Fixed #20420: Inconsistent setAuthority and getAuthority +* Fixed #20423: URI with IPv6 or IPvFuture not parsed +* Imp: Test for RFC 3986 Section 1.1.2 Examples + </notes> + </release> + <release> + <date>2014-09-07</date> + <time>08:34:00</time> + <version> + <release>2.0.7</release>
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +php-net-url2 (2.1.1-1) stable; urgency=low + + * Update to php-net-url2 version 2.1.1 + + -- Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Fri, 23 Jan 2015 11:11:11 +1111 + php-net-url2 (2.0.0-1) stable; urgency=low * Initial Package
View file
php-net-url2.dsc
Changed
@@ -2,12 +2,12 @@ Source: php-net-url2 Binary: php-net-url2 Architecture: all -Version: 2.0.0-1 +Version: 2.1.1-1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Standards-Version: 3.9.1 Build-Depends: debhelper (>= 5) Build-Depends-Indep: php-pear Files: - 00000000000000000000000000000000 0 Net_URL2-2.0.0.tar.gz + 00000000000000000000000000000000 0 Net_URL2-2.1.1.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.