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.
Changes of Revision 19
buildtarball.sh
Changed
x
1
2
}
3
,
4
"require": {
5
- "php": ">=5.4.0",
6
+ "php": ">=5.6.0",
7
"pear/pear-core-minimal": "~1.10.1",
8
- "pear/http_request2": "~2.3.0",
9
+ "pear/http_request2": "~2.5.1",
10
"pear/mail": "~1.4.1",
11
"pear/net_smtp": "~1.7.3",
12
"pear/net_ldap2": "~2.2.0",
13
kolab-webadmin-3.2.16.tar.gz/composer.json
Changed
13
1
2
}
3
,
4
"require": {
5
- "php": ">=5.4.0",
6
+ "php": ">=5.6.0",
7
"pear/pear-core-minimal": "~1.10.1",
8
- "pear/http_request2": "~2.3.0",
9
+ "pear/http_request2": "~2.5.1",
10
"pear/mail": "~1.4.1",
11
"pear/net_smtp": "~1.7.3",
12
"pear/net_ldap2": "~2.2.0",
13
kolab-webadmin-3.2.16.tar.gz/composer.lock
Changed
98
1
2
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
3
"This file is @generated automatically"
4
,
5
- "content-hash": "ef9c39a67aefbc297c125b4d1e2b5919",
6
+ "content-hash": "e3c72f4c19a9800a83f0e0ede288f1c5",
7
"packages":
8
{
9
"name": "kolab/net_ldap3",
10
11
},
12
{
13
"name": "pear/http_request2",
14
- "version": "v2.3.0",
15
+ "version": "v2.5.1",
16
"source": {
17
"type": "git",
18
"url": "https://github.com/pear/HTTP_Request2.git",
19
- "reference": "3599cf0fe455a4e281da464f6510bfc5c2ce54c4"
20
+ "reference": "db4ce7844f838d3adca0513a77420c0fec22ed2d"
21
},
22
"dist": {
23
"type": "zip",
24
- "url": "https://api.github.com/repos/pear/HTTP_Request2/zipball/3599cf0fe455a4e281da464f6510bfc5c2ce54c4",
25
- "reference": "3599cf0fe455a4e281da464f6510bfc5c2ce54c4",
26
+ "url": "https://api.github.com/repos/pear/HTTP_Request2/zipball/db4ce7844f838d3adca0513a77420c0fec22ed2d",
27
+ "reference": "db4ce7844f838d3adca0513a77420c0fec22ed2d",
28
"shasum": ""
29
},
30
"require": {
31
"pear/net_url2": "^2.2.0",
32
"pear/pear_exception": "^1.0.0",
33
- "php": ">=5.2.0"
34
+ "php": ">=5.6.0"
35
+ },
36
+ "require-dev": {
37
+ "yoast/phpunit-polyfills": "^1.0.0"
38
},
39
"suggest": {
40
+ "ext-curl": "Allows using cURL as a request backend.",
41
"ext-fileinfo": "Adds support for looking up mime-types using finfo.",
42
- "ext-zlib": "Allows handling gzip compressed responses.",
43
- "lib-curl": "Allows using cURL as a request backend.",
44
- "lib-openssl": "Allows handling SSL requests when not using cURL."
45
+ "ext-openssl": "Allows handling SSL requests when not using cURL.",
46
+ "ext-zlib": "Allows handling gzip compressed responses."
47
},
48
"type": "library",
49
- "extra": {
50
- "branch-alias": {
51
- "dev-trunk": "2.2-dev"
52
- }
53
- },
54
"autoload": {
55
"psr-0": {
56
"HTTP_Request2": ""
57
}
58
},
59
"notification-url": "https://packagist.org/downloads/",
60
- "include-path":
61
- "./"
62
- ,
63
"license":
64
"BSD-3-Clause"
65
,
66
67
}
68
,
69
"description": "Provides an easy way to perform HTTP requests.",
70
- "homepage": "http://pear.php.net/package/HTTP_Request2",
71
+ "homepage": "https://pear.php.net/package/HTTP_Request2",
72
"keywords":
73
"PEAR",
74
"curl",
75
76
"request"
77
,
78
"support": {
79
- "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name=HTTP_Request2",
80
+ "docs": "https://pear.php.net/manual/en/package.http.http-request2.php",
81
+ "issues": "https://github.com/pear/HTTP_Request2/issues",
82
"source": "https://github.com/pear/HTTP_Request2"
83
},
84
- "time": "2016-02-13T20:20:39+00:00"
85
+ "time": "2022-01-06T18:20:25+00:00"
86
},
87
{
88
"name": "pear/mail",
89
90
"prefer-stable": false,
91
"prefer-lowest": false,
92
"platform": {
93
- "php": ">=5.4.0"
94
+ "php": ">=5.6.0"
95
},
96
"platform-dev": ,
97
"plugin-api-version": "2.1.0"
98
kolab-webadmin-3.2.16.tar.gz/lib/client/kolab_client_task_settings.php
Changed
18
1
2
// See if "administrators" (those who can delete and add back on the entry
3
// level) may override the automatically generated contents of auto_form_fields.
4
//$admin_auto_fields_rw = $this->config_get('admin_auto_fields_rw', false, Conf::BOOL);
5
+ $admin_auto_fields_rw = false;
6
7
foreach ($fields as $idx => $field) {
8
if (!array_key_exists($idx, $attribute_rights)) {
9
10
}
11
}
12
13
- $n_validate = $validate === false ? 'none' : $validate ? $validate : 'default';
14
+ $n_validate = ($validate === false ? 'none' : $validate) ? $validate : 'default';
15
16
// set cell content
17
$row'name''body' = !empty($available$attr) ? $available$attr : $attr;
18
kolab-webadmin-3.2.16.tar.gz/vendor/autoload.php
Changed
7
1
2
3
require_once __DIR__ . '/composer/autoload_real.php';
4
5
-return ComposerAutoloaderInitfc80e97166fe06ad180894c66592f945::getLoader();
6
+return ComposerAutoloaderInit5d7217136c935d31e940c54a7a75cb78::getLoader();
7
kolab-webadmin-3.2.16.tar.gz/vendor/composer/autoload_real.php
Changed
31
1
2
3
// autoload_real.php @generated by Composer
4
5
-class ComposerAutoloaderInitfc80e97166fe06ad180894c66592f945
6
+class ComposerAutoloaderInit5d7217136c935d31e940c54a7a75cb78
7
{
8
private static $loader;
9
10
11
12
require __DIR__ . '/platform_check.php';
13
14
- spl_autoload_register(array('ComposerAutoloaderInitfc80e97166fe06ad180894c66592f945', 'loadClassLoader'), true, true);
15
+ spl_autoload_register(array('ComposerAutoloaderInit5d7217136c935d31e940c54a7a75cb78', 'loadClassLoader'), true, true);
16
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
17
- spl_autoload_unregister(array('ComposerAutoloaderInitfc80e97166fe06ad180894c66592f945', 'loadClassLoader'));
18
+ spl_autoload_unregister(array('ComposerAutoloaderInit5d7217136c935d31e940c54a7a75cb78', 'loadClassLoader'));
19
20
$includePaths = require __DIR__ . '/include_paths.php';
21
$includePaths = get_include_path();
22
23
if ($useStaticLoader) {
24
require __DIR__ . '/autoload_static.php';
25
26
- call_user_func(\Composer\Autoload\ComposerStaticInitfc80e97166fe06ad180894c66592f945::getInitializer($loader));
27
+ call_user_func(\Composer\Autoload\ComposerStaticInit5d7217136c935d31e940c54a7a75cb78::getInitializer($loader));
28
} else {
29
$map = require __DIR__ . '/autoload_namespaces.php';
30
foreach ($map as $namespace => $path) {
31
kolab-webadmin-3.2.16.tar.gz/vendor/composer/autoload_static.php
Changed
23
1
2
3
namespace Composer\Autoload;
4
5
-class ComposerStaticInitfc80e97166fe06ad180894c66592f945
6
+class ComposerStaticInit5d7217136c935d31e940c54a7a75cb78
7
{
8
public static $prefixesPsr0 = array (
9
'N' =>
10
11
public static function getInitializer(ClassLoader $loader)
12
{
13
return \Closure::bind(function () use ($loader) {
14
- $loader->prefixesPsr0 = ComposerStaticInitfc80e97166fe06ad180894c66592f945::$prefixesPsr0;
15
- $loader->fallbackDirsPsr0 = ComposerStaticInitfc80e97166fe06ad180894c66592f945::$fallbackDirsPsr0;
16
- $loader->classMap = ComposerStaticInitfc80e97166fe06ad180894c66592f945::$classMap;
17
+ $loader->prefixesPsr0 = ComposerStaticInit5d7217136c935d31e940c54a7a75cb78::$prefixesPsr0;
18
+ $loader->fallbackDirsPsr0 = ComposerStaticInit5d7217136c935d31e940c54a7a75cb78::$fallbackDirsPsr0;
19
+ $loader->classMap = ComposerStaticInit5d7217136c935d31e940c54a7a75cb78::$classMap;
20
21
}, null, ClassLoader::class);
22
}
23
kolab-webadmin-3.2.16.tar.gz/vendor/composer/include_paths.php
Changed
9
1
2
$vendorDir . '/pear/pear-core-minimal/src',
3
$vendorDir . '/pear/net_ldap2',
4
$vendorDir . '/pear/net_url2',
5
- $vendorDir . '/pear/http_request2',
6
$vendorDir . '/pear/mail',
7
$vendorDir . '/pear/net_socket',
8
$vendorDir . '/pear/net_smtp',
9
kolab-webadmin-3.2.16.tar.gz/vendor/composer/installed.json
Changed
81
1
2
},
3
{
4
"name": "pear/http_request2",
5
- "version": "v2.3.0",
6
- "version_normalized": "2.3.0.0",
7
+ "version": "v2.5.1",
8
+ "version_normalized": "2.5.1.0",
9
"source": {
10
"type": "git",
11
"url": "https://github.com/pear/HTTP_Request2.git",
12
- "reference": "3599cf0fe455a4e281da464f6510bfc5c2ce54c4"
13
+ "reference": "db4ce7844f838d3adca0513a77420c0fec22ed2d"
14
},
15
"dist": {
16
"type": "zip",
17
- "url": "https://api.github.com/repos/pear/HTTP_Request2/zipball/3599cf0fe455a4e281da464f6510bfc5c2ce54c4",
18
- "reference": "3599cf0fe455a4e281da464f6510bfc5c2ce54c4",
19
+ "url": "https://api.github.com/repos/pear/HTTP_Request2/zipball/db4ce7844f838d3adca0513a77420c0fec22ed2d",
20
+ "reference": "db4ce7844f838d3adca0513a77420c0fec22ed2d",
21
"shasum": ""
22
},
23
"require": {
24
"pear/net_url2": "^2.2.0",
25
"pear/pear_exception": "^1.0.0",
26
- "php": ">=5.2.0"
27
+ "php": ">=5.6.0"
28
+ },
29
+ "require-dev": {
30
+ "yoast/phpunit-polyfills": "^1.0.0"
31
},
32
"suggest": {
33
+ "ext-curl": "Allows using cURL as a request backend.",
34
"ext-fileinfo": "Adds support for looking up mime-types using finfo.",
35
- "ext-zlib": "Allows handling gzip compressed responses.",
36
- "lib-curl": "Allows using cURL as a request backend.",
37
- "lib-openssl": "Allows handling SSL requests when not using cURL."
38
+ "ext-openssl": "Allows handling SSL requests when not using cURL.",
39
+ "ext-zlib": "Allows handling gzip compressed responses."
40
},
41
- "time": "2016-02-13T20:20:39+00:00",
42
+ "time": "2022-01-06T18:20:25+00:00",
43
"type": "library",
44
- "extra": {
45
- "branch-alias": {
46
- "dev-trunk": "2.2-dev"
47
- }
48
- },
49
"installation-source": "dist",
50
"autoload": {
51
"psr-0": {
52
53
}
54
},
55
"notification-url": "https://packagist.org/downloads/",
56
- "include-path":
57
- "./"
58
- ,
59
"license":
60
"BSD-3-Clause"
61
,
62
63
}
64
,
65
"description": "Provides an easy way to perform HTTP requests.",
66
- "homepage": "http://pear.php.net/package/HTTP_Request2",
67
+ "homepage": "https://pear.php.net/package/HTTP_Request2",
68
"keywords":
69
"PEAR",
70
"curl",
71
72
"request"
73
,
74
"support": {
75
- "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name=HTTP_Request2",
76
+ "docs": "https://pear.php.net/manual/en/package.http.http-request2.php",
77
+ "issues": "https://github.com/pear/HTTP_Request2/issues",
78
"source": "https://github.com/pear/HTTP_Request2"
79
},
80
"install-path": "../pear/http_request2"
81
kolab-webadmin-3.2.16.tar.gz/vendor/composer/installed.php
Changed
35
1
2
'type' => 'library',
3
'install_path' => __DIR__ . '/../../',
4
'aliases' => array(),
5
- 'reference' => 'c5d26dadf55209fbf46eff20768dd294d950dea5',
6
+ 'reference' => '86f093e1f9abb7eca80faae964ce7eea282bef72',
7
'name' => 'kolab/webadmin',
8
'dev' => true,
9
),
10
11
'type' => 'library',
12
'install_path' => __DIR__ . '/../../',
13
'aliases' => array(),
14
- 'reference' => 'c5d26dadf55209fbf46eff20768dd294d950dea5',
15
+ 'reference' => '86f093e1f9abb7eca80faae964ce7eea282bef72',
16
'dev_requirement' => false,
17
),
18
'pear/console_getopt' => array(
19
20
'dev_requirement' => false,
21
),
22
'pear/http_request2' => array(
23
- 'pretty_version' => 'v2.3.0',
24
- 'version' => '2.3.0.0',
25
+ 'pretty_version' => 'v2.5.1',
26
+ 'version' => '2.5.1.0',
27
'type' => 'library',
28
'install_path' => __DIR__ . '/../pear/http_request2',
29
'aliases' => array(),
30
- 'reference' => '3599cf0fe455a4e281da464f6510bfc5c2ce54c4',
31
+ 'reference' => 'db4ce7844f838d3adca0513a77420c0fec22ed2d',
32
'dev_requirement' => false,
33
),
34
'pear/mail' => array(
35
kolab-webadmin-3.2.16.tar.gz/vendor/composer/platform_check.php
Changed
12
1
2
3
$issues = array();
4
5
-if (!(PHP_VERSION_ID >= 50400)) {
6
- $issues = 'Your Composer dependencies require a PHP version ">= 5.4.0". You are running ' . PHP_VERSION . '.';
7
+if (!(PHP_VERSION_ID >= 50600)) {
8
+ $issues = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.';
9
}
10
11
if ($issues) {
12
kolab-webadmin-3.2.16.tar.gz/vendor/kolab/net_ldap3/.git/index
Changed
kolab-webadmin-3.2.16.tar.gz/vendor/kolab/net_ldap3/.git/logs/HEAD
Changed
8
1
2
-0000000000000000000000000000000000000000 5fa4880317618d053afb32ee2b3a6f388ef1b38d Christian Mollekopf <mollekopf@apheleia-it.ch> 1683199818 +0200 clone: from /home/mollekopf/.cache/composer/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/
3
-5fa4880317618d053afb32ee2b3a6f388ef1b38d 5fa4880317618d053afb32ee2b3a6f388ef1b38d Christian Mollekopf <mollekopf@apheleia-it.ch> 1683199818 +0200 checkout: moving from master to master
4
-5fa4880317618d053afb32ee2b3a6f388ef1b38d 5fa4880317618d053afb32ee2b3a6f388ef1b38d Christian Mollekopf <mollekopf@apheleia-it.ch> 1683199818 +0200 reset: moving to 5fa4880317618d053afb32ee2b3a6f388ef1b38d
5
+0000000000000000000000000000000000000000 5fa4880317618d053afb32ee2b3a6f388ef1b38d Christian Mollekopf <mollekopf@apheleia-it.ch> 1683888880 +0200 clone: from /home/mollekopf/.cache/composer/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/
6
+5fa4880317618d053afb32ee2b3a6f388ef1b38d 5fa4880317618d053afb32ee2b3a6f388ef1b38d Christian Mollekopf <mollekopf@apheleia-it.ch> 1683888880 +0200 checkout: moving from master to master
7
+5fa4880317618d053afb32ee2b3a6f388ef1b38d 5fa4880317618d053afb32ee2b3a6f388ef1b38d Christian Mollekopf <mollekopf@apheleia-it.ch> 1683888880 +0200 reset: moving to 5fa4880317618d053afb32ee2b3a6f388ef1b38d
8
kolab-webadmin-3.2.16.tar.gz/vendor/kolab/net_ldap3/.git/logs/refs/heads/master
Changed
4
1
2
-0000000000000000000000000000000000000000 5fa4880317618d053afb32ee2b3a6f388ef1b38d Christian Mollekopf <mollekopf@apheleia-it.ch> 1683199818 +0200 clone: from /home/mollekopf/.cache/composer/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/
3
+0000000000000000000000000000000000000000 5fa4880317618d053afb32ee2b3a6f388ef1b38d Christian Mollekopf <mollekopf@apheleia-it.ch> 1683888880 +0200 clone: from /home/mollekopf/.cache/composer/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/
4
kolab-webadmin-3.2.16.tar.gz/vendor/kolab/net_ldap3/.git/logs/refs/remotes/origin/HEAD
Changed
4
1
2
-0000000000000000000000000000000000000000 5fa4880317618d053afb32ee2b3a6f388ef1b38d Christian Mollekopf <mollekopf@apheleia-it.ch> 1683199818 +0200 clone: from /home/mollekopf/.cache/composer/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/
3
+0000000000000000000000000000000000000000 5fa4880317618d053afb32ee2b3a6f388ef1b38d Christian Mollekopf <mollekopf@apheleia-it.ch> 1683888880 +0200 clone: from /home/mollekopf/.cache/composer/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/
4
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/.travis.yml
Deleted
36
1
2
-language: php
3
-php:
4
- - 5.3
5
- - 5.4
6
- - 5.5
7
- - 5.6
8
- - 7.0
9
-install: pear install Net_URL2
10
-addons:
11
- hosts:
12
- - hr2.local
13
- - www.hr2.local
14
-before_script:
15
- # directory for apache logs
16
- - mkdir -p $TRAVIS_BUILD_DIR/logs
17
- # As described @ http://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
18
- - sudo apt-get update
19
- - sudo apt-get install apache2 libapache2-mod-php5
20
- #- sudo apt-get install apache2 libapache2-mod-fastcgi
21
- # enable php-fpm
22
- #- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
23
- #- sudo a2enmod rewrite actions fastcgi alias
24
- #- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
25
- #- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
26
- # configure apache virtual hosts
27
- - sudo cp -f tests/travis-ci-apache /etc/apache2/sites-available/default
28
- - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
29
- - sudo service apache2 restart
30
- # use travis config for network-backed tests
31
- - cp tests/NetworkConfig.php.travis tests/NetworkConfig.php
32
-script: phpunit tests
33
-after_failure:
34
- - cat $TRAVIS_BUILD_DIR/logs/hr2-error.log
35
- - cat $TRAVIS_BUILD_DIR/logs/hr2-access.log
36
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/Changelog.md
Added
56
1
2
+# Changelog
3
+
4
+## 2.5.1 - 2022-01-06
5
+
6
+* The package runs under PHP 8.1 without `E_DEPRECATED` messages (see issue #25)
7
+* Updated Public Suffix List
8
+
9
+## 2.5.0 - 2021-07-12
10
+
11
+### Fixed
12
+* Socket adapter will now retry writing to socket rather than throw an exception if `fwrite()` call returns zero written bytes (issue #23)
13
+
14
+### Changed
15
+* Socket adapter will use only TLS 1.2 and TLS 1.3 (the latter is available on PHP 7.4+)
16
+* Upgraded tests for PHPUnit 9 compatibility, PHPUnit Polyfills package is used to run them on PHP 5.6 to PHP 8
17
+* Test suite now runs on Github Actions rather than on Travis
18
+* Updated Public Suffix List
19
+
20
+## 2.4.2 - 2020-09-24
21
+### Fixed
22
+Socket adapter could prematurely end receiving the response body due to `fread()` call returning an empty string
23
+
24
+## 2.4.1 - 2020-08-01
25
+### Fixed
26
+* Switch socket to blocking mode when enabling crypto, this fixes HTTPS requests
27
+ through proxy with Socket adapter (issue #20)
28
+* Add `.gitattributes` file to omit installing tests (issue #19)
29
+
30
+## 2.4.0 - 2020-07-26
31
+
32
+* Minimum required version is now PHP 5.6, as using older versions for HTTPS
33
+ requests may be insecure
34
+* Removed support for magic_quotes_runtime, as get_magic_quotes_runtime()
35
+ was deprecated in PHP 7.4 and the functionality itself was disabled
36
+ since PHP 5.4 (PEAR bug #23839)
37
+* Socket adapter now uses socket in non-blocking mode, as some configurations
38
+ could have problems with timeouts in HTTPS requests (PEAR bug #21229)
39
+* Fixed bogus size check error with gzipped responses larger than 4 GiB
40
+ uncompressed (PEAR bug #21239)
41
+* Use current "Intermediate compatibility" cipher list
42
+* Updated Public Suffix List
43
+
44
+The package is now 100% autoload-compatible, when installed with composer it
45
+no longer uses include-path and does not contain require_once statements
46
+
47
+PEAR bug #23839: https://pear.php.net/bugs/bug.php?id=23839
48
+PEAR bug #21229: https://pear.php.net/bugs/bug.php?id=21229
49
+PEAR bug #21239: https://pear.php.net/bugs/bug.php?id=21239
50
+PHPUnit Polyfills package: https://github.com/Yoast/PHPUnit-Polyfills
51
+issue #19: https://github.com/pear/HTTP_Request2/issues/19
52
+issue #20: https://github.com/pear/HTTP_Request2/issues/20
53
+issue #23: https://github.com/pear/HTTP_Request2/issues/23
54
+issue #25: https://github.com/pear/HTTP_Request2/issues/25
55
\ No newline at end of file
56
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2.php
Changed
201
1
2
* @category HTTP
3
* @package HTTP_Request2
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-/**
12
- * A class representing an URL as per RFC 3986.
13
- */
14
-if (!class_exists('Net_URL2', true)) {
15
- require_once 'Net/URL2.php';
16
-}
17
+// pear-package-only /**
18
+// pear-package-only * A class representing an URL as per RFC 3986.
19
+// pear-package-only */
20
+// pear-package-only require_once 'Net/URL2.php';
21
22
-/**
23
- * Exception class for HTTP_Request2 package
24
- */
25
-require_once 'HTTP/Request2/Exception.php';
26
+// pear-package-only /**
27
+// pear-package-only * Exception class for HTTP_Request2 package
28
+// pear-package-only */
29
+// pear-package-only require_once 'HTTP/Request2/Exception.php';
30
31
/**
32
* Class representing a HTTP request message
33
34
*/
35
class HTTP_Request2 implements SplSubject
36
{
37
- /**#@+
38
+ /**
39
+ * #@+
40
* Constants for HTTP request methods
41
*
42
* @link http://tools.ietf.org/html/rfc2616#section-5.1.1
43
44
const METHOD_DELETE = 'DELETE';
45
const METHOD_TRACE = 'TRACE';
46
const METHOD_CONNECT = 'CONNECT';
47
- /**#@-*/
48
+ /**
49
+ * #@-
50
+ */
51
52
- /**#@+
53
+ /**
54
+ * #@+
55
* Constants for HTTP authentication schemes
56
*
57
* @link http://tools.ietf.org/html/rfc2617
58
*/
59
const AUTH_BASIC = 'basic';
60
const AUTH_DIGEST = 'digest';
61
- /**#@-*/
62
+ /**
63
+ * #@-
64
+ */
65
66
/**
67
* Regular expression used to check for invalid symbols in RFC 2616 tokens
68
+ *
69
* @link http://pear.php.net/bugs/bug.php?id=15630
70
*/
71
const REGEXP_INVALID_TOKEN = '!\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\\?={}\s!';
72
73
/**
74
* Regular expression used to check for invalid symbols in cookie strings
75
+ *
76
* @link http://pear.php.net/bugs/bug.php?id=15630
77
* @link http://web.archive.org/web/20080331104521/http://cgi.netscape.com/newsref/std/cookie_spec.html
78
*/
79
80
81
/**
82
* Fileinfo magic database resource
83
- * @var resource
84
- * @see detectMimeType()
85
+ *
86
+ * @var resource
87
+ * @see detectMimeType()
88
*/
89
private static $_fileinfoDb;
90
91
/**
92
* Observers attached to the request (instances of SplObserver)
93
- * @var array
94
+ *
95
+ * @var array
96
*/
97
- protected $observers = array();
98
+ protected $observers = ;
99
100
/**
101
* Request URL
102
- * @var Net_URL2
103
+ *
104
+ * @var Net_URL2
105
*/
106
protected $url;
107
108
/**
109
* Request method
110
- * @var string
111
+ *
112
+ * @var string
113
*/
114
protected $method = self::METHOD_GET;
115
116
/**
117
* Authentication data
118
- * @var array
119
- * @see getAuth()
120
+ *
121
+ * @var array
122
+ * @see getAuth()
123
*/
124
protected $auth;
125
126
/**
127
* Request headers
128
- * @var array
129
+ *
130
+ * @var array
131
*/
132
- protected $headers = array();
133
+ protected $headers = ;
134
135
/**
136
* Configuration parameters
137
- * @var array
138
- * @see setConfig()
139
+ *
140
+ * @var array
141
+ * @see setConfig()
142
*/
143
- protected $config = array(
144
+ protected $config =
145
'adapter' => 'HTTP_Request2_Adapter_Socket',
146
'connect_timeout' => 10,
147
'timeout' => 0,
148
149
'follow_redirects' => false,
150
'max_redirects' => 5,
151
'strict_redirects' => false
152
- );
153
+ ;
154
155
/**
156
* Last event in request / response handling, intended for observers
157
- * @var array
158
- * @see getLastEvent()
159
+ *
160
+ * @var array
161
+ * @see getLastEvent()
162
*/
163
- protected $lastEvent = array(
164
+ protected $lastEvent =
165
'name' => 'start',
166
'data' => null
167
- );
168
+ ;
169
170
/**
171
* Request body
172
- * @var string|resource
173
- * @see setBody()
174
+ *
175
+ * @var string|resource
176
+ * @see setBody()
177
*/
178
protected $body = '';
179
180
/**
181
* Array of POST parameters
182
- * @var array
183
+ *
184
+ * @var array
185
*/
186
- protected $postParams = array();
187
+ protected $postParams = ;
188
189
/**
190
* Array of file uploads (for multipart/form-data POST requests)
191
- * @var array
192
+ *
193
+ * @var array
194
*/
195
- protected $uploads = array();
196
+ protected $uploads = ;
197
198
/**
199
* Adapter used to perform actual HTTP request
200
- * @var HTTP_Request2_Adapter
201
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/Adapter.php
Changed
93
1
2
* @category HTTP
3
* @package HTTP_Request2
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-/**
12
- * Class representing a HTTP response
13
- */
14
-require_once 'HTTP/Request2/Response.php';
15
+// pear-package-only /**
16
+// pear-package-only * Class representing a HTTP response
17
+// pear-package-only */
18
+// pear-package-only require_once 'HTTP/Request2/Response.php';
19
20
/**
21
* Base class for HTTP_Request2 adapters
22
23
{
24
/**
25
* A list of methods that MUST NOT have a request body, per RFC 2616
26
- * @var array
27
+ *
28
+ * @var array
29
*/
30
- protected static $bodyDisallowed = array('TRACE');
31
+ protected static $bodyDisallowed = 'TRACE';
32
33
/**
34
* Methods having defined semantics for request body
35
36
* @link http://pear.php.net/bugs/bug.php?id=12900
37
* @link http://pear.php.net/bugs/bug.php?id=14740
38
*/
39
- protected static $bodyRequired = array('POST', 'PUT');
40
+ protected static $bodyRequired = 'POST', 'PUT';
41
42
/**
43
* Request being sent
44
- * @var HTTP_Request2
45
+ *
46
+ * @var HTTP_Request2
47
*/
48
protected $request;
49
50
/**
51
* Request body
52
- * @var string|resource|HTTP_Request2_MultipartBody
53
- * @see HTTP_Request2::getBody()
54
+ *
55
+ * @var string|resource|HTTP_Request2_MultipartBody
56
+ * @see HTTP_Request2::getBody()
57
*/
58
protected $requestBody;
59
60
/**
61
* Length of the request body
62
- * @var integer
63
+ *
64
+ * @var integer
65
*/
66
protected $contentLength;
67
68
69
*
70
* @param HTTP_Request2 $request HTTP request message
71
*
72
- * @return HTTP_Request2_Response
73
- * @throws HTTP_Request2_Exception
74
+ * @return HTTP_Request2_Response
75
+ * @throws HTTP_Request2_Exception
76
*/
77
abstract public function sendRequest(HTTP_Request2 $request);
78
79
/**
80
* Calculates length of the request body, adds proper headers
81
*
82
- * @param array &$headers associative array of request headers, this method
83
- * will add proper 'Content-Length' and 'Content-Type'
84
- * headers to this array (or remove them if not needed)
85
+ * @param array $headers associative array of request headers, this method
86
+ * will add proper 'Content-Length' and 'Content-Type'
87
+ * headers to this array (or remove them if not needed)
88
+ *
89
+ * @return void
90
*/
91
protected function calculateRequestLength(&$headers)
92
{
93
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/Adapter/Curl.php
Changed
201
1
2
* @category HTTP
3
* @package HTTP_Request2
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-/**
12
- * Base class for HTTP_Request2 adapters
13
- */
14
-require_once 'HTTP/Request2/Adapter.php';
15
+// pear-package-only /**
16
+// pear-package-only * Base class for HTTP_Request2 adapters
17
+// pear-package-only */
18
+// pear-package-only require_once 'HTTP/Request2/Adapter.php';
19
20
/**
21
* Adapter for HTTP_Request2 wrapping around cURL extension
22
23
{
24
/**
25
* Mapping of header names to cURL options
26
- * @var array
27
+ *
28
+ * @var array
29
*/
30
- protected static $headerMap = array(
31
+ protected static $headerMap =
32
'accept-encoding' => CURLOPT_ENCODING,
33
'cookie' => CURLOPT_COOKIE,
34
'referer' => CURLOPT_REFERER,
35
'user-agent' => CURLOPT_USERAGENT
36
- );
37
+ ;
38
39
/**
40
* Mapping of SSL context options to cURL options
41
- * @var array
42
+ *
43
+ * @var array
44
*/
45
- protected static $sslContextMap = array(
46
+ protected static $sslContextMap =
47
'ssl_verify_peer' => CURLOPT_SSL_VERIFYPEER,
48
'ssl_cafile' => CURLOPT_CAINFO,
49
'ssl_capath' => CURLOPT_CAPATH,
50
'ssl_local_cert' => CURLOPT_SSLCERT,
51
'ssl_passphrase' => CURLOPT_SSLCERTPASSWD
52
- );
53
+ ;
54
55
/**
56
* Mapping of CURLE_* constants to Exception subclasses and error codes
57
- * @var array
58
+ *
59
+ * @var array
60
*/
61
- protected static $errorMap = array(
62
- CURLE_UNSUPPORTED_PROTOCOL => array('HTTP_Request2_MessageException',
63
- HTTP_Request2_Exception::NON_HTTP_REDIRECT),
64
- CURLE_COULDNT_RESOLVE_PROXY => array('HTTP_Request2_ConnectionException'),
65
- CURLE_COULDNT_RESOLVE_HOST => array('HTTP_Request2_ConnectionException'),
66
- CURLE_COULDNT_CONNECT => array('HTTP_Request2_ConnectionException'),
67
+ protected static $errorMap =
68
+ CURLE_UNSUPPORTED_PROTOCOL => 'HTTP_Request2_MessageException',
69
+ HTTP_Request2_Exception::NON_HTTP_REDIRECT,
70
+ CURLE_COULDNT_RESOLVE_PROXY => 'HTTP_Request2_ConnectionException',
71
+ CURLE_COULDNT_RESOLVE_HOST => 'HTTP_Request2_ConnectionException',
72
+ CURLE_COULDNT_CONNECT => 'HTTP_Request2_ConnectionException',
73
// error returned from write callback
74
- CURLE_WRITE_ERROR => array('HTTP_Request2_MessageException',
75
- HTTP_Request2_Exception::NON_HTTP_REDIRECT),
76
- CURLE_OPERATION_TIMEOUTED => array('HTTP_Request2_MessageException',
77
- HTTP_Request2_Exception::TIMEOUT),
78
- CURLE_HTTP_RANGE_ERROR => array('HTTP_Request2_MessageException'),
79
- CURLE_SSL_CONNECT_ERROR => array('HTTP_Request2_ConnectionException'),
80
- CURLE_LIBRARY_NOT_FOUND => array('HTTP_Request2_LogicException',
81
- HTTP_Request2_Exception::MISCONFIGURATION),
82
- CURLE_FUNCTION_NOT_FOUND => array('HTTP_Request2_LogicException',
83
- HTTP_Request2_Exception::MISCONFIGURATION),
84
- CURLE_ABORTED_BY_CALLBACK => array('HTTP_Request2_MessageException',
85
- HTTP_Request2_Exception::NON_HTTP_REDIRECT),
86
- CURLE_TOO_MANY_REDIRECTS => array('HTTP_Request2_MessageException',
87
- HTTP_Request2_Exception::TOO_MANY_REDIRECTS),
88
- CURLE_SSL_PEER_CERTIFICATE => array('HTTP_Request2_ConnectionException'),
89
- CURLE_GOT_NOTHING => array('HTTP_Request2_MessageException'),
90
- CURLE_SSL_ENGINE_NOTFOUND => array('HTTP_Request2_LogicException',
91
- HTTP_Request2_Exception::MISCONFIGURATION),
92
- CURLE_SSL_ENGINE_SETFAILED => array('HTTP_Request2_LogicException',
93
- HTTP_Request2_Exception::MISCONFIGURATION),
94
- CURLE_SEND_ERROR => array('HTTP_Request2_MessageException'),
95
- CURLE_RECV_ERROR => array('HTTP_Request2_MessageException'),
96
- CURLE_SSL_CERTPROBLEM => array('HTTP_Request2_LogicException',
97
- HTTP_Request2_Exception::INVALID_ARGUMENT),
98
- CURLE_SSL_CIPHER => array('HTTP_Request2_ConnectionException'),
99
- CURLE_SSL_CACERT => array('HTTP_Request2_ConnectionException'),
100
- CURLE_BAD_CONTENT_ENCODING => array('HTTP_Request2_MessageException'),
101
- );
102
+ CURLE_WRITE_ERROR => 'HTTP_Request2_MessageException',
103
+ HTTP_Request2_Exception::NON_HTTP_REDIRECT,
104
+ CURLE_OPERATION_TIMEOUTED => 'HTTP_Request2_MessageException',
105
+ HTTP_Request2_Exception::TIMEOUT,
106
+ CURLE_HTTP_RANGE_ERROR => 'HTTP_Request2_MessageException',
107
+ CURLE_SSL_CONNECT_ERROR => 'HTTP_Request2_ConnectionException',
108
+ CURLE_LIBRARY_NOT_FOUND => 'HTTP_Request2_LogicException',
109
+ HTTP_Request2_Exception::MISCONFIGURATION,
110
+ CURLE_FUNCTION_NOT_FOUND => 'HTTP_Request2_LogicException',
111
+ HTTP_Request2_Exception::MISCONFIGURATION,
112
+ CURLE_ABORTED_BY_CALLBACK => 'HTTP_Request2_MessageException',
113
+ HTTP_Request2_Exception::NON_HTTP_REDIRECT,
114
+ CURLE_TOO_MANY_REDIRECTS => 'HTTP_Request2_MessageException',
115
+ HTTP_Request2_Exception::TOO_MANY_REDIRECTS,
116
+ CURLE_SSL_PEER_CERTIFICATE => 'HTTP_Request2_ConnectionException',
117
+ CURLE_GOT_NOTHING => 'HTTP_Request2_MessageException',
118
+ CURLE_SSL_ENGINE_NOTFOUND => 'HTTP_Request2_LogicException',
119
+ HTTP_Request2_Exception::MISCONFIGURATION,
120
+ CURLE_SSL_ENGINE_SETFAILED => 'HTTP_Request2_LogicException',
121
+ HTTP_Request2_Exception::MISCONFIGURATION,
122
+ CURLE_SEND_ERROR => 'HTTP_Request2_MessageException',
123
+ CURLE_RECV_ERROR => 'HTTP_Request2_MessageException',
124
+ CURLE_SSL_CERTPROBLEM => 'HTTP_Request2_LogicException',
125
+ HTTP_Request2_Exception::INVALID_ARGUMENT,
126
+ CURLE_SSL_CIPHER => 'HTTP_Request2_ConnectionException',
127
+ CURLE_SSL_CACERT => 'HTTP_Request2_ConnectionException',
128
+ CURLE_BAD_CONTENT_ENCODING => 'HTTP_Request2_MessageException',
129
+ ;
130
131
/**
132
* Response being received
133
- * @var HTTP_Request2_Response
134
+ *
135
+ * @var HTTP_Request2_Response
136
*/
137
protected $response;
138
139
/**
140
* Whether 'sentHeaders' event was sent to observers
141
- * @var boolean
142
+ *
143
+ * @var boolean
144
*/
145
protected $eventSentHeaders = false;
146
147
/**
148
* Whether 'receivedHeaders' event was sent to observers
149
+ *
150
* @var boolean
151
*/
152
protected $eventReceivedHeaders = false;
153
154
/**
155
* Whether 'sentBoody' event was sent to observers
156
+ *
157
* @var boolean
158
*/
159
protected $eventSentBody = false;
160
161
/**
162
* Position within request body
163
- * @var integer
164
- * @see callbackReadBody()
165
+ *
166
+ * @var integer
167
+ * @see callbackReadBody()
168
*/
169
protected $position = 0;
170
171
/**
172
* Information about last transfer, as returned by curl_getinfo()
173
- * @var array
174
+ *
175
+ * @var array
176
*/
177
protected $lastInfo;
178
179
180
*
181
* @param HTTP_Request2 $request HTTP request message
182
*
183
- * @return HTTP_Request2_Response
184
- * @throws HTTP_Request2_Exception
185
+ * @return HTTP_Request2_Response
186
+ * @throws HTTP_Request2_Exception
187
*/
188
public function sendRequest(HTTP_Request2 $request)
189
{
190
191
192
try {
193
if (false === curl_exec($ch = $this->createCurlHandle())) {
194
- $e = self::wrapCurlError($ch);
195
+ throw self::wrapCurlError($ch);
196
}
197
- } catch (Exception $e) {
198
- }
199
- if (isset($ch)) {
200
- $this->lastInfo = curl_getinfo($ch);
201
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/Adapter/Mock.php
Changed
94
1
2
* @category HTTP
3
* @package HTTP_Request2
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-/**
12
- * Base class for HTTP_Request2 adapters
13
- */
14
-require_once 'HTTP/Request2/Adapter.php';
15
+// pear-package-only /**
16
+// pear-package-only * Base class for HTTP_Request2 adapters
17
+// pear-package-only */
18
+// pear-package-only require_once 'HTTP/Request2/Adapter.php';
19
20
/**
21
* Mock adapter intended for testing
22
23
{
24
/**
25
* A queue of responses to be returned by sendRequest()
26
- * @var array
27
+ *
28
+ * @var array
29
*/
30
- protected $responses = array();
31
+ protected $responses = ;
32
33
/**
34
* Returns the next response from the queue built by addResponse()
35
36
*
37
* @param HTTP_Request2 $request HTTP request message
38
*
39
- * @return HTTP_Request2_Response
40
- * @throws Exception
41
+ * @return HTTP_Request2_Response
42
+ * @throws Exception
43
*/
44
public function sendRequest(HTTP_Request2 $request)
45
{
46
47
* @param string $url A request URL this response should be valid for
48
* (see {@link http://pear.php.net/bugs/bug.php?id=19276})
49
*
50
- * @throws HTTP_Request2_Exception
51
+ * @return void
52
+ * @throws HTTP_Request2_Exception
53
*/
54
public function addResponse($response, $url = null)
55
{
56
57
$response = self::createResponseFromString($response);
58
} elseif (is_resource($response)) {
59
$response = self::createResponseFromFile($response);
60
- } elseif (!$response instanceof HTTP_Request2_Response &&
61
- !$response instanceof Exception
62
+ } elseif (!$response instanceof HTTP_Request2_Response
63
+ && !$response instanceof Exception
64
) {
65
throw new HTTP_Request2_Exception('Parameter is not a valid response');
66
}
67
- $this->responses = array($response, $url);
68
+ $this->responses = $response, $url;
69
}
70
71
/**
72
73
*
74
* @param string $str string containing HTTP response message
75
*
76
- * @return HTTP_Request2_Response
77
- * @throws HTTP_Request2_Exception
78
+ * @return HTTP_Request2_Response
79
+ * @throws HTTP_Request2_Exception
80
*/
81
public static function createResponseFromString($str)
82
{
83
84
*
85
* @param resource $fp file pointer returned by fopen()
86
*
87
- * @return HTTP_Request2_Response
88
- * @throws HTTP_Request2_Exception
89
+ * @return HTTP_Request2_Response
90
+ * @throws HTTP_Request2_Exception
91
*/
92
public static function createResponseFromFile($fp)
93
{
94
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/Adapter/Socket.php
Changed
201
1
2
* @category HTTP
3
* @package HTTP_Request2
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-/** Base class for HTTP_Request2 adapters */
12
-require_once 'HTTP/Request2/Adapter.php';
13
+// pear-package-only /** Base class for HTTP_Request2 adapters */
14
+// pear-package-only require_once 'HTTP/Request2/Adapter.php';
15
16
-/** Socket wrapper class */
17
-require_once 'HTTP/Request2/SocketWrapper.php';
18
+// pear-package-only /** Socket wrapper class */
19
+// pear-package-only require_once 'HTTP/Request2/SocketWrapper.php';
20
21
/**
22
* Socket-based adapter for HTTP_Request2
23
24
25
/**
26
* Connected sockets, needed for Keep-Alive support
27
- * @var array
28
- * @see connect()
29
+ *
30
+ * @var array
31
+ * @see connect()
32
*/
33
- protected static $sockets = array();
34
+ protected static $sockets = ;
35
36
/**
37
* Data for digest authentication scheme
38
39
* duplicate requests to digest-protected resources after we have already
40
* received the challenge.
41
*
42
- * @var array
43
+ * @var array
44
*/
45
- protected static $challenges = array();
46
+ protected static $challenges = ;
47
48
/**
49
* Connected socket
50
- * @var HTTP_Request2_SocketWrapper
51
- * @see connect()
52
+ *
53
+ * @var HTTP_Request2_SocketWrapper
54
+ * @see connect()
55
*/
56
protected $socket;
57
58
/**
59
* Challenge used for server digest authentication
60
- * @var array
61
+ *
62
+ * @var array
63
*/
64
protected $serverChallenge;
65
66
/**
67
* Challenge used for proxy digest authentication
68
- * @var array
69
+ *
70
+ * @var array
71
*/
72
protected $proxyChallenge;
73
74
/**
75
* Remaining length of the current chunk, when reading chunked response
76
- * @var integer
77
- * @see readChunked()
78
+ *
79
+ * @var integer
80
+ * @see readChunked()
81
*/
82
protected $chunkLength = 0;
83
84
85
* Starts at 'max_redirects' configuration parameter and is reduced on each
86
* subsequent redirect. An Exception will be thrown once it reaches zero.
87
*
88
- * @var integer
89
+ * @var integer
90
*/
91
protected $redirectCountdown = null;
92
93
/**
94
* Whether to wait for "100 Continue" response before sending request body
95
+ *
96
* @var bool
97
*/
98
protected $expect100Continue = false;
99
100
*
101
* @param HTTP_Request2 $request HTTP request message
102
*
103
- * @return HTTP_Request2_Response
104
- * @throws HTTP_Request2_Exception
105
+ * @return HTTP_Request2_Response
106
+ * @throws HTTP_Request2_Exception
107
*/
108
public function sendRequest(HTTP_Request2 $request)
109
{
110
111
112
} catch (Exception $e) {
113
$this->disconnect();
114
- }
115
-
116
- unset($this->request, $this->requestBody);
117
-
118
- if (!empty($e)) {
119
$this->redirectCountdown = null;
120
throw $e;
121
+
122
+ } finally {
123
+ unset($this->request, $this->requestBody);
124
}
125
126
if (!$request->getConfig('follow_redirects') || !$response->isRedirect()) {
127
128
/**
129
* Connects to the remote server
130
*
131
- * @return bool whether the connection can be persistent
132
- * @throws HTTP_Request2_Exception
133
+ * @return bool whether the connection can be persistent
134
+ * @throws HTTP_Request2_Exception
135
*/
136
protected function connect()
137
{
138
139
(!empty($headers'connection') &&
140
'Keep-Alive' == $headers'connection');
141
142
- $options = array();
143
+ $options = ;
144
if ($ip = $this->request->getConfig('local_ip')) {
145
- $options'socket' = array(
146
+ $options'socket' =
147
'bindto' => (false === strpos($ip, ':') ? $ip : '' . $ip . '') . ':0'
148
- );
149
+ ;
150
}
151
if ($secure || $tunnel) {
152
- $options'ssl' = array();
153
+ $options'ssl' = ;
154
foreach ($this->request->getConfig() as $name => $value) {
155
if ('ssl_' == substr($name, 0, 4) && null !== $value) {
156
if ('ssl_verify_host' == $name) {
157
- if (version_compare(phpversion(), '5.6', '<')) {
158
- if ($value) {
159
- $options'ssl''CN_match' = $reqHost;
160
- }
161
-
162
- } else {
163
- $options'ssl''verify_peer_name' = $value;
164
- $options'ssl''peer_name' = $reqHost;
165
- }
166
+ $options'ssl''verify_peer_name' = $value;
167
+ $options'ssl''peer_name' = $reqHost;
168
169
} else {
170
$options'ssl'substr($name, 4) = $value;
171
172
173
// Use global request timeout if given, see feature requests #5735, #8964
174
if ($timeout = $this->request->getConfig('timeout')) {
175
- $deadline = time() + $timeout;
176
+ $deadline = microtime(true) + $timeout;
177
} else {
178
$deadline = null;
179
}
180
181
182
} else {
183
if ($socksProxy) {
184
- require_once 'HTTP/Request2/SOCKS5.php';
185
+ // pear-package-only require_once 'HTTP/Request2/SOCKS5.php';
186
187
$this->socket = new HTTP_Request2_SOCKS5(
188
$remote, $this->request->getConfig('connect_timeout'),
189
190
* sees that we are connected to a proxy server (duh!) rather than the server
191
* that presents its certificate.
192
*
193
- * @link http://tools.ietf.org/html/rfc2817#section-5.2
194
- * @throws HTTP_Request2_Exception
195
+ * @link http://tools.ietf.org/html/rfc2817#section-5.2
196
+ *
197
+ * @return void
198
+ * @throws HTTP_Request2_Exception
199
*/
200
protected function establishTunnel()
201
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/ConnectionException.php
Added
41
1
2
+<?php
3
+/**
4
+ * Exception classes for HTTP_Request2 package
5
+ *
6
+ * PHP version 5
7
+ *
8
+ * LICENSE
9
+ *
10
+ * This source file is subject to BSD 3-Clause License that is bundled
11
+ * with this package in the file LICENSE and available at the URL
12
+ * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
+ *
14
+ * @category HTTP
15
+ * @package HTTP_Request2
16
+ * @author Alexey Borzov <avb@php.net>
17
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
18
+ * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
+ * @link http://pear.php.net/package/HTTP_Request2
20
+ */
21
+
22
+/**
23
+ * Exception thrown when connection to a web or proxy server fails
24
+ *
25
+ * The exception will not contain a package error code, but will contain
26
+ * native error code, as returned by stream_socket_client() or curl_errno().
27
+ *
28
+ * @category HTTP
29
+ * @package HTTP_Request2
30
+ * @author Alexey Borzov <avb@php.net>
31
+ * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
32
+ * @version Release: @package_version@
33
+ * @link http://pear.php.net/package/HTTP_Request2
34
+ */
35
+class HTTP_Request2_ConnectionException extends HTTP_Request2_Exception
36
+{
37
+}
38
+
39
+?>
40
\ No newline at end of file
41
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/CookieJar.php
Changed
201
1
2
* @category HTTP
3
* @package HTTP_Request2
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-/** Class representing a HTTP request message */
12
-require_once 'HTTP/Request2.php';
13
+// pear-package-only /** Class representing a HTTP request message */
14
+// pear-package-only require_once 'HTTP/Request2.php';
15
16
/**
17
* Stores cookies and passes them between HTTP requests
18
19
*
20
* @var array
21
*/
22
- protected $cookies = array();
23
+ protected $cookies = ;
24
25
/**
26
* Whether session cookies should be serialized when serializing the jar
27
+ *
28
* @var bool
29
*/
30
protected $serializeSession = false;
31
32
/**
33
* Whether Public Suffix List should be used for domain matching
34
+ *
35
* @var bool
36
*/
37
protected $useList = true;
38
39
/**
40
* Whether an attempt to store an invalid cookie should be ignored, rather than cause an Exception
41
+ *
42
* @var bool
43
*/
44
protected $ignoreInvalid = false;
45
46
/**
47
* Array with Public Suffix List data
48
+ *
49
* @var array
50
* @link http://publicsuffix.org/
51
*/
52
- protected static $psl = array();
53
+ protected static $psl = ;
54
55
/**
56
* Class constructor, sets various options
57
58
* {@link HTTP_Request2_Response::getCookies()}
59
* @param Net_URL2 $setter URL of the document that sent Set-Cookie header
60
*
61
- * @return array Updated cookie array
62
- * @throws HTTP_Request2_LogicException
63
- * @throws HTTP_Request2_MessageException
64
+ * @return array Updated cookie array
65
+ * @throws HTTP_Request2_LogicException
66
+ * @throws HTTP_Request2_MessageException
67
*/
68
protected function checkAndUpdateFields(array $cookie, Net_URL2 $setter = null)
69
{
70
- if ($missing = array_diff(array('name', 'value'), array_keys($cookie))) {
71
+ if ($missing = array_diff('name', 'value', array_keys($cookie))) {
72
throw new HTTP_Request2_LogicException(
73
"Cookie array should contain 'name' and 'value' fields",
74
HTTP_Request2_Exception::MISSING_VALUE
75
76
HTTP_Request2_Exception::INVALID_ARGUMENT
77
);
78
}
79
- $cookie += array('domain' => '', 'path' => '', 'expires' => null, 'secure' => false);
80
+ $cookie += 'domain' => '', 'path' => '', 'expires' => null, 'secure' => false;
81
82
// Need ISO-8601 date @ UTC timezone
83
if (!empty($cookie'expires')
84
85
&& (is_null($cookie'expires') || $cookie'expires' > $this->now())
86
) {
87
if (!isset($this->cookies$cookie'domain')) {
88
- $this->cookies$cookie'domain' = array();
89
+ $this->cookies$cookie'domain' = ;
90
}
91
if (!isset($this->cookies$cookie'domain'$cookie'path')) {
92
- $this->cookies$cookie'domain'$cookie'path' = array();
93
+ $this->cookies$cookie'domain'$cookie'path' = ;
94
}
95
$this->cookies$cookie'domain'$cookie'path'$cookie'name' = $cookie;
96
97
98
*
99
* @param HTTP_Request2_Response $response HTTP response message
100
* @param Net_URL2 $setter original request URL, needed for
101
- * setting default domain/path. If not given,
102
- * effective URL from response will be used.
103
+ * setting default domain/path. If not given,
104
+ * effective URL from response will be used.
105
*
106
* @return bool whether all cookies were successfully stored
107
* @throws HTTP_Request2_LogicException
108
109
$path = $url->getPath();
110
$secure = 0 == strcasecmp($url->getScheme(), 'https');
111
112
- $matched = $ret = array();
113
+ $matched = $ret = ;
114
foreach (array_keys($this->cookies) as $domain) {
115
if ($this->domainMatch($host, $domain)) {
116
foreach (array_keys($this->cookies$domain) as $cPath) {
117
118
*/
119
public function getAll()
120
{
121
- $cookies = array();
122
+ $cookies = ;
123
foreach (array_keys($this->cookies) as $domain) {
124
foreach (array_keys($this->cookies$domain) as $path) {
125
foreach ($this->cookies$domain$path as $name => $cookie) {
126
127
* Sets whether session cookies should be serialized when serializing the jar
128
*
129
* @param boolean $serialize serialize?
130
+ *
131
+ * @return void
132
*/
133
public function serializeSessionCookies($serialize)
134
{
135
136
* Sets whether invalid cookies should be silently ignored or cause an Exception
137
*
138
* @param boolean $ignore ignore?
139
+ *
140
+ * @return void
141
+ *
142
* @link http://pear.php.net/bugs/bug.php?id=19937
143
* @link http://pear.php.net/bugs/bug.php?id=20401
144
*/
145
146
*
147
* @param boolean $useList use the list?
148
*
149
- * @link http://publicsuffix.org/learn/
150
+ * @return void
151
+ *
152
+ * @link http://publicsuffix.org/learn/
153
*/
154
public function usePublicSuffixList($useList)
155
{
156
157
*
158
* @return string
159
*
160
- * @see Serializable::serialize()
161
+ * @see Serializable::serialize()
162
*/
163
public function serialize()
164
{
165
+ return serialize($this->__serialize());
166
+ }
167
+
168
+ /**
169
+ * Returns an associative array of key/value pairs that represent the serialized form of the object
170
+ *
171
+ * @return array
172
+ */
173
+ public function __serialize()
174
+ {
175
$cookies = $this->getAll();
176
if (!$this->serializeSession) {
177
for ($i = count($cookies) - 1; $i >= 0; $i--) {
178
179
}
180
}
181
}
182
- return serialize(array(
183
+ return
184
'cookies' => $cookies,
185
'serializeSession' => $this->serializeSession,
186
'useList' => $this->useList,
187
'ignoreInvalid' => $this->ignoreInvalid
188
- ));
189
+ ;
190
}
191
192
/**
193
194
*
195
* @param string $serialized string representation
196
*
197
- * @see Serializable::unserialize()
198
+ * @return void
199
*/
200
public function unserialize($serialized)
201
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/Exception.php
Changed
157
1
2
* @category HTTP
3
* @package HTTP_Request2
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-/**
12
- * Base class for exceptions in PEAR
13
- */
14
-require_once 'PEAR/Exception.php';
15
+// pear-package-only /**
16
+// pear-package-only * Base class for exceptions in PEAR
17
+// pear-package-only */
18
+// pear-package-only require_once 'PEAR/Exception.php';
19
20
/**
21
* Base exception class for HTTP_Request2 package
22
23
*/
24
class HTTP_Request2_Exception extends PEAR_Exception
25
{
26
- /** An invalid argument was passed to a method */
27
+ /**
28
+ * An invalid argument was passed to a method
29
+ */
30
const INVALID_ARGUMENT = 1;
31
- /** Some required value was not available */
32
+ /**
33
+ * Some required value was not available
34
+ */
35
const MISSING_VALUE = 2;
36
- /** Request cannot be processed due to errors in PHP configuration */
37
+ /**
38
+ * Request cannot be processed due to errors in PHP configuration
39
+ */
40
const MISCONFIGURATION = 3;
41
- /** Error reading the local file */
42
+ /**
43
+ * Error reading the local file
44
+ */
45
const READ_ERROR = 4;
46
47
- /** Server returned a response that does not conform to HTTP protocol */
48
+ /**
49
+ * Server returned a response that does not conform to HTTP protocol
50
+ */
51
const MALFORMED_RESPONSE = 10;
52
- /** Failure decoding Content-Encoding or Transfer-Encoding of response */
53
+ /**
54
+ * Failure decoding Content-Encoding or Transfer-Encoding of response
55
+ */
56
const DECODE_ERROR = 20;
57
- /** Operation timed out */
58
+ /**
59
+ * Operation timed out
60
+ */
61
const TIMEOUT = 30;
62
- /** Number of redirects exceeded 'max_redirects' configuration parameter */
63
+ /**
64
+ * Number of redirects exceeded 'max_redirects' configuration parameter
65
+ */
66
const TOO_MANY_REDIRECTS = 40;
67
- /** Redirect to a protocol other than http(s):// */
68
+ /**
69
+ * Redirect to a protocol other than http(s)://
70
+ */
71
const NON_HTTP_REDIRECT = 50;
72
73
/**
74
* Native error code
75
+ *
76
* @var int
77
*/
78
private $_nativeCode;
79
80
}
81
}
82
83
-/**
84
- * Exception thrown in case of missing features
85
- *
86
- * @category HTTP
87
- * @package HTTP_Request2
88
- * @author Alexey Borzov <avb@php.net>
89
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
90
- * @version Release: @package_version@
91
- * @link http://pear.php.net/package/HTTP_Request2
92
- */
93
-class HTTP_Request2_NotImplementedException extends HTTP_Request2_Exception
94
-{
95
-}
96
+// backwards compatibility, include the child exceptions if installed with PEAR installer
97
+// pear-package-only require_once 'HTTP/Request2/ConnectionException.php';
98
+// pear-package-only require_once 'HTTP/Request2/LogicException.php';
99
+// pear-package-only require_once 'HTTP/Request2/MessageException.php';
100
+// pear-package-only require_once 'HTTP/Request2/NotImplementedException.php';
101
102
-/**
103
- * Exception that represents error in the program logic
104
- *
105
- * This exception usually implies a programmer's error, like passing invalid
106
- * data to methods or trying to use PHP extensions that weren't installed or
107
- * enabled. Usually exceptions of this kind will be thrown before request even
108
- * starts.
109
- *
110
- * The exception will usually contain a package error code.
111
- *
112
- * @category HTTP
113
- * @package HTTP_Request2
114
- * @author Alexey Borzov <avb@php.net>
115
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
116
- * @version Release: @package_version@
117
- * @link http://pear.php.net/package/HTTP_Request2
118
- */
119
-class HTTP_Request2_LogicException extends HTTP_Request2_Exception
120
-{
121
-}
122
-
123
-/**
124
- * Exception thrown when connection to a web or proxy server fails
125
- *
126
- * The exception will not contain a package error code, but will contain
127
- * native error code, as returned by stream_socket_client() or curl_errno().
128
- *
129
- * @category HTTP
130
- * @package HTTP_Request2
131
- * @author Alexey Borzov <avb@php.net>
132
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
133
- * @version Release: @package_version@
134
- * @link http://pear.php.net/package/HTTP_Request2
135
- */
136
-class HTTP_Request2_ConnectionException extends HTTP_Request2_Exception
137
-{
138
-}
139
-
140
-/**
141
- * Exception thrown when sending or receiving HTTP message fails
142
- *
143
- * The exception may contain both package error code and native error code.
144
- *
145
- * @category HTTP
146
- * @package HTTP_Request2
147
- * @author Alexey Borzov <avb@php.net>
148
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
149
- * @version Release: @package_version@
150
- * @link http://pear.php.net/package/HTTP_Request2
151
- */
152
-class HTTP_Request2_MessageException extends HTTP_Request2_Exception
153
-{
154
-}
155
?>
156
\ No newline at end of file
157
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/LogicException.php
Added
45
1
2
+<?php
3
+/**
4
+ * Exception classes for HTTP_Request2 package
5
+ *
6
+ * PHP version 5
7
+ *
8
+ * LICENSE
9
+ *
10
+ * This source file is subject to BSD 3-Clause License that is bundled
11
+ * with this package in the file LICENSE and available at the URL
12
+ * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
+ *
14
+ * @category HTTP
15
+ * @package HTTP_Request2
16
+ * @author Alexey Borzov <avb@php.net>
17
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
18
+ * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
+ * @link http://pear.php.net/package/HTTP_Request2
20
+ */
21
+
22
+/**
23
+ * Exception that represents error in the program logic
24
+ *
25
+ * This exception usually implies a programmer's error, like passing invalid
26
+ * data to methods or trying to use PHP extensions that weren't installed or
27
+ * enabled. Usually exceptions of this kind will be thrown before request even
28
+ * starts.
29
+ *
30
+ * The exception will usually contain a package error code.
31
+ *
32
+ * @category HTTP
33
+ * @package HTTP_Request2
34
+ * @author Alexey Borzov <avb@php.net>
35
+ * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
36
+ * @version Release: @package_version@
37
+ * @link http://pear.php.net/package/HTTP_Request2
38
+ */
39
+class HTTP_Request2_LogicException extends HTTP_Request2_Exception
40
+{
41
+}
42
+
43
+?>
44
\ No newline at end of file
45
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/MessageException.php
Added
40
1
2
+<?php
3
+/**
4
+ * Exception classes for HTTP_Request2 package
5
+ *
6
+ * PHP version 5
7
+ *
8
+ * LICENSE
9
+ *
10
+ * This source file is subject to BSD 3-Clause License that is bundled
11
+ * with this package in the file LICENSE and available at the URL
12
+ * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
+ *
14
+ * @category HTTP
15
+ * @package HTTP_Request2
16
+ * @author Alexey Borzov <avb@php.net>
17
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
18
+ * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
+ * @link http://pear.php.net/package/HTTP_Request2
20
+ */
21
+
22
+/**
23
+ * Exception thrown when sending or receiving HTTP message fails
24
+ *
25
+ * The exception may contain both package error code and native error code.
26
+ *
27
+ * @category HTTP
28
+ * @package HTTP_Request2
29
+ * @author Alexey Borzov <avb@php.net>
30
+ * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
31
+ * @version Release: @package_version@
32
+ * @link http://pear.php.net/package/HTTP_Request2
33
+ */
34
+class HTTP_Request2_MessageException extends HTTP_Request2_Exception
35
+{
36
+}
37
+
38
+?>
39
\ No newline at end of file
40
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/MultipartBody.php
Changed
171
1
2
* @category HTTP
3
* @package HTTP_Request2
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-/** Exception class for HTTP_Request2 package */
12
-require_once 'HTTP/Request2/Exception.php';
13
+// pear-package-only /** Exception class for HTTP_Request2 package */
14
+// pear-package-only require_once 'HTTP/Request2/Exception.php';
15
16
/**
17
* Class for building multipart/form-data request body
18
19
{
20
/**
21
* MIME boundary
22
- * @var string
23
+ *
24
+ * @var string
25
*/
26
private $_boundary;
27
28
/**
29
* Form parameters added via {@link HTTP_Request2::addPostParameter()}
30
- * @var array
31
+ *
32
+ * @var array
33
*/
34
- private $_params = array();
35
+ private $_params = ;
36
37
/**
38
* File uploads added via {@link HTTP_Request2::addUpload()}
39
- * @var array
40
+ *
41
+ * @var array
42
*/
43
- private $_uploads = array();
44
+ private $_uploads = ;
45
46
/**
47
* Header for parts with parameters
48
- * @var string
49
+ *
50
+ * @var string
51
*/
52
private $_headerParam = "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n";
53
54
/**
55
* Header for parts with uploads
56
- * @var string
57
+ *
58
+ * @var string
59
*/
60
private $_headerUpload = "--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\nContent-Type: %s\r\n\r\n";
61
62
63
* First number is index of "current" part, second number is position within
64
* "current" part
65
*
66
- * @var array
67
+ * @var array
68
*/
69
- private $_pos = array(0, 0);
70
+ private $_pos = 0, 0;
71
72
73
/**
74
75
$this->_params = self::_flattenArray('', $params, $useBrackets);
76
foreach ($uploads as $fieldName => $f) {
77
if (!is_array($f'fp')) {
78
- $this->_uploads = $f + array('name' => $fieldName);
79
+ $this->_uploads = $f + 'name' => $fieldName;
80
} else {
81
for ($i = 0; $i < count($f'fp'); $i++) {
82
- $upload = array(
83
+ $upload =
84
'name' => ($useBrackets? $fieldName . '' . $i . '': $fieldName)
85
- );
86
- foreach (array('fp', 'filename', 'size', 'type') as $key) {
87
+ ;
88
+ foreach ('fp', 'filename', 'size', 'type' as $key) {
89
$upload$key = $f$key$i;
90
}
91
$this->_uploads = $upload;
92
93
/**
94
* Returns the length of the body to use in Content-Length header
95
*
96
- * @return integer
97
+ * @return integer
98
*/
99
public function getLength()
100
{
101
102
/**
103
* Returns the boundary to use in Content-Type header
104
*
105
- * @return string
106
+ * @return string
107
*/
108
public function getBoundary()
109
{
110
111
*
112
* @param integer $length Number of bytes to read
113
*
114
- * @return string Up to $length bytes of data, empty string if at end
115
- * @throws HTTP_Request2_LogicException
116
+ * @return string Up to $length bytes of data, empty string if at end
117
+ * @throws HTTP_Request2_LogicException
118
*/
119
public function read($length)
120
{
121
122
$length -= min(strlen($closing) - $this->_pos1, $length);
123
}
124
if ($length > 0) {
125
- $this->_pos = array($this->_pos0 + 1, 0);
126
+ $this->_pos = $this->_pos0 + 1, 0;
127
} else {
128
$this->_pos1 += $oldLength;
129
}
130
131
* Sets the current position to the start of the body
132
*
133
* This allows reusing the same body in another request
134
+ *
135
+ * @return void
136
*/
137
public function rewind()
138
{
139
- $this->_pos = array(0, 0);
140
+ $this->_pos = 0, 0;
141
foreach ($this->_uploads as $u) {
142
rewind($u'fp');
143
}
144
145
* Note that it reads all file uploads into memory so it is a good idea not
146
* to use this method with large file uploads and rely on read() instead.
147
*
148
- * @return string
149
+ * @return string
150
*/
151
public function __toString()
152
{
153
154
* @param mixed $values item's values
155
* @param bool $useBrackets whether to append to array variables' names
156
*
157
- * @return array array with the following items: array('item name', 'item value');
158
+ * @return array array with the following items: array('item name', 'item value');
159
*/
160
private static function _flattenArray($name, $values, $useBrackets)
161
{
162
if (!is_array($values)) {
163
- return array(array($name, $values));
164
+ return $name, $values;
165
} else {
166
- $ret = array();
167
+ $ret = ;
168
foreach ($values as $k => $v) {
169
if (empty($name)) {
170
$newName = $k;
171
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/NotImplementedException.php
Added
38
1
2
+<?php
3
+/**
4
+ * Exception classes for HTTP_Request2 package
5
+ *
6
+ * PHP version 5
7
+ *
8
+ * LICENSE
9
+ *
10
+ * This source file is subject to BSD 3-Clause License that is bundled
11
+ * with this package in the file LICENSE and available at the URL
12
+ * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
+ *
14
+ * @category HTTP
15
+ * @package HTTP_Request2
16
+ * @author Alexey Borzov <avb@php.net>
17
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
18
+ * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
+ * @link http://pear.php.net/package/HTTP_Request2
20
+ */
21
+
22
+/**
23
+ * Exception thrown in case of missing features
24
+ *
25
+ * @category HTTP
26
+ * @package HTTP_Request2
27
+ * @author Alexey Borzov <avb@php.net>
28
+ * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
29
+ * @version Release: @package_version@
30
+ * @link http://pear.php.net/package/HTTP_Request2
31
+ */
32
+class HTTP_Request2_NotImplementedException extends HTTP_Request2_Exception
33
+{
34
+}
35
+
36
+?>
37
\ No newline at end of file
38
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/Observer/Log.php
Changed
73
1
2
* @package HTTP_Request2
3
* @author David Jean Louis <izi@php.net>
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-/**
12
- * Exception class for HTTP_Request2 package
13
- */
14
-require_once 'HTTP/Request2/Exception.php';
15
+// pear-package-only /**
16
+// pear-package-only * Exception class for HTTP_Request2 package
17
+// pear-package-only */
18
+// pear-package-only require_once 'HTTP/Request2/Exception.php';
19
20
/**
21
* A debug observer useful for debugging / testing.
22
23
*
24
* @var array $events
25
*/
26
- public $events = array(
27
+ public $events =
28
'connect',
29
'sentHeaders',
30
'sentBody',
31
'receivedHeaders',
32
'receivedBody',
33
'disconnect',
34
- );
35
+ ;
36
37
// }}}
38
// __construct() {{{
39
40
*
41
* @return void
42
*/
43
- public function __construct($target = 'php://output', array $events = array())
44
+ public function __construct($target = 'php://output', array $events = )
45
{
46
if (!empty($events)) {
47
$this->events = $events;
48
49
// }}}
50
// update() {{{
51
52
+ #ReturnTypeWillChange
53
/**
54
* Called when the request notifies us of an event.
55
*
56
57
$this->log('> ' . $event'data' . ' byte(s) sent');
58
break;
59
case 'receivedHeaders':
60
- $this->log(sprintf(
61
- '< HTTP/%s %s %s', $event'data'->getVersion(),
62
- $event'data'->getStatus(), $event'data'->getReasonPhrase()
63
- ));
64
+ $this->log(
65
+ sprintf(
66
+ '< HTTP/%s %s %s', $event'data'->getVersion(),
67
+ $event'data'->getStatus(), $event'data'->getReasonPhrase()
68
+ )
69
+ );
70
$headers = $event'data'->getHeader();
71
foreach ($headers as $key => $val) {
72
$this->log('< ' . $key . ': ' . $val);
73
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/Observer/UncompressingDownload.php
Changed
108
1
2
* @package HTTP_Request2
3
* @author Delian Krustev <krustev@krustev.net>
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-require_once 'HTTP/Request2/Response.php';
12
+// pear-package-only require_once 'HTTP/Request2/Response.php';
13
14
/**
15
* An observer that saves response body to stream, possibly uncompressing it
16
17
{
18
/**
19
* The stream to write response body to
20
+ *
21
* @var resource
22
*/
23
private $_stream;
24
25
/**
26
- * zlib.inflate filter possibly added to stream
27
+ * 'zlib.inflate' filter possibly added to stream
28
+ *
29
* @var resource
30
*/
31
private $_streamFilter;
32
33
/**
34
* The value of response's Content-Encoding header
35
+ *
36
* @var string
37
*/
38
private $_encoding;
39
40
/**
41
* Whether the observer is still waiting for gzip/deflate header
42
+ *
43
* @var bool
44
*/
45
private $_processingHeader = true;
46
47
/**
48
* Starting position in the stream observer writes to
49
+ *
50
* @var int
51
*/
52
private $_startPosition = 0;
53
54
/**
55
* Maximum bytes to write
56
+ *
57
* @var int|null
58
*/
59
private $_maxDownloadSize;
60
61
/**
62
* Whether response being received is a redirect
63
+ *
64
* @var bool
65
*/
66
private $_redirect = false;
67
68
/**
69
* Accumulated body chunks that may contain (gzip) header
70
+ *
71
* @var string
72
*/
73
private $_possibleHeader = '';
74
75
}
76
}
77
78
+ #ReturnTypeWillChange
79
/**
80
* Called when the request notifies us of an event.
81
*
82
83
case 'receivedHeaders':
84
$this->_processingHeader = true;
85
$this->_redirect = $event'data'->isRedirect();
86
- $this->_encoding = strtolower($event'data'->getHeader('content-encoding'));
87
+ $this->_encoding = strtolower($event'data'->getHeader('content-encoding') ?: '');
88
$this->_possibleHeader = '';
89
break;
90
91
92
if ($this->_maxDownloadSize
93
&& ftell($this->_stream) - $this->_startPosition > $this->_maxDownloadSize
94
) {
95
- throw new HTTP_Request2_MessageException(sprintf(
96
- 'Body length limit (%d bytes) reached',
97
- $this->_maxDownloadSize
98
- ));
99
+ throw new HTTP_Request2_MessageException(
100
+ sprintf(
101
+ 'Body length limit (%d bytes) reached',
102
+ $this->_maxDownloadSize
103
+ )
104
+ );
105
}
106
break;
107
108
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/Response.php
Changed
201
1
2
* @category HTTP
3
* @package HTTP_Request2
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-/**
12
- * Exception class for HTTP_Request2 package
13
- */
14
-require_once 'HTTP/Request2/Exception.php';
15
+// pear-package-only /**
16
+// pear-package-only * Exception class for HTTP_Request2 package
17
+// pear-package-only */
18
+// pear-package-only require_once 'HTTP/Request2/Exception.php';
19
20
/**
21
* Class representing a HTTP response
22
23
{
24
/**
25
* HTTP protocol version (e.g. 1.0, 1.1)
26
- * @var string
27
+ *
28
+ * @var string
29
*/
30
protected $version;
31
32
/**
33
* Status code
34
+ *
35
* @var integer
36
* @link http://tools.ietf.org/html/rfc2616#section-6.1.1
37
*/
38
39
40
/**
41
* Reason phrase
42
+ *
43
* @var string
44
* @link http://tools.ietf.org/html/rfc2616#section-6.1.1
45
*/
46
47
48
/**
49
* Effective URL (may be different from original request URL in case of redirects)
50
- * @var string
51
+ *
52
+ * @var string
53
*/
54
protected $effectiveUrl;
55
56
/**
57
* Associative array of response headers
58
- * @var array
59
+ *
60
+ * @var array
61
*/
62
- protected $headers = array();
63
+ protected $headers = ;
64
65
/**
66
* Cookies set in the response
67
- * @var array
68
+ *
69
+ * @var array
70
*/
71
- protected $cookies = array();
72
+ protected $cookies = ;
73
74
/**
75
* Name of last header processed by parseHederLine()
76
*
77
* Used to handle the headers that span multiple lines
78
*
79
- * @var string
80
+ * @var string
81
*/
82
protected $lastHeader = null;
83
84
/**
85
* Response body
86
- * @var string
87
+ *
88
+ * @var string
89
*/
90
protected $body = '';
91
92
93
* cURL provides the decoded body to the callback; if we are reading from
94
* socket the body is still gzipped / deflated
95
*
96
- * @var bool
97
+ * @var bool
98
*/
99
protected $bodyEncoded;
100
101
102
* @var array
103
* @link http://tools.ietf.org/html/rfc2616#section-10
104
*/
105
- protected static $phrases = array(
106
+ protected static $phrases =
107
108
// 1xx: Informational - Request received, continuing process
109
100 => 'Continue',
110
111
505 => 'HTTP Version Not Supported',
112
509 => 'Bandwidth Limit Exceeded',
113
114
- );
115
+ ;
116
117
/**
118
* Returns the default reason phrase for the given code or all reason phrases
119
120
* @param bool $bodyEncoded Whether body is still encoded by Content-Encoding
121
* @param string $effectiveUrl Effective URL of the response
122
*
123
- * @throws HTTP_Request2_MessageException if status line is invalid according to spec
124
+ * @throws HTTP_Request2_MessageException if status line is invalid according to spec
125
*/
126
public function __construct($statusLine, $bodyEncoded = true, $effectiveUrl = null)
127
{
128
129
* empty string in the end.
130
*
131
* @param string $headerLine Line from HTTP response
132
+ *
133
+ * @return void
134
*/
135
public function parseHeaderLine($headerLine)
136
{
137
138
if (!empty($this->headers'set-cookie')) {
139
$cookies = is_array($this->headers'set-cookie')?
140
$this->headers'set-cookie':
141
- array($this->headers'set-cookie');
142
+ $this->headers'set-cookie';
143
foreach ($cookies as $cookieString) {
144
$this->parseCookie($cookieString);
145
}
146
147
$this->headers$name = $value;
148
} else {
149
if (!is_array($this->headers$name)) {
150
- $this->headers$name = array($this->headers$name);
151
+ $this->headers$name = $this->headers$name;
152
}
153
$this->headers$name = $value;
154
}
155
156
*
157
* @param string $cookieString value of Set-Cookie header
158
*
159
- * @link http://web.archive.org/web/20080331104521/http://cgi.netscape.com/newsref/std/cookie_spec.html
160
+ * @return void
161
+ *
162
+ * @link http://web.archive.org/web/20080331104521/http://cgi.netscape.com/newsref/std/cookie_spec.html
163
*/
164
protected function parseCookie($cookieString)
165
{
166
- $cookie = array(
167
+ $cookie =
168
'expires' => null,
169
'domain' => null,
170
'path' => null,
171
'secure' => false
172
- );
173
+ ;
174
175
if (!strpos($cookieString, ';')) {
176
// Only a name=value pair
177
178
* Appends a string to the response body
179
*
180
* @param string $bodyChunk part of response body
181
+ *
182
+ * @return void
183
*/
184
public function appendBody($bodyChunk)
185
{
186
187
/**
188
* Returns the status code
189
*
190
- * @return integer
191
+ * @return integer
192
*/
193
public function getStatus()
194
{
195
196
/**
197
* Returns the reason phrase
198
*
199
- * @return string
200
+ * @return string
201
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/SOCKS5.php
Changed
47
1
2
* @category HTTP
3
* @package HTTP_Request2
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-/** Socket wrapper class used by Socket Adapter */
12
-require_once 'HTTP/Request2/SocketWrapper.php';
13
+// pear-package-only /** Socket wrapper class used by Socket Adapter */
14
+// pear-package-only require_once 'HTTP/Request2/SocketWrapper.php';
15
16
/**
17
* SOCKS5 proxy connection class (used by Socket Adapter)
18
19
* @throws HTTP_Request2_MessageException
20
*/
21
public function __construct(
22
- $address, $timeout = 10, array $contextOptions = array(),
23
+ $address, $timeout = 10, array $contextOptions = ,
24
$username = null, $password = null
25
) {
26
parent::__construct($address, $timeout, $contextOptions);
27
28
* @param string $username Proxy user name
29
* @param string $password Proxy password
30
*
31
+ * @return void
32
* @throws HTTP_Request2_ConnectionException
33
* @throws HTTP_Request2_MessageException
34
- * @link http://tools.ietf.org/html/rfc1929
35
+ * @link http://tools.ietf.org/html/rfc1929
36
*/
37
protected function performAuthentication($username, $password)
38
{
39
40
* @param string $remoteHost Remote host
41
* @param int $remotePort Remote port
42
*
43
+ * @return void
44
* @throws HTTP_Request2_ConnectionException
45
* @throws HTTP_Request2_MessageException
46
*/
47
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/HTTP/Request2/SocketWrapper.php
Changed
201
1
2
* @category HTTP
3
* @package HTTP_Request2
4
* @author Alexey Borzov <avb@php.net>
5
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
6
+ * @copyright 2008-2022 Alexey Borzov <avb@php.net>
7
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
8
* @link http://pear.php.net/package/HTTP_Request2
9
*/
10
11
-/** Exception classes for HTTP_Request2 package */
12
-require_once 'HTTP/Request2/Exception.php';
13
+// pear-package-only /** Exception classes for HTTP_Request2 package */
14
+// pear-package-only require_once 'HTTP/Request2/Exception.php';
15
16
/**
17
* Socket wrapper class used by Socket Adapter
18
19
{
20
/**
21
* PHP warning messages raised during stream_socket_client() call
22
+ *
23
* @var array
24
*/
25
- protected $connectionWarnings = array();
26
+ protected $connectionWarnings = ;
27
28
/**
29
* Connected socket
30
+ *
31
* @var resource
32
*/
33
protected $socket;
34
35
/**
36
* Sum of start time and global timeout, exception will be thrown if request continues past this time
37
- * @var integer
38
+ *
39
+ * @var float
40
*/
41
protected $deadline;
42
43
/**
44
* Global timeout value, mostly for exception messages
45
+ *
46
* @var integer
47
*/
48
protected $timeout;
49
50
* @throws HTTP_Request2_LogicException
51
* @throws HTTP_Request2_ConnectionException
52
*/
53
- public function __construct($address, $timeout, array $contextOptions = array())
54
+ public function __construct($address, $timeout, array $contextOptions = )
55
{
56
if (!empty($contextOptions)
57
&& !isset($contextOptions'socket') && !isset($contextOptions'ssl')
58
) {
59
// Backwards compatibility with 2.1.0 and 2.1.1 releases
60
- $contextOptions = array('ssl' => $contextOptions);
61
+ $contextOptions = 'ssl' => $contextOptions;
62
}
63
if (isset($contextOptions'ssl')) {
64
- $contextOptions'ssl' += array(
65
+ $cryptoMethod = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
66
+ if (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT')) {
67
+ $cryptoMethod |= STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT;
68
+ }
69
+ $contextOptions'ssl' +=
70
// Using "Intermediate compatibility" cipher bundle from
71
// https://wiki.mozilla.org/Security/Server_Side_TLS
72
- 'ciphers' => 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:'
73
- . 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:'
74
- . 'DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:'
75
- . 'ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:'
76
- . 'ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:'
77
- . 'ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:'
78
- . 'ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:'
79
- . 'DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:'
80
- . 'DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:'
81
- . 'ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:'
82
- . 'AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:'
83
- . 'AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:'
84
- . '!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'
85
- );
86
- if (version_compare(phpversion(), '5.4.13', '>=')) {
87
- $contextOptions'ssl''disable_compression' = true;
88
- if (version_compare(phpversion(), '5.6', '>=')) {
89
- $contextOptions'ssl''crypto_method' = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
90
- | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
91
- }
92
- }
93
+ 'ciphers' => 'TLS_AES_128_GCM_SHA256:'
94
+ . 'TLS_AES_256_GCM_SHA384:'
95
+ . 'TLS_CHACHA20_POLY1305_SHA256:'
96
+ . 'ECDHE-ECDSA-AES128-GCM-SHA256:'
97
+ . 'ECDHE-RSA-AES128-GCM-SHA256:'
98
+ . 'ECDHE-ECDSA-AES256-GCM-SHA384:'
99
+ . 'ECDHE-RSA-AES256-GCM-SHA384:'
100
+ . 'ECDHE-ECDSA-CHACHA20-POLY1305:'
101
+ . 'ECDHE-RSA-CHACHA20-POLY1305:'
102
+ . 'DHE-RSA-AES128-GCM-SHA256:'
103
+ . 'DHE-RSA-AES256-GCM-SHA384',
104
+ 'disable_compression' => true,
105
+ 'crypto_method' => $cryptoMethod
106
+ ;
107
}
108
$context = stream_context_create();
109
foreach ($contextOptions as $wrapper => $options) {
110
111
}
112
}
113
}
114
- set_error_handler(array($this, 'connectionWarningsHandler'));
115
+ set_error_handler($this, 'connectionWarningsHandler');
116
$this->socket = stream_socket_client(
117
$address, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context
118
);
119
120
"Unable to connect to {$address}. Error: {$error}", 0, $errno
121
);
122
}
123
+ // Run socket in non-blocking mode, to prevent possible problems with
124
+ // HTTPS requests not timing out properly (see bug #21229)
125
+ stream_set_blocking($this->socket, false);
126
}
127
128
/**
129
130
*
131
* @param int $length Reads up to this number of bytes
132
*
133
- * @return string Data read from socket
134
- * @throws HTTP_Request2_MessageException In case of timeout
135
+ * @return string|false Data read from socket by fread()
136
+ * @throws HTTP_Request2_MessageException In case of timeout
137
*/
138
public function read($length)
139
{
140
- if ($this->deadline) {
141
- stream_set_timeout($this->socket, max($this->deadline - time(), 1));
142
- }
143
- $data = fread($this->socket, $length);
144
- $this->checkTimeout();
145
+ // Looks like stream_select() may return true, but then fread() will return an empty string...
146
+ // For some reason or other happens mostly with servers behind Cloudflare.
147
+ // Let's do the fread() call in a loop until either an error/eof or non-empty string:
148
+ do {
149
+ $data = false;
150
+ $timeouts = $this->_getTimeoutsForStreamSelect();
151
+
152
+ $r = $this->socket;
153
+ $w = ;
154
+ $e = ;
155
+ if (stream_select($r, $w, $e, $timeouts0, $timeouts1)) {
156
+ $data = fread($this->socket, $length);
157
+ }
158
+
159
+ $this->checkTimeout();
160
+ } while ('' === $data && !$this->eof());
161
+
162
return $data;
163
}
164
165
166
* @param int $localTimeout timeout value to use just for this call
167
* (used when waiting for "100 Continue" response)
168
*
169
- * @return string Available data up to the newline (not including newline)
170
- * @throws HTTP_Request2_MessageException In case of timeout
171
+ * @return string Available data up to the newline (not including newline)
172
+ * @throws HTTP_Request2_MessageException In case of timeout
173
*/
174
public function readLine($bufferSize, $localTimeout = null)
175
{
176
$line = '';
177
while (!feof($this->socket)) {
178
if (null !== $localTimeout) {
179
- stream_set_timeout($this->socket, $localTimeout);
180
- } elseif ($this->deadline) {
181
- stream_set_timeout($this->socket, max($this->deadline - time(), 1));
182
+ $timeouts = $localTimeout, 0;
183
+ $started = microtime(true);
184
+ } else {
185
+ $timeouts = $this->_getTimeoutsForStreamSelect();
186
}
187
188
- $line .= @fgets($this->socket, $bufferSize);
189
+ $r = $this->socket;
190
+ $w = ;
191
+ $e = ;
192
+ if (stream_select($r, $w, $e, $timeouts0, $timeouts1)) {
193
+ $line .= @fgets($this->socket, $bufferSize);
194
+ }
195
196
if (null === $localTimeout) {
197
$this->checkTimeout();
198
-
199
- } else {
200
- $info = stream_get_meta_data($this->socket);
201
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/README.md
Changed
103
1
2
3
# HTTP_Request2
4
5
-!Build Status(https://travis-ci.org/pear/HTTP_Request2.svg?branch=trunk)(https://travis-ci.org/pear/HTTP_Request2)
6
+!Build Status(https://github.com/pear/HTTP_Request2/workflows/Continuous%20Integration/badge.svg?branch=trunk)(https://github.com/pear/HTTP_Request2/actions?query=branch%3Atrunk+workflow%3A%22Continuous+Integration%22)
7
8
Provides an easy way to perform HTTP requests, uses pluggable adapters
9
10
11
12
This package is PEAR HTTP_Request2 and has been migrated from PEAR SVN
13
14
-Please report all issues via the PEAR bug tracker.
15
+Please report all issues via the GitHub issues.
16
17
Pull requests are welcome.
18
19
-PEAR HTTP_Request: http://pear.php.net/package/HTTP_Request/
20
-PEAR HTTP_Request2: http://pear.php.net/package/HTTP_Request2/
21
+PEAR HTTP_Request: https://pear.php.net/package/HTTP_Request/
22
+PEAR HTTP_Request2: https://pear.php.net/package/HTTP_Request2/
23
PEAR SVN: https://svn.php.net/repository/pear/packages/HTTP_Request2
24
-PEAR bug tracker: http://pear.php.net/bugs/search.php?cmd=display&package_name=HTTP_Request2
25
+GitHub issues: https://github.com/pear/HTTP_Request2/issues
26
+
27
+## Installation
28
+
29
+The package may be installed either with PEAR
30
+
31
+ $ pear install HTTP_Request2
32
+
33
+or with composer
34
+
35
+ $ composer require pear/http_request2
36
+
37
+Since release 2.4 composer installation relies completely on autoloading and does not contain `require_once` calls or
38
+use `include-path` option.
39
40
## Basic usage
41
42
```PHP
43
-require_once 'HTTP/Request2.php';
44
+require_once 'HTTP/Request2.php'; // Only when installed with PEAR
45
46
$request = new HTTP_Request2('http://pear.php.net/', HTTP_Request2::METHOD_GET);
47
try {
48
49
50
...is available on PEAR website
51
52
- * Numerous configuration options(http://pear.php.net/manual/en/package.http.http-request2.config.php)
53
- * How to populate the request object(http://pear.php.net/manual/en/package.http.http-request2.request.php)
54
- * Description of available adapters(http://pear.php.net/manual/en/package.http.http-request2.adapters.php)
55
- * Processing of HTTP response(http://pear.php.net/manual/en/package.http.http-request2.response.php)
56
- * Monitoring the progress of request with observers(http://pear.php.net/manual/en/package.http.http-request2.observers.php)
57
- * Possible exceptions(http://pear.php.net/manual/en/package.http.http-request2.exceptions.php)
58
+ * Numerous configuration options(https://pear.php.net/manual/en/package.http.http-request2.config.php)
59
+ * How to populate the request object(https://pear.php.net/manual/en/package.http.http-request2.request.php)
60
+ * Description of available adapters(https://pear.php.net/manual/en/package.http.http-request2.adapters.php)
61
+ * Processing of HTTP response(https://pear.php.net/manual/en/package.http.http-request2.response.php)
62
+ * Monitoring the progress of request with observers(https://pear.php.net/manual/en/package.http.http-request2.observers.php)
63
+ * Possible exceptions(https://pear.php.net/manual/en/package.http.http-request2.exceptions.php)
64
65
-Generated API documentation(http://pear.php.net/package/HTTP_Request2/docs/latest/) for the current release is also there.
66
+Generated API documentation(https://pear.php.net/package/HTTP_Request2/docs/latest/) for the current release is also there.
67
68
## Testing, Packaging and Installing (Pear)
69
70
-To test, run either
71
+To test, run
72
73
$ phpunit tests/
74
75
-or
76
+after installing dependencies with composer. You can also test the installed package with
77
+
78
+ $ phpunit PEAR tests dir/HTTP_Request2
79
80
- $ pear run-tests -r
81
+Since PEAR package needs its `require_once` statements re-enabled, please run the helper file before packaging and
82
+installing
83
84
-You may need to set up the NetworkConfig.php file if you want to perform tests that interact with a web server.
85
-Its template is NetworkConfig.php.dist file, consult it for the details.
86
+ $ php pear-package-helper.php
87
88
-To build, simply
89
+Then to build, simply
90
91
- $ pear package
92
+ $ pear package .pear-package/package.xml
93
94
To install from scratch
95
96
- $ pear install package.xml
97
+ $ pear install .pear-package/package.xml
98
99
To upgrade
100
101
- $ pear upgrade -f package.xml
102
+ $ pear upgrade -f .pear-package/package.xml
103
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/composer.json
Changed
53
1
2
"description" : "Provides an easy way to perform HTTP requests.",
3
"type" : "library",
4
"keywords" : "http", "request", "pear", "curl" ,
5
- "homepage" : "http://pear.php.net/package/HTTP_Request2",
6
+ "homepage" : "https://pear.php.net/package/HTTP_Request2",
7
"license" : "BSD-3-Clause",
8
"authors" :
9
{
10
11
}
12
,
13
"support": {
14
- "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name=HTTP_Request2",
15
- "source": "https://github.com/pear/HTTP_Request2"
16
+ "issues": "https://github.com/pear/HTTP_Request2/issues",
17
+ "source": "https://github.com/pear/HTTP_Request2",
18
+ "docs": "https://pear.php.net/manual/en/package.http.http-request2.php"
19
},
20
"require" : {
21
- "php" : ">=5.2.0",
22
+ "php" : ">=5.6.0",
23
"pear/net_url2" : "^2.2.0",
24
"pear/pear_exception" : "^1.0.0"
25
},
26
+ "require-dev": {
27
+ "yoast/phpunit-polyfills" : "^1.0.0"
28
+ },
29
"suggest" : {
30
"ext-fileinfo" : "Adds support for looking up mime-types using finfo.",
31
"ext-zlib" : "Allows handling gzip compressed responses.",
32
- "lib-curl" : "Allows using cURL as a request backend.",
33
- "lib-openssl" : "Allows handling SSL requests when not using cURL."
34
+ "ext-curl" : "Allows using cURL as a request backend.",
35
+ "ext-openssl" : "Allows handling SSL requests when not using cURL."
36
},
37
"autoload": {
38
"psr-0": {
39
"HTTP_Request2" : ""
40
}
41
},
42
- "include-path":
43
- "./"
44
- ,
45
- "extra": {
46
- "branch-alias": {
47
- "dev-trunk": "2.2-dev"
48
- }
49
+ "autoload-dev": {
50
+ "classmap": "tests"
51
}
52
}
53
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/data/generate-list.php
Changed
67
1
2
/** URL to download Public Suffix List from */
3
define('LIST_URL', 'https://publicsuffix.org/list/public_suffix_list.dat');
4
/** Name of PHP file to write */
5
-define('OUTPUT_FILE', dirname(__FILE__) . '/public-suffix-list.php');
6
+define('OUTPUT_FILE', __DIR__ . '/public-suffix-list.php');
7
8
require_once 'HTTP/Request2.php';
9
10
11
$part = trim(array_pop($tldParts));
12
13
if (!array_key_exists($part, $node)) {
14
- $node$part = array();
15
+ $node$part = ;
16
}
17
18
if (0 < count($tldParts)) {
19
20
if (0 == ($count = count($valueTree))) {
21
fwrite($fp, 'true');
22
} else {
23
- fwrite($fp, "array(\n");
24
+ fwrite($fp, "\n");
25
for ($keys = array_keys($valueTree), $i = 0; $i < $count; $i++) {
26
writeNode($fp, $valueTree$keys$i, $keys$i, $indent + 1);
27
if ($i + 1 != $count) {
28
29
fwrite($fp, "\n");
30
}
31
}
32
- fwrite($fp, str_repeat(' ', $indent) . ")");
33
+ fwrite($fp, str_repeat(' ', $indent) . "");
34
}
35
}
36
37
38
try {
39
- $request = new HTTP_Request2(LIST_URL, HTTP_Request2::METHOD_GET, array(
40
+ $request = new HTTP_Request2(LIST_URL, HTTP_Request2::METHOD_GET,
41
// Provide path to your CA file and change 'ssl_verify_peer' to true to enable peer validation
42
// 'ssl_cafile' => '... path to your Certificate Authority file ...',
43
'ssl_verify_peer' => false
44
- ));
45
+ );
46
$response = $request->send();
47
if (200 != $response->getStatus()) {
48
throw new Exception("List download URL returned status: " .
49
50
if (false === strpos($list, '// ===BEGIN ICANN DOMAINS===')) {
51
throw new Exception("List download URL does not contain expected phrase");
52
}
53
- if (!($fp = @fopen(OUTPUT_FILE, 'wt'))) {
54
+ if (!($fp = @fopen(OUTPUT_FILE, 'wb'))) {
55
throw new Exception("Unable to open " . OUTPUT_FILE);
56
}
57
58
59
die($e->getMessage());
60
}
61
62
-$tldTree = array();
63
+$tldTree = ;
64
$license = true;
65
66
fwrite($fp, "<?php\n");
67
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/data/public-suffix-list.php
Changed
201
1
2
<?php
3
// This Source Code Form is subject to the terms of the Mozilla Public
4
// License, v. 2.0. If a copy of the MPL was not distributed with this
5
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+// file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+// Please pull this list from, and only from https://publicsuffix.org/list/public_suffix_list.dat,
8
+// rather than any other VCS sites. Pulling from any other URL is not guaranteed to be supported.
9
+// Instructions on pulling and using this list can be found at https://publicsuffix.org/list/.
10
11
-return array(
12
- 'ac' => array(
13
+return
14
+ 'ac' =>
15
'com' => true,
16
'edu' => true,
17
'gov' => true,
18
'net' => true,
19
'mil' => true,
20
- 'org' => true
21
- ),
22
- 'ad' => array(
23
+ 'org' => true,
24
+ 'drr' => true
25
+ ,
26
+ 'ad' =>
27
'nom' => true
28
- ),
29
- 'ae' => array(
30
+ ,
31
+ 'ae' =>
32
'co' => true,
33
'net' => true,
34
'org' => true,
35
36
'gov' => true,
37
'mil' => true,
38
'blogspot' => true
39
- ),
40
- 'aero' => array(
41
+ ,
42
+ 'aero' =>
43
'accident-investigation' => true,
44
'accident-prevention' => true,
45
'aerobatic' => true,
46
47
'express' => true,
48
'federation' => true,
49
'flight' => true,
50
- 'freight' => true,
51
'fuel' => true,
52
'gliding' => true,
53
'government' => true,
54
55
'union' => true,
56
'workinggroup' => true,
57
'works' => true
58
- ),
59
- 'af' => array(
60
+ ,
61
+ 'af' =>
62
'gov' => true,
63
'com' => true,
64
'org' => true,
65
'net' => true,
66
'edu' => true
67
- ),
68
- 'ag' => array(
69
+ ,
70
+ 'ag' =>
71
'com' => true,
72
'org' => true,
73
'net' => true,
74
'co' => true,
75
'nom' => true
76
- ),
77
- 'ai' => array(
78
+ ,
79
+ 'ai' =>
80
'off' => true,
81
'com' => true,
82
'net' => true,
83
- 'org' => true
84
- ),
85
- 'al' => array(
86
+ 'org' => true,
87
+ 'uwu' => true
88
+ ,
89
+ 'al' =>
90
'com' => true,
91
'edu' => true,
92
'gov' => true,
93
94
'net' => true,
95
'org' => true,
96
'blogspot' => true
97
- ),
98
- 'am' => array(
99
- 'blogspot' => true
100
- ),
101
- 'ao' => array(
102
+ ,
103
+ 'am' =>
104
+ 'co' => true,
105
+ 'com' => true,
106
+ 'commune' => true,
107
+ 'net' => true,
108
+ 'org' => true,
109
+ 'radio' => true,
110
+ 'blogspot' => true,
111
+ 'neko' => true,
112
+ 'nyaa' => true
113
+ ,
114
+ 'ao' =>
115
'ed' => true,
116
'gv' => true,
117
'og' => true,
118
'co' => true,
119
'pb' => true,
120
'it' => true
121
- ),
122
+ ,
123
'aq' => true,
124
- 'ar' => array(
125
- 'com' => array(
126
+ 'ar' =>
127
+ 'bet' => true,
128
+ 'com' =>
129
'blogspot' => true
130
- ),
131
+ ,
132
+ 'coop' => true,
133
'edu' => true,
134
'gob' => true,
135
'gov' => true,
136
'int' => true,
137
'mil' => true,
138
+ 'musica' => true,
139
+ 'mutual' => true,
140
'net' => true,
141
'org' => true,
142
+ 'senasa' => true,
143
'tur' => true
144
- ),
145
- 'arpa' => array(
146
+ ,
147
+ 'arpa' =>
148
'e164' => true,
149
'in-addr' => true,
150
'ip6' => true,
151
'iris' => true,
152
'uri' => true,
153
'urn' => true
154
- ),
155
- 'as' => array(
156
+ ,
157
+ 'as' =>
158
'gov' => true
159
- ),
160
- 'asia' => true,
161
- 'at' => array(
162
- 'ac' => true,
163
- 'co' => array(
164
+ ,
165
+ 'asia' =>
166
+ 'cloudns' => true
167
+ ,
168
+ 'at' =>
169
+ 'ac' =>
170
+ 'sth' => true
171
+ ,
172
+ 'co' =>
173
'blogspot' => true
174
- ),
175
+ ,
176
'gv' => true,
177
'or' => true,
178
+ 'funkfeuer' =>
179
+ 'wien' => true
180
+ ,
181
+ 'futurecms' =>
182
+ '*' => true,
183
+ 'ex' =>
184
+ '*' => true
185
+ ,
186
+ 'in' =>
187
+ '*' => true
188
+
189
+ ,
190
+ 'futurehosting' => true,
191
+ 'futuremailing' => true,
192
+ 'ortsinfo' =>
193
+ 'ex' =>
194
+ '*' => true
195
+ ,
196
+ 'kunden' =>
197
+ '*' => true
198
+
199
+ ,
200
'biz' => true,
201
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/docs/LICENSE
Changed
9
1
2
HTTP_Request2
3
4
-Copyright (c) 2008-2016, Alexey Borzov <avb@php.net>
5
+Copyright (c) 2008-2022, Alexey Borzov <avb@php.net>
6
All rights reserved.
7
8
Redistribution and use in source and binary forms, with or without
9
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/docs/examples
Deleted
2
1
-(directory)
2
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/docs/examples/upload-rapidshare.php
Deleted
60
1
2
-<?php
3
-/**
4
- * Usage example for HTTP_Request2 package: uploading a file to rapidshare.com
5
- *
6
- * Inspired by Perl usage example: http://images.rapidshare.com/software/rsapi.pl
7
- * Rapidshare API description: http://rapidshare.com/dev.html
8
- */
9
-
10
-require_once 'HTTP/Request2.php';
11
-
12
-// You'll probably want to change this
13
-$filename = '/etc/passwd';
14
-
15
-try {
16
- // First step: get an available upload server
17
- $request = new HTTP_Request2(
18
- 'http://rapidshare.com/cgi-bin/rsapi.cgi?sub=nextuploadserver_v1'
19
- );
20
- $server = $request->send()->getBody();
21
- if (!preg_match('/^(\\d+)$/', $server)) {
22
- throw new Exception("Invalid upload server: {$server}");
23
- }
24
-
25
- // Calculate file hash, we'll use it later to check upload
26
- if (false === ($hash = @md5_file($filename))) {
27
- throw new Exception("Cannot calculate MD5 hash of '{$filename}'");
28
- }
29
-
30
- // Second step: upload a file to the available server
31
- $uploader = new HTTP_Request2(
32
- "http://rs{$server}l3.rapidshare.com/cgi-bin/upload.cgi",
33
- HTTP_Request2::METHOD_POST
34
- );
35
- // Adding the file
36
- $uploader->addUpload('filecontent', $filename);
37
- // This will tell server to return program-friendly output
38
- $uploader->addPostParameter('rsapi_v1', '1');
39
-
40
- $response = $uploader->send()->getBody();
41
- if (!preg_match_all('/^(File^=+)=(.+)$/m', $response, $m, PREG_SET_ORDER)) {
42
- throw new Exception("Invalid response: {$response}");
43
- }
44
- $rspAry = array();
45
- foreach ($m as $item) {
46
- $rspAry$item1 = $item2;
47
- }
48
- // Check that uploaded file has the same hash
49
- if (empty($rspAry'File1.4')) {
50
- throw new Exception("MD5 hash data not found in response");
51
- } elseif ($hash != strtolower($rspAry'File1.4')) {
52
- throw new Exception("Upload failed, local MD5 is {$hash}, uploaded MD5 is {$rspAry'File1.4'}");
53
- }
54
- echo "Upload succeeded\nDownload link: {$rspAry'File1.1'}\nDelete link: {$rspAry'File1.2'}\n";
55
-
56
-} catch (Exception $e) {
57
- echo "Error: " . $e->getMessage();
58
-}
59
-?>
60
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/package.xml
Deleted
201
1
2
-<?xml version="1.0" encoding="ISO-8859-1"?>
3
-<package version="2.0"
4
- xmlns="http://pear.php.net/dtd/package-2.0"
5
- xmlns:tasks="http://pear.php.net/dtd/tasks-1.0"
6
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7
- xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
8
-
9
- <name>HTTP_Request2</name>
10
- <channel>pear.php.net</channel>
11
- <extends>HTTP_Request</extends>
12
- <summary>Provides an easy way to perform HTTP requests.</summary>
13
- <description>
14
-PHP5 rewrite of HTTP_Request package (with parts of HTTP_Client). Provides
15
-cleaner API and pluggable Adapters:
16
- * Socket adapter, based on old HTTP_Request code,
17
- * Curl adapter, wraps around PHP's cURL extension,
18
- * Mock adapter, to use for testing packages dependent on HTTP_Request2.
19
-Supports POST requests with data and file uploads, basic and digest
20
-authentication, cookies, managing cookies across requests, proxies, gzip and
21
-deflate encodings, redirects, monitoring the request progress with Observers...
22
- </description>
23
- <lead>
24
- <name>Alexey Borzov</name>
25
- <user>avb</user>
26
- <email>avb@php.net</email>
27
- <active>yes</active>
28
- </lead>
29
- <date>2016-02-13</date>
30
- <version>
31
- <release>2.3.0</release>
32
- <api>2.3.0</api>
33
- </version>
34
- <stability>
35
- <release>stable</release>
36
- <api>stable</api>
37
- </stability>
38
- <license uri="http://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause License</license>
39
- <notes>
40
-New features:
41
- * New observer that can do on-the-fly decoding of compressed responses,
42
- see HTTP_Request2_Observer_UncompressingDownload.
43
- Thanks to Delian Krustev for initial implementation.
44
- * CookieJar can now silently ignore invalid cookies with $jar->ignoreInvalidCookies(true);
45
- instead of throwing an exception. See requests #19937 and #20401
46
- * Adapters now dispatch a new 'warning' event, e.g. in case of incomplete response
47
- body or broken 'chunked' encoding. Exception was thrown previously by Socket adapter
48
- in the latter case, see bug #20228
49
- * Improved security of HTTPS requests in Socket adapter
50
- - Use 'tls://' instead of 'ssl://' in connection string to prevent fallback to
51
- known insecure versions, use only TLS when enabling crypto via proxy (see bug #20462)
52
- - On PHP 5.6+ require using only TLS 1.1 and TLS 1.2
53
- - Do not use insecure ciphers
54
- * Improved test suite, network-backed tests now run on Travis CI
55
-
56
-Changes and fixes:
57
- * Curl adapter failed to send PUT request body with 'follow_redirects' on (bug #20440)
58
- * Curl adapter supplied invalid cookie domain to CookieJar after redirect (bug #20561)
59
- * Curl adapter now properly dispatches events while sending the request
60
- * mime_content_type() returning false was handled incorrectly when guessing content-type
61
- * Use 'peer_name' and 'verify_peer_name' SSL context options on PHP 5.6+
62
- instead of deprecated 'CN_match'
63
- * Public Suffix List updated to current version, its download location changed
64
-
65
-Note to Composer users: next package version will probably get rid of 'include-path'
66
-setting in composer.json favour of using autoloader.
67
- </notes>
68
- <contents>
69
- <dir name="/">
70
- <dir name="HTTP">
71
- <dir name="Request2">
72
- <dir name="Adapter">
73
- <file role="php" name="Curl.php">
74
- <tasks:replace from="@package_version@" to="version" type="package-info" />
75
- </file>
76
- <file role="php" name="Mock.php">
77
- <tasks:replace from="@package_version@" to="version" type="package-info" />
78
- </file>
79
- <file role="php" name="Socket.php">
80
- <tasks:replace from="@package_version@" to="version" type="package-info" />
81
- </file>
82
- </dir>
83
- <file role="php" name="Adapter.php">
84
- <tasks:replace from="@package_version@" to="version" type="package-info" />
85
- </file>
86
- <file role="php" name="CookieJar.php">
87
- <tasks:replace from="@package_version@" to="version" type="package-info" />
88
- <tasks:replace from="@data_dir@" to="data_dir" type="pear-config" />
89
- </file>
90
- <file role="php" name="Exception.php">
91
- <tasks:replace from="@package_version@" to="version" type="package-info" />
92
- </file>
93
- <file role="php" name="MultipartBody.php">
94
- <tasks:replace from="@package_version@" to="version" type="package-info" />
95
- </file>
96
- <file role="php" name="SocketWrapper.php">
97
- <tasks:replace from="@package_version@" to="version" type="package-info" />
98
- </file>
99
- <file role="php" name="SOCKS5.php">
100
- <tasks:replace from="@package_version@" to="version" type="package-info" />
101
- </file>
102
- <dir name="Observer">
103
- <file role="php" name="Log.php">
104
- <tasks:replace from="@package_version@" to="version" type="package-info" />
105
- </file>
106
- <file role="php" name="UncompressingDownload.php">
107
- <tasks:replace from="@package_version@" to="version" type="package-info" />
108
- </file>
109
- </dir>
110
- <file role="php" name="Response.php">
111
- <tasks:replace from="@package_version@" to="version" type="package-info" />
112
- </file>
113
- </dir>
114
- <file role="php" name="Request2.php">
115
- <tasks:replace from="@package_version@" to="version" type="package-info" />
116
- </file>
117
- </dir>
118
- <dir name="tests">
119
- <dir name="_files">
120
- <file role="test" name="bug_15305" />
121
- <file role="test" name="bug_18169" />
122
- <file role="test" name="empty.gif" />
123
- <file role="test" name="plaintext.txt" />
124
- <file role="test" name="response_cookies" />
125
- <file role="test" name="response_deflate" />
126
- <file role="test" name="response_gzip" />
127
- <file role="test" name="response_gzip_broken" />
128
- <file role="test" name="response_headers" />
129
- </dir>
130
- <dir name="_network">
131
- <file role="test" name="basicauth.php" />
132
- <file role="test" name="bug19934.php" />
133
- <file role="test" name="bug20228.php" />
134
- <file role="test" name="cookies.php" />
135
- <file role="test" name="digestauth.php" />
136
- <file role="test" name="download.php" />
137
- <file role="test" name="getparameters.php" />
138
- <file role="test" name="incompletebody.php" />
139
- <file role="test" name="postparameters.php" />
140
- <file role="test" name="rawpostdata.php" />
141
- <file role="test" name="redirects.php" />
142
- <file role="test" name="setcookie.php" />
143
- <file role="test" name="timeout.php" />
144
- <file role="test" name="uploads.php" />
145
- </dir>
146
- <dir name="Request2">
147
- <dir name="Adapter">
148
- <file role="test" name="AllTests.php" />
149
- <file role="test" name="CommonNetworkTest.php" />
150
- <file role="test" name="CurlTest.php" />
151
- <file role="test" name="MockTest.php" />
152
- <file role="test" name="SkippedTests.php" />
153
- <file role="test" name="SocketProxyTest.php" />
154
- <file role="test" name="SocketTest.php" />
155
- </dir>
156
- <file role="test" name="AllTests.php" />
157
- <file role="test" name="CookieJarTest.php" />
158
- <file role="test" name="MultipartBodyTest.php" />
159
- <file role="test" name="ResponseTest.php" />
160
- </dir>
161
- <file role="test" name="AllTests.php" />
162
- <file role="test" name="NetworkConfig.php.dist" />
163
- <file role="test" name="ObserverTest.php" />
164
- <file role="test" name="Request2Test.php" />
165
- <file role="test" name="TestHelper.php">
166
- <tasks:replace from="@package_version@" to="version" type="package-info" />
167
- </file>
168
- </dir>
169
- <dir name="docs">
170
- <file role="doc" name="LICENSE" />
171
- <file role="doc" name="examples/upload-rapidshare.php" />
172
- </dir>
173
- <dir name="data">
174
- <file role="data" name="generate-list.php" />
175
- <file role="data" name="public-suffix-list.php" />
176
- </dir>
177
- </dir>
178
- </contents>
179
- <dependencies>
180
- <required>
181
- <php>
182
- <min>5.2.0</min>
183
- </php>
184
- <pearinstaller>
185
- <min>1.9.2</min>
186
- </pearinstaller>
187
- <package>
188
- <name>Net_URL2</name>
189
- <channel>pear.php.net</channel>
190
- <min>2.2.0</min>
191
- </package>
192
- <package>
193
- <name>PEAR</name>
194
- <channel>pear.php.net</channel>
195
- <min>1.9.2</min>
196
- </package>
197
- </required>
198
- <optional>
199
- <extension>
200
- <name>curl</name>
201
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests
Deleted
2
1
-(directory)
2
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/AllTests.php
Deleted
61
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-if (!defined('PHPUnit_MAIN_METHOD')) {
23
- if (strpos($_SERVER'argv'0, 'phpunit') === false) {
24
- define('PHPUnit_MAIN_METHOD', 'HTTP_Request2_AllTests::main');
25
- } else {
26
- define('PHPUnit_MAIN_METHOD', false);
27
- }
28
-}
29
-
30
-require_once dirname(__FILE__) . '/Request2Test.php';
31
-require_once dirname(__FILE__) . '/ObserverTest.php';
32
-require_once dirname(__FILE__) . '/Request2/AllTests.php';
33
-
34
-class HTTP_Request2_AllTests
35
-{
36
- public static function main()
37
- {
38
- if (!class_exists('PHPUnit_TextUI_TestRunner', true)) {
39
- require_once 'PHPUnit/TextUI/TestRunner.php';
40
- }
41
- PHPUnit_TextUI_TestRunner::run(self::suite());
42
- }
43
-
44
- public static function suite()
45
- {
46
- $suite = new PHPUnit_Framework_TestSuite('HTTP_Request2 package');
47
-
48
- $suite->addTest(Request2_AllTests::suite());
49
- $suite->addTestSuite('HTTP_Request2Test');
50
- $suite->addTestSuite('HTTP_Request2_ObserverTest');
51
-
52
- return $suite;
53
- }
54
-}
55
-
56
-if (PHPUnit_MAIN_METHOD == 'HTTP_Request2_AllTests::main') {
57
- HTTP_Request2_AllTests::main();
58
-}
59
-?>
60
\ No newline at end of file
61
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/NetworkConfig.php.dist
Deleted
61
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/**
23
- * This file contains configuration needed for running HTTP_Request2 tests
24
- * that interact with the network. Do not edit this file, copy it to
25
- * NetworkConfig.php and edit the copy instead.
26
- */
27
-
28
-/**
29
- * Base URL for HTTP_Request2 Adapters tests
30
- *
31
- * To enable the tests that actually perform network interaction, you should
32
- * copy the contents of _network directory to a directory under your web
33
- * server's document root or create a symbolic link to _network directory
34
- * there. Set this constant to point to the URL of that directory.
35
- */
36
-define('HTTP_REQUEST2_TESTS_BASE_URL', null);
37
-
38
-/**
39
- * URL that is protected by server digest authentication
40
- *
41
- * This is needed for testing of 100 Continue handling, we can't implement
42
- * digest in PHP since it will kick in a bit later
43
- */
44
-define('HTTP_REQUEST2_TESTS_DIGEST_URL', null);
45
-
46
-/**#@+
47
- * Proxy setup for Socket Adapter tests
48
- *
49
- * Set these constants to run additional tests for Socket Adapter using a HTTP
50
- * proxy. If proxy host is not set then the tests will not be run.
51
- */
52
-define('HTTP_REQUEST2_TESTS_PROXY_HOST', null);
53
-define('HTTP_REQUEST2_TESTS_PROXY_PORT', 8080);
54
-define('HTTP_REQUEST2_TESTS_PROXY_USER', '');
55
-define('HTTP_REQUEST2_TESTS_PROXY_PASSWORD', '');
56
-define('HTTP_REQUEST2_TESTS_PROXY_AUTH_SCHEME', 'basic');
57
-define('HTTP_REQUEST2_TESTS_PROXY_TYPE', 'http');
58
-/**#@-*/
59
-?>
60
\ No newline at end of file
61
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/NetworkConfig.php.travis
Deleted
59
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/**
23
- * This file contains configuration needed for running HTTP_Request2 tests
24
- * that interact with the network. Do not edit this file, copy it to
25
- * NetworkConfig.php and edit the copy instead.
26
- */
27
-
28
-/**
29
- * Base URL for HTTP_Request2 Adapters tests
30
- *
31
- * To enable the tests that actually perform network interaction, you should
32
- * copy the contents of _network directory to a directory under your web
33
- * server's document root or create a symbolic link to _network directory
34
- * there. Set this constant to point to the URL of that directory.
35
- */
36
-define('HTTP_REQUEST2_TESTS_BASE_URL', 'http://hr2.local/');
37
-
38
-/**
39
- * URL that is protected by server digest authentication
40
- *
41
- * This is needed for testing of 100 Continue handling, we can't implement
42
- * digest in PHP since it will kick in a bit later
43
- */
44
-define('HTTP_REQUEST2_TESTS_DIGEST_URL', null);
45
-
46
-/**#@+
47
- * Proxy setup for Socket Adapter tests
48
- *
49
- * Set these constants to run additional tests for Socket Adapter using a HTTP
50
- * proxy. If proxy host is not set then the tests will not be run.
51
- */
52
-define('HTTP_REQUEST2_TESTS_PROXY_HOST', null);
53
-define('HTTP_REQUEST2_TESTS_PROXY_PORT', 8080);
54
-define('HTTP_REQUEST2_TESTS_PROXY_USER', '');
55
-define('HTTP_REQUEST2_TESTS_PROXY_PASSWORD', '');
56
-define('HTTP_REQUEST2_TESTS_PROXY_AUTH_SCHEME', 'basic');
57
-define('HTTP_REQUEST2_TESTS_PROXY_TYPE', 'http');
58
-/**#@-*/
59
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/ObserverTest.php
Deleted
98
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/** Sets up includes */
23
-require_once dirname(__FILE__) . '/TestHelper.php';
24
-
25
-/**
26
- * Class representing a HTTP request
27
- */
28
-require_once 'HTTP/Request2.php';
29
-
30
-/**
31
- * Mock observer
32
- */
33
-class HTTP_Request2_MockObserver implements SplObserver
34
-{
35
- public $calls = 0;
36
-
37
- public $event;
38
-
39
- public function update (SplSubject $subject)
40
- {
41
- $this->calls++;
42
- $this->event = $subject->getLastEvent();
43
- }
44
-}
45
-
46
-/**
47
- * Unit test for subject-observer pattern implementation in HTTP_Request2
48
- */
49
-class HTTP_Request2_ObserverTest extends PHPUnit_Framework_TestCase
50
-{
51
- public function testSetLastEvent()
52
- {
53
- $request = new HTTP_Request2();
54
- $observer = new HTTP_Request2_MockObserver();
55
- $request->attach($observer);
56
-
57
- $request->setLastEvent('foo', 'bar');
58
- $this->assertEquals(1, $observer->calls);
59
- $this->assertEquals(array('name' => 'foo', 'data' => 'bar'), $observer->event);
60
-
61
- $request->setLastEvent('baz');
62
- $this->assertEquals(2, $observer->calls);
63
- $this->assertEquals(array('name' => 'baz', 'data' => null), $observer->event);
64
- }
65
-
66
- public function testAttachOnlyOnce()
67
- {
68
- $request = new HTTP_Request2();
69
- $observer = new HTTP_Request2_MockObserver();
70
- $observer2 = new HTTP_Request2_MockObserver();
71
- $request->attach($observer);
72
- $request->attach($observer2);
73
- $request->attach($observer);
74
-
75
- $request->setLastEvent('event', 'data');
76
- $this->assertEquals(1, $observer->calls);
77
- $this->assertEquals(1, $observer2->calls);
78
- }
79
-
80
- public function testDetach()
81
- {
82
- $request = new HTTP_Request2();
83
- $observer = new HTTP_Request2_MockObserver();
84
- $observer2 = new HTTP_Request2_MockObserver();
85
-
86
- $request->attach($observer);
87
- $request->detach($observer2); // should not be a error
88
- $request->setLastEvent('first');
89
-
90
- $request->detach($observer);
91
- $request->setLastEvent('second');
92
- $this->assertEquals(1, $observer->calls);
93
- $this->assertEquals(array('name' => 'first', 'data' => null), $observer->event);
94
- }
95
-}
96
-?>
97
\ No newline at end of file
98
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2
Deleted
2
1
-(directory)
2
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2/Adapter
Deleted
2
1
-(directory)
2
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2/Adapter/AllTests.php
Deleted
79
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-if (!defined('PHPUnit_MAIN_METHOD')) {
23
- if (strpos($_SERVER'argv'0, 'phpunit') === false) {
24
- define('PHPUnit_MAIN_METHOD', 'Request2_Adapter_AllTests::main');
25
- } else {
26
- define('PHPUnit_MAIN_METHOD', false);
27
- }
28
-}
29
-
30
-require_once dirname(__FILE__) . '/MockTest.php';
31
-require_once dirname(__FILE__) . '/SkippedTests.php';
32
-require_once dirname(__FILE__) . '/SocketTest.php';
33
-require_once dirname(__FILE__) . '/SocketProxyTest.php';
34
-require_once dirname(__FILE__) . '/CurlTest.php';
35
-
36
-class Request2_Adapter_AllTests
37
-{
38
- public static function main()
39
- {
40
- if (!class_exists('PHPUnit_TextUI_TestRunner', true)) {
41
- require_once 'PHPUnit/TextUI/TestRunner.php';
42
- }
43
- PHPUnit_TextUI_TestRunner::run(self::suite());
44
- }
45
-
46
- public static function suite()
47
- {
48
- $suite = new PHPUnit_Framework_TestSuite('HTTP_Request2 package - Request2 - Adapter');
49
-
50
- $suite->addTestSuite('HTTP_Request2_Adapter_MockTest');
51
- if (defined('HTTP_REQUEST2_TESTS_BASE_URL') && HTTP_REQUEST2_TESTS_BASE_URL) {
52
- $suite->addTestSuite('HTTP_Request2_Adapter_SocketTest');
53
- } else {
54
- $suite->addTestSuite('HTTP_Request2_Adapter_Skip_SocketTest');
55
- }
56
- if (defined('HTTP_REQUEST2_TESTS_PROXY_HOST') && HTTP_REQUEST2_TESTS_PROXY_HOST
57
- && defined('HTTP_REQUEST2_TESTS_BASE_URL') && HTTP_REQUEST2_TESTS_BASE_URL
58
- ) {
59
- $suite->addTestSuite('HTTP_Request2_Adapter_SocketProxyTest');
60
- } else {
61
- $suite->addTestSuite('HTTP_Request2_Adapter_Skip_SocketProxyTest');
62
- }
63
- if (defined('HTTP_REQUEST2_TESTS_BASE_URL') && HTTP_REQUEST2_TESTS_BASE_URL
64
- && extension_loaded('curl')
65
- ) {
66
- $suite->addTestSuite('HTTP_Request2_Adapter_CurlTest');
67
- } else {
68
- $suite->addTestSuite('HTTP_Request2_Adapter_Skip_CurlTest');
69
- }
70
-
71
- return $suite;
72
- }
73
-}
74
-
75
-if (PHPUnit_MAIN_METHOD == 'Request2_Adapter_AllTests::main') {
76
- Request2_Adapter_AllTests::main();
77
-}
78
-?>
79
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2/Adapter/CommonNetworkTest.php
Deleted
201
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/** Sets up includes */
23
-require_once dirname(dirname(dirname(__FILE__))) . '/TestHelper.php';
24
-
25
-/** Class representing a HTTP request */
26
-require_once 'HTTP/Request2.php';
27
-/** Class for building multipart/form-data request body */
28
-require_once 'HTTP/Request2/MultipartBody.php';
29
-/** An observer that saves response body to stream, possibly uncompressing it */
30
-require_once 'HTTP/Request2/Observer/UncompressingDownload.php';
31
-
32
-class SlowpokeBody extends HTTP_Request2_MultipartBody
33
-{
34
- protected $doSleep;
35
-
36
- public function rewind()
37
- {
38
- $this->doSleep = true;
39
- parent::rewind();
40
- }
41
-
42
- public function read($length)
43
- {
44
- if ($this->doSleep) {
45
- sleep(3);
46
- $this->doSleep = false;
47
- }
48
- return parent::read($length);
49
- }
50
-}
51
-
52
-class HeaderObserver implements SplObserver
53
-{
54
- public $headers;
55
-
56
- public function update(SplSubject $subject)
57
- {
58
- /* @var $subject HTTP_Request2 */
59
- $event = $subject->getLastEvent();
60
-
61
- // force a timeout when writing request body
62
- if ('sentHeaders' == $event'name') {
63
- $this->headers = $event'data';
64
- }
65
- }
66
-}
67
-
68
-class EventSequenceObserver implements SplObserver
69
-{
70
- private $_watched = array();
71
-
72
- public $sequence = array();
73
-
74
- public function __construct(array $watchedEvents = array())
75
- {
76
- if (!empty($watchedEvents)) {
77
- $this->_watched = $watchedEvents;
78
- }
79
- }
80
-
81
- public function update(SplSubject $subject)
82
- {
83
- /* @var $subject HTTP_Request2 */
84
- $event = $subject->getLastEvent();
85
-
86
- if ($event'name' !== end($this->sequence)
87
- && (empty($this->_watched) || in_array($event'name', $this->_watched, true))
88
- ) {
89
- $this->sequence = $event'name';
90
- }
91
- }
92
-}
93
-
94
-
95
-/**
96
- * Tests for HTTP_Request2 package that require a working webserver
97
- *
98
- * The class contains some common tests that should be run for all Adapters,
99
- * it is extended by their unit tests.
100
- *
101
- * You need to properly set up this test suite, refer to NetworkConfig.php.dist
102
- */
103
-abstract class HTTP_Request2_Adapter_CommonNetworkTest extends PHPUnit_Framework_TestCase
104
-{
105
- /**
106
- * HTTP Request object
107
- * @var HTTP_Request2
108
- */
109
- protected $request;
110
-
111
- /**
112
- * Base URL for remote test files
113
- * @var string
114
- */
115
- protected $baseUrl;
116
-
117
- /**
118
- * Configuration for HTTP Request object
119
- * @var array
120
- */
121
- protected $config = array();
122
-
123
- protected function setUp()
124
- {
125
- if (!defined('HTTP_REQUEST2_TESTS_BASE_URL') || !HTTP_REQUEST2_TESTS_BASE_URL) {
126
- $this->markTestSkipped('Base URL is not configured');
127
-
128
- } else {
129
- $this->baseUrl = rtrim(HTTP_REQUEST2_TESTS_BASE_URL, '/') . '/';
130
- $name = strtolower(preg_replace('/^test/i', '', $this->getName())) . '.php';
131
-
132
- $this->request = new HTTP_Request2(
133
- $this->baseUrl . $name, HTTP_Request2::METHOD_GET, $this->config
134
- );
135
- }
136
- }
137
-
138
- /**
139
- * Tests possibility to send GET parameters
140
- *
141
- * NB: Currently there are problems with Net_URL2::setQueryVariables(), thus
142
- * array structure is simple: http://pear.php.net/bugs/bug.php?id=18267
143
- */
144
- public function testGetParameters()
145
- {
146
- $data = array(
147
- 'bar' => array(
148
- 'key' => 'value'
149
- ),
150
- 'foo' => 'some value',
151
- 'numbered' => array('first', 'second')
152
- );
153
-
154
- $this->request->getUrl()->setQueryVariables($data);
155
- $response = $this->request->send();
156
- $this->assertEquals(serialize($data), $response->getBody());
157
- }
158
-
159
- public function testPostParameters()
160
- {
161
- $data = array(
162
- 'bar' => array(
163
- 'key' => 'some other value'
164
- ),
165
- 'baz' => array(
166
- 'key1' => array(
167
- 'key2' => 'yet another value'
168
- )
169
- ),
170
- 'foo' => 'some value',
171
- 'indexed' => array('first', 'second')
172
- );
173
- $events = array(
174
- 'sentHeaders', 'sentBodyPart', 'sentBody', 'receivedHeaders', 'receivedBodyPart', 'receivedBody'
175
- );
176
- $observer = new EventSequenceObserver($events);
177
-
178
- $this->request->setMethod(HTTP_Request2::METHOD_POST)
179
- ->setHeader('Accept-Encoding', 'identity')
180
- ->addPostParameter($data)
181
- ->attach($observer);
182
-
183
- $response = $this->request->send();
184
- $this->assertEquals(serialize($data), $response->getBody());
185
- $this->assertEquals($events, $observer->sequence);
186
- }
187
-
188
- public function testUploads()
189
- {
190
- $this->request->setMethod(HTTP_Request2::METHOD_POST)
191
- ->addUpload('foo', dirname(dirname(dirname(__FILE__))) . '/_files/empty.gif', 'picture.gif', 'image/gif')
192
- ->addUpload('bar', array(
193
- array(dirname(dirname(dirname(__FILE__))) . '/_files/empty.gif', null, 'image/gif'),
194
- array(dirname(dirname(dirname(__FILE__))) . '/_files/plaintext.txt', 'secret.txt', 'text/x-whatever')
195
- ));
196
-
197
- $response = $this->request->send();
198
- $this->assertContains("foo picture.gif image/gif 43", $response->getBody());
199
- $this->assertContains("bar0 empty.gif image/gif 43", $response->getBody());
200
- $this->assertContains("bar1 secret.txt text/x-whatever 15", $response->getBody());
201
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2/Adapter/CurlTest.php
Deleted
183
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/** Tests for HTTP_Request2 package that require a working webserver */
23
-require_once dirname(__FILE__) . '/CommonNetworkTest.php';
24
-
25
-class UploadSizeObserver implements SplObserver
26
-{
27
- public $size;
28
-
29
- public function update(SplSubject $subject)
30
- {
31
- /* @var $subject HTTP_Request2 */
32
- $event = $subject->getLastEvent();
33
-
34
- if ('sentBody' == $event'name') {
35
- $this->size = $event'data';
36
- }
37
- }
38
-
39
-}
40
-
41
-/**
42
- * Unit test for Curl Adapter of HTTP_Request2
43
- */
44
-class HTTP_Request2_Adapter_CurlTest extends HTTP_Request2_Adapter_CommonNetworkTest
45
-{
46
- /**
47
- * Configuration for HTTP Request object
48
- * @var array
49
- */
50
- protected $config = array(
51
- 'adapter' => 'HTTP_Request2_Adapter_Curl'
52
- );
53
-
54
- /**
55
- * Checks whether redirect support in cURL is disabled by safe_mode or open_basedir
56
- * @return bool
57
- */
58
- protected function isRedirectSupportDisabled()
59
- {
60
- return ini_get('safe_mode') || ini_get('open_basedir');
61
- }
62
-
63
- public function testRedirectsDefault()
64
- {
65
- if ($this->isRedirectSupportDisabled()) {
66
- $this->markTestSkipped('Redirect support in cURL is disabled by safe_mode or open_basedir setting');
67
- } else {
68
- parent::testRedirectsDefault();
69
- }
70
- }
71
-
72
- public function testRedirectsStrict()
73
- {
74
- if ($this->isRedirectSupportDisabled()) {
75
- $this->markTestSkipped('Redirect support in cURL is disabled by safe_mode or open_basedir setting');
76
- } elseif (version_compare(phpversion(), '5.3.2', '<')) {
77
- $this->markTestSkipped('CURLOPT_POSTREDIR required for strict redirects, available in PHP 5.3.2+');
78
- } else {
79
- parent::testRedirectsStrict();
80
- }
81
- }
82
-
83
- public function testRedirectsLimit()
84
- {
85
- if ($this->isRedirectSupportDisabled()) {
86
- $this->markTestSkipped('Redirect support in cURL is disabled by safe_mode or open_basedir setting');
87
- } else {
88
- parent::testRedirectsLimit();
89
- }
90
- }
91
-
92
- public function testRedirectsRelative()
93
- {
94
- if ($this->isRedirectSupportDisabled()) {
95
- $this->markTestSkipped('Redirect support in cURL is disabled by safe_mode or open_basedir setting');
96
- } else {
97
- parent::testRedirectsRelative();
98
- }
99
- }
100
-
101
- public function testRedirectsNonHTTP()
102
- {
103
- if ($this->isRedirectSupportDisabled()) {
104
- $this->markTestSkipped('Redirect support in cURL is disabled by safe_mode or open_basedir setting');
105
- } else {
106
- parent::testRedirectsNonHTTP();
107
- }
108
- }
109
-
110
- public function testCookieJarAndRedirect()
111
- {
112
- if ($this->isRedirectSupportDisabled()) {
113
- $this->markTestSkipped('Redirect support in cURL is disabled by safe_mode or open_basedir setting');
114
- } else {
115
- parent::testCookieJarAndRedirect();
116
- }
117
- }
118
-
119
- public function testBug17450()
120
- {
121
- if (!$this->isRedirectSupportDisabled()) {
122
- $this->markTestSkipped('Neither safe_mode nor open_basedir is enabled');
123
- }
124
-
125
- $this->request->setUrl($this->baseUrl . 'redirects.php')
126
- ->setConfig(array('follow_redirects' => true));
127
-
128
- try {
129
- $this->request->send();
130
- $this->fail('Expected HTTP_Request2_Exception was not thrown');
131
-
132
- } catch (HTTP_Request2_LogicException $e) {
133
- $this->assertEquals(HTTP_Request2_Exception::MISCONFIGURATION, $e->getCode());
134
- }
135
- }
136
-
137
- public function testBug20440()
138
- {
139
- $this->request->setUrl($this->baseUrl . 'rawpostdata.php')
140
- ->setMethod(HTTP_Request2::METHOD_PUT)
141
- ->setHeader('Expect', '')
142
- ->setBody('This is a test');
143
-
144
- $noredirects = clone $this->request;
145
- $noredirects->setConfig('follow_redirects', false)
146
- ->attach($observer = new UploadSizeObserver());
147
- $noredirects->send();
148
- // Curl sends body with Transfer-encoding: chunked, so size can be larger
149
- $this->assertGreaterThanOrEqual(14, $observer->size);
150
-
151
- $redirects = clone $this->request;
152
- $redirects->setConfig('follow_redirects', true)
153
- ->attach($observer = new UploadSizeObserver());
154
- $redirects->send();
155
- $this->assertGreaterThanOrEqual(14, $observer->size);
156
- }
157
-
158
- /**
159
- * An URL performing a redirect was used for storing cookies in a jar rather than target URL
160
- *
161
- * @link http://pear.php.net/bugs/bug.php?id=20561
162
- */
163
- public function testBug20561()
164
- {
165
- if ($this->isRedirectSupportDisabled()) {
166
- $this->markTestSkipped('Redirect support in cURL is disabled by safe_mode or open_basedir setting');
167
-
168
- } else {
169
- $this->request->setUrl($this->baseUrl . 'redirects.php?special=youtube')
170
- ->setConfig(array(
171
- 'follow_redirects' => true,
172
- 'ssl_verify_peer' => false
173
- ))
174
- ->setCookieJar(true);
175
-
176
- $this->request->send();
177
- $this->assertGreaterThan(0, count($this->request->getCookieJar()->getAll()));
178
- }
179
- }
180
-}
181
-?>
182
\ No newline at end of file
183
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2/Adapter/MockTest.php
Deleted
159
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/** Sets up includes */
23
-require_once dirname(dirname(dirname(__FILE__))) . '/TestHelper.php';
24
-
25
-/**
26
- * Class representing a HTTP request
27
- */
28
-require_once 'HTTP/Request2.php';
29
-
30
-/**
31
- * Mock adapter intended for testing
32
- */
33
-require_once 'HTTP/Request2/Adapter/Mock.php';
34
-
35
-/**
36
- * Unit test for HTTP_Request2_Response class
37
- */
38
-class HTTP_Request2_Adapter_MockTest extends PHPUnit_Framework_TestCase
39
-{
40
- public function testDefaultResponse()
41
- {
42
- $req = new HTTP_Request2('http://www.example.com/', HTTP_Request2::METHOD_GET,
43
- array('adapter' => 'mock'));
44
- $response = $req->send();
45
- $this->assertEquals(400, $response->getStatus());
46
- $this->assertEquals(0, count($response->getHeader()));
47
- $this->assertEquals('', $response->getBody());
48
- }
49
-
50
- public function testResponseFromString()
51
- {
52
- $mock = new HTTP_Request2_Adapter_Mock();
53
- $mock->addResponse(
54
- "HTTP/1.1 200 OK\r\n" .
55
- "Content-Type: text/plain; charset=iso-8859-1\r\n" .
56
- "\r\n" .
57
- "This is a string"
58
- );
59
- $req = new HTTP_Request2('http://www.example.com/');
60
- $req->setAdapter($mock);
61
-
62
- $response = $req->send();
63
- $this->assertEquals(200, $response->getStatus());
64
- $this->assertEquals(1, count($response->getHeader()));
65
- $this->assertEquals('This is a string', $response->getBody());
66
- }
67
-
68
- public function testResponseFromFile()
69
- {
70
- $mock = new HTTP_Request2_Adapter_Mock();
71
- $mock->addResponse(fopen(dirname(dirname(dirname(__FILE__))) .
72
- '/_files/response_headers', 'rb'));
73
-
74
- $req = new HTTP_Request2('http://www.example.com/');
75
- $req->setAdapter($mock);
76
-
77
- $response = $req->send();
78
- $this->assertEquals(200, $response->getStatus());
79
- $this->assertEquals(7, count($response->getHeader()));
80
- $this->assertEquals('Nothing to see here, move along.', $response->getBody());
81
- }
82
-
83
- public function testResponsesQueue()
84
- {
85
- $mock = new HTTP_Request2_Adapter_Mock();
86
- $mock->addResponse(
87
- "HTTP/1.1 301 Over there\r\n" .
88
- "Location: http://www.example.com/newpage.html\r\n" .
89
- "\r\n" .
90
- "The document is over there"
91
- );
92
- $mock->addResponse(
93
- "HTTP/1.1 200 OK\r\n" .
94
- "Content-Type: text/plain; charset=iso-8859-1\r\n" .
95
- "\r\n" .
96
- "This is a string"
97
- );
98
-
99
- $req = new HTTP_Request2('http://www.example.com/');
100
- $req->setAdapter($mock);
101
- $this->assertEquals(301, $req->send()->getStatus());
102
- $this->assertEquals(200, $req->send()->getStatus());
103
- $this->assertEquals(400, $req->send()->getStatus());
104
- }
105
-
106
- /**
107
- * Returning URL-specific responses
108
- * @link http://pear.php.net/bugs/bug.php?id=19276
109
- */
110
- public function testRequest19276()
111
- {
112
- $mock = new HTTP_Request2_Adapter_Mock();
113
- $mock->addResponse(
114
- "HTTP/1.1 200 OK\r\n" .
115
- "Content-Type: text/plain; charset=iso-8859-1\r\n" .
116
- "\r\n" .
117
- "This is a response from example.org",
118
- 'http://example.org/'
119
- );
120
- $mock->addResponse(
121
- "HTTP/1.1 200 OK\r\n" .
122
- "Content-Type: text/plain; charset=iso-8859-1\r\n" .
123
- "\r\n" .
124
- "This is a response from example.com",
125
- 'http://example.com/'
126
- );
127
-
128
- $req1 = new HTTP_Request2('http://localhost/');
129
- $req1->setAdapter($mock);
130
- $this->assertEquals(400, $req1->send()->getStatus());
131
-
132
- $req2 = new HTTP_Request2('http://example.com/');
133
- $req2->setAdapter($mock);
134
- $this->assertContains('example.com', $req2->send()->getBody());
135
-
136
- $req3 = new HTTP_Request2('http://example.org');
137
- $req3->setAdapter($mock);
138
- $this->assertContains('example.org', $req3->send()->getBody());
139
- }
140
-
141
- public function testResponseException()
142
- {
143
- $mock = new HTTP_Request2_Adapter_Mock();
144
- $mock->addResponse(
145
- new HTTP_Request2_Exception('Shit happens')
146
- );
147
- $req = new HTTP_Request2('http://www.example.com/');
148
- $req->setAdapter($mock);
149
- try {
150
- $req->send();
151
- } catch (Exception $e) {
152
- $this->assertEquals('Shit happens', $e->getMessage());
153
- return;
154
- }
155
- $this->fail('Expected HTTP_Request2_Exception was not thrown');
156
- }
157
-}
158
-?>
159
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2/Adapter/SkippedTests.php
Deleted
59
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/** Sets up includes */
23
-require_once dirname(dirname(dirname(__FILE__))) . '/TestHelper.php';
24
-
25
-/**
26
- * Shows a skipped test if networked tests are not configured
27
- */
28
-class HTTP_Request2_Adapter_Skip_SocketTest extends PHPUnit_Framework_TestCase
29
-{
30
- public function testSocketAdapter()
31
- {
32
- $this->markTestSkipped('Socket Adapter tests need base URL configured.');
33
- }
34
-}
35
-
36
-/**
37
- * Shows a skipped test if proxy is not configured
38
- */
39
-class HTTP_Request2_Adapter_Skip_SocketProxyTest extends PHPUnit_Framework_TestCase
40
-{
41
- public function testSocketAdapterWithProxy()
42
- {
43
- $this->markTestSkipped('Socket Adapter proxy tests need base URL and proxy configured');
44
- }
45
-}
46
-
47
-/**
48
- * Shows a skipped test if networked tests are not configured or cURL extension is unavailable
49
- */
50
-class HTTP_Request2_Adapter_Skip_CurlTest extends PHPUnit_Framework_TestCase
51
-{
52
- public function testCurlAdapter()
53
- {
54
- $this->markTestSkipped('Curl Adapter tests need base URL configured and curl extension available');
55
- }
56
-}
57
-?>
58
\ No newline at end of file
59
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2/Adapter/SocketProxyTest.php
Deleted
58
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/** Tests for HTTP_Request2 package that require a working webserver */
23
-require_once dirname(__FILE__) . '/CommonNetworkTest.php';
24
-
25
-/**
26
- * Unit test for Socket Adapter of HTTP_Request2 working through proxy
27
- */
28
-class HTTP_Request2_Adapter_SocketProxyTest extends HTTP_Request2_Adapter_CommonNetworkTest
29
-{
30
- /**
31
- * Configuration for HTTP Request object
32
- * @var array
33
- */
34
- protected $config = array(
35
- 'adapter' => 'HTTP_Request2_Adapter_Socket'
36
- );
37
-
38
- protected function setUp()
39
- {
40
- if (!defined('HTTP_REQUEST2_TESTS_PROXY_HOST') || !HTTP_REQUEST2_TESTS_PROXY_HOST) {
41
- $this->markTestSkipped('Proxy is not configured');
42
-
43
- } else {
44
- $this->config += array(
45
- 'proxy_host' => HTTP_REQUEST2_TESTS_PROXY_HOST,
46
- 'proxy_port' => HTTP_REQUEST2_TESTS_PROXY_PORT,
47
- 'proxy_user' => HTTP_REQUEST2_TESTS_PROXY_USER,
48
- 'proxy_password' => HTTP_REQUEST2_TESTS_PROXY_PASSWORD,
49
- 'proxy_auth_scheme' => HTTP_REQUEST2_TESTS_PROXY_AUTH_SCHEME,
50
- 'proxy_type' => HTTP_REQUEST2_TESTS_PROXY_TYPE
51
- );
52
- parent::setUp();
53
- }
54
- }
55
-}
56
-?>
57
\ No newline at end of file
58
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2/Adapter/SocketTest.php
Deleted
194
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/** Tests for HTTP_Request2 package that require a working webserver */
23
-require_once dirname(__FILE__) . '/CommonNetworkTest.php';
24
-
25
-/** Socket-based adapter for HTTP_Request2 */
26
-require_once 'HTTP/Request2/Adapter/Socket.php';
27
-
28
-/**
29
- * Unit test for Socket Adapter of HTTP_Request2
30
- */
31
-class HTTP_Request2_Adapter_SocketTest extends HTTP_Request2_Adapter_CommonNetworkTest
32
-{
33
- /**
34
- * Configuration for HTTP Request object
35
- * @var array
36
- */
37
- protected $config = array(
38
- 'adapter' => 'HTTP_Request2_Adapter_Socket'
39
- );
40
-
41
- public function testBug17826()
42
- {
43
- $adapter = new HTTP_Request2_Adapter_Socket();
44
-
45
- $request1 = new HTTP_Request2($this->baseUrl . 'redirects.php?redirects=2');
46
- $request1->setConfig(array('follow_redirects' => true, 'max_redirects' => 3))
47
- ->setAdapter($adapter)
48
- ->send();
49
-
50
- $request2 = new HTTP_Request2($this->baseUrl . 'redirects.php?redirects=2');
51
- $request2->setConfig(array('follow_redirects' => true, 'max_redirects' => 3))
52
- ->setAdapter($adapter)
53
- ->send();
54
- }
55
-
56
-
57
- /**
58
- * Infinite loop with stream wrapper passed as upload
59
- *
60
- * Dunno how the original reporter managed to pass a file pointer
61
- * that doesn't support fstat() to MultipartBody, maybe he didn't use
62
- * addUpload(). So we don't use it, either.
63
- *
64
- * @link http://pear.php.net/bugs/bug.php?id=19934
65
- */
66
- public function testBug19934()
67
- {
68
- if (!in_array('http', stream_get_wrappers())) {
69
- $this->markTestSkipped("This test requires an HTTP fopen wrapper enabled");
70
- }
71
-
72
- $fp = fopen($this->baseUrl . '/bug19934.php', 'rb');
73
- $body = new HTTP_Request2_MultipartBody(
74
- array(),
75
- array(
76
- 'upload' => array(
77
- 'fp' => $fp,
78
- 'filename' => 'foo.txt',
79
- 'type' => 'text/plain',
80
- 'size' => 20000
81
- )
82
- )
83
- );
84
- $this->request->setMethod(HTTP_Request2::METHOD_POST)
85
- ->setUrl($this->baseUrl . 'uploads.php')
86
- ->setBody($body);
87
-
88
- set_error_handler(array($this, 'rewindWarningsHandler'));
89
- $response = $this->request->send();
90
- restore_error_handler();
91
-
92
- $this->assertContains("upload foo.txt text/plain 20000", $response->getBody());
93
- }
94
-
95
- public function rewindWarningsHandler($errno, $errstr)
96
- {
97
- if (($errno & E_WARNING) && false !== strpos($errstr, 'rewind')) {
98
- return true;
99
- }
100
- return false;
101
- }
102
-
103
- /**
104
- * Do not send request body twice to URLs protected by digest auth
105
- *
106
- * @link http://pear.php.net/bugs/bug.php?id=19233
107
- */
108
- public function test100ContinueHandling()
109
- {
110
- if (!defined('HTTP_REQUEST2_TESTS_DIGEST_URL') || !HTTP_REQUEST2_TESTS_DIGEST_URL) {
111
- $this->markTestSkipped('This test requires an URL protected by server digest auth');
112
- }
113
-
114
- $fp = fopen(dirname(dirname(dirname(__FILE__))) . '/_files/bug_15305', 'rb');
115
- $body = $this->getMock(
116
- 'HTTP_Request2_MultipartBody', array('read'), array(
117
- array(),
118
- array(
119
- 'upload' => array(
120
- 'fp' => $fp,
121
- 'filename' => 'bug_15305',
122
- 'type' => 'application/octet-stream',
123
- 'size' => 16338
124
- )
125
- )
126
- )
127
- );
128
- $body->expects($this->never())->method('read');
129
-
130
- $this->request->setMethod(HTTP_Request2::METHOD_POST)
131
- ->setUrl(HTTP_REQUEST2_TESTS_DIGEST_URL)
132
- ->setBody($body);
133
-
134
- $this->assertEquals(401, $this->request->send()->getStatus());
135
- }
136
-
137
- public function test100ContinueTimeoutBug()
138
- {
139
- $fp = fopen(dirname(dirname(dirname(__FILE__))) . '/_files/bug_15305', 'rb');
140
- $body = new HTTP_Request2_MultipartBody(
141
- array(),
142
- array(
143
- 'upload' => array(
144
- 'fp' => $fp,
145
- 'filename' => 'bug_15305',
146
- 'type' => 'application/octet-stream',
147
- 'size' => 16338
148
- )
149
- )
150
- );
151
-
152
- $this->request->setMethod(HTTP_Request2::METHOD_POST)
153
- ->setUrl($this->baseUrl . 'uploads.php?slowpoke')
154
- ->setBody($body);
155
-
156
- $response = $this->request->send();
157
- $this->assertContains('upload bug_15305 application/octet-stream 16338', $response->getBody());
158
- }
159
-
160
- /**
161
- * Socket adapter should not throw an exception (invalid chunk length '')
162
- * if a buggy server doesn't send last zero-length chunk when using chunked encoding
163
- *
164
- * @link http://pear.php.net/bugs/bug.php?id=20228
165
- */
166
- public function testBug20228()
167
- {
168
- $events = array('receivedBodyPart', 'warning', 'receivedBody');
169
- $this->request->setHeader('Accept-Encoding', 'identity')
170
- ->attach($observer = new EventSequenceObserver($events));
171
- $response = $this->request->send();
172
- $this->assertEquals('This is a test', $response->getBody());
173
- $this->assertEquals($events, $observer->sequence);
174
- }
175
-
176
- public function testHowsMySSL()
177
- {
178
- $this->request->setUrl('https://www.howsmyssl.com/a/check')
179
- ->setConfig('ssl_verify_peer', false);
180
-
181
- if (null === ($responseData = json_decode($this->request->send()->getBody(), true))) {
182
- $this->fail('Cannot decode JSON from howsmyssl.com response');
183
- }
184
-
185
- $this->assertEmpty($responseData'insecure_cipher_suites');
186
-
187
- if (version_compare(phpversion(), '5.6', '>=')) {
188
- $this->assertEquals('Probably Okay', $responseData'rating');
189
- }
190
- }
191
-}
192
-?>
193
\ No newline at end of file
194
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2/AllTests.php
Deleted
63
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-if (!defined('PHPUnit_MAIN_METHOD')) {
23
- if (strpos($_SERVER'argv'0, 'phpunit') === false) {
24
- define('PHPUnit_MAIN_METHOD', 'Request2_AllTests::main');
25
- } else {
26
- define('PHPUnit_MAIN_METHOD', false);
27
- }
28
-}
29
-
30
-require_once dirname(__FILE__) . '/CookieJarTest.php';
31
-require_once dirname(__FILE__) . '/MultipartBodyTest.php';
32
-require_once dirname(__FILE__) . '/ResponseTest.php';
33
-require_once dirname(__FILE__) . '/Adapter/AllTests.php';
34
-
35
-class Request2_AllTests
36
-{
37
- public static function main()
38
- {
39
- if (!class_exists('PHPUnit_TextUI_TestRunner', true)) {
40
- require_once 'PHPUnit/TextUI/TestRunner.php';
41
- }
42
- PHPUnit_TextUI_TestRunner::run(self::suite());
43
- }
44
-
45
- public static function suite()
46
- {
47
- $suite = new PHPUnit_Framework_TestSuite('HTTP_Request2 package - Request2');
48
-
49
- $suite->addTestSuite('HTTP_Request2_CookieJarTest');
50
- $suite->addTestSuite('HTTP_Request2_MultipartBodyTest');
51
- $suite->addTestSuite('HTTP_Request2_ResponseTest');
52
- $suite->addTest(Request2_Adapter_AllTests::suite());
53
-
54
- return $suite;
55
- }
56
-}
57
-
58
-if (PHPUnit_MAIN_METHOD == 'Request2_AllTests::main') {
59
- Request2_AllTests::main();
60
-}
61
-?>
62
\ No newline at end of file
63
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2/CookieJarTest.php
Deleted
201
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/** Sets up includes */
23
-require_once dirname(dirname(__FILE__)) . '/TestHelper.php';
24
-/** Stores cookies and passes them between HTTP requests */
25
-require_once 'HTTP/Request2/CookieJar.php';
26
-/** Mock adapter intended for testing */
27
-require_once 'HTTP/Request2/Adapter/Mock.php';
28
-
29
-/**
30
- * Unit test for HTTP_Request2_CookieJar class
31
- */
32
-class HTTP_Request2_CookieJarTest extends PHPUnit_Framework_TestCase
33
-{
34
- /**
35
- * Cookie jar instance being tested
36
- * @var HTTP_Request2_CookieJar
37
- */
38
- protected $jar;
39
-
40
- protected function setUp()
41
- {
42
- $this->jar = new HTTP_Request2_CookieJar();
43
- }
44
-
45
- /**
46
- * Test that we can't store junk "cookies" in jar
47
- *
48
- * @dataProvider invalidCookieProvider
49
- * @expectedException HTTP_Request2_LogicException
50
- */
51
- public function testStoreInvalid($cookie)
52
- {
53
- $this->jar->store($cookie);
54
- }
55
-
56
- /**
57
- * Per feature requests, allow to ignore invalid cookies rather than throw exceptions
58
- *
59
- * @link http://pear.php.net/bugs/bug.php?id=19937
60
- * @link http://pear.php.net/bugs/bug.php?id=20401
61
- * @dataProvider invalidCookieProvider
62
- */
63
- public function testCanIgnoreInvalidCookies($cookie)
64
- {
65
- $this->jar->ignoreInvalidCookies(true);
66
- $this->assertFalse($this->jar->store($cookie));
67
- }
68
-
69
- /**
70
- * Ignore setting a cookie from "parallel" subdomain when relevant option is on
71
- *
72
- * @link http://pear.php.net/bugs/bug.php?id=20401
73
- */
74
- public function testRequest20401()
75
- {
76
- $this->jar->ignoreInvalidCookies(true);
77
- $response = HTTP_Request2_Adapter_Mock::createResponseFromFile(
78
- fopen(dirname(dirname(__FILE__)) . '/_files/response_cookies', 'rb')
79
- );
80
- $setter = new Net_URL2('http://pecl.php.net/');
81
-
82
- $this->assertFalse($this->jar->addCookiesFromResponse($response, $setter));
83
- $this->assertCount(3, $this->jar->getAll());
84
- }
85
-
86
-
87
- /**
88
- *
89
- * @dataProvider noPSLDomainsProvider
90
- */
91
- public function testDomainMatchNoPSL($requestHost, $cookieDomain, $expected)
92
- {
93
- $this->jar->usePublicSuffixList(false);
94
- $this->assertEquals($expected, $this->jar->domainMatch($requestHost, $cookieDomain));
95
- }
96
-
97
- /**
98
- *
99
- * @dataProvider PSLDomainsProvider
100
- */
101
- public function testDomainMatchPSL($requestHost, $cookieDomain, $expected)
102
- {
103
- $this->jar->usePublicSuffixList(true);
104
- $this->assertEquals($expected, $this->jar->domainMatch($requestHost, $cookieDomain));
105
- }
106
-
107
- public function testConvertExpiresToISO8601()
108
- {
109
- $dt = new DateTime();
110
- $dt->setTimezone(new DateTimeZone('UTC'));
111
- $dt->modify('+1 day');
112
-
113
- $this->jar->store(array(
114
- 'name' => 'foo',
115
- 'value' => 'bar',
116
- 'domain' => '.example.com',
117
- 'path' => '/',
118
- 'expires' => $dt->format(DateTime::COOKIE),
119
- 'secure' => false
120
- ));
121
- $cookies = $this->jar->getAll();
122
- $this->assertEquals($cookies0'expires', $dt->format(DateTime::ISO8601));
123
- }
124
-
125
- public function testProblem2038()
126
- {
127
- $this->jar->store(array(
128
- 'name' => 'foo',
129
- 'value' => 'bar',
130
- 'domain' => '.example.com',
131
- 'path' => '/',
132
- 'expires' => 'Sun, 01 Jan 2040 03:04:05 GMT',
133
- 'secure' => false
134
- ));
135
- $cookies = $this->jar->getAll();
136
- $this->assertEquals(array(array(
137
- 'name' => 'foo',
138
- 'value' => 'bar',
139
- 'domain' => '.example.com',
140
- 'path' => '/',
141
- 'expires' => '2040-01-01T03:04:05+0000',
142
- 'secure' => false
143
- )), $cookies);
144
- }
145
-
146
- public function testStoreExpired()
147
- {
148
- $base = array(
149
- 'name' => 'foo',
150
- 'value' => 'bar',
151
- 'domain' => '.example.com',
152
- 'path' => '/',
153
- 'secure' => false
154
- );
155
-
156
- $dt = new DateTime();
157
- $dt->setTimezone(new DateTimeZone('UTC'));
158
- $dt->modify('-1 day');
159
- $yesterday = $dt->format(DateTime::COOKIE);
160
-
161
- $dt->modify('+2 days');
162
- $tomorrow = $dt->format(DateTime::COOKIE);
163
-
164
- $this->jar->store($base + array('expires' => $yesterday));
165
- $this->assertEquals(0, count($this->jar->getAll()));
166
-
167
- $this->jar->store($base + array('expires' => $tomorrow));
168
- $this->assertEquals(1, count($this->jar->getAll()));
169
- $this->jar->store($base + array('expires' => $yesterday));
170
- $this->assertEquals(0, count($this->jar->getAll()));
171
- }
172
-
173
- /**
174
- *
175
- * @dataProvider cookieAndSetterProvider
176
- */
177
- public function testGetDomainAndPathFromSetter($cookie, $setter, $expected)
178
- {
179
- $this->jar->store($cookie, $setter);
180
- $expected = array_merge($cookie, $expected);
181
- $cookies = $this->jar->getAll();
182
- $this->assertEquals($expected, $cookies0);
183
- }
184
-
185
- /**
186
- *
187
- * @dataProvider cookieMatchProvider
188
- */
189
- public function testGetMatchingCookies($url, $expectedCount)
190
- {
191
- $cookies = array(
192
- array('domain' => '.example.com', 'path' => '/', 'secure' => false),
193
- array('domain' => '.example.com', 'path' => '/', 'secure' => true),
194
- array('domain' => '.example.com', 'path' => '/path', 'secure' => false),
195
- array('domain' => '.example.com', 'path' => '/other', 'secure' => false),
196
- array('domain' => 'example.com', 'path' => '/', 'secure' => false),
197
- array('domain' => 'www.example.com', 'path' => '/', 'secure' => false),
198
- array('domain' => 'specific.example.com', 'path' => '/path', 'secure' => false),
199
- array('domain' => 'nowww.example.com', 'path' => '/', 'secure' => false),
200
- );
201
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2/MultipartBodyTest.php
Deleted
105
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/** Sets up includes */
23
-require_once dirname(dirname(__FILE__)) . '/TestHelper.php';
24
-
25
-/**
26
- * Class representing a HTTP request
27
- */
28
-require_once 'HTTP/Request2.php';
29
-
30
-/**
31
- * Unit test for HTTP_Request2_MultipartBody class
32
- */
33
-class HTTP_Request2_MultipartBodyTest extends PHPUnit_Framework_TestCase
34
-{
35
- public function testUploadSimple()
36
- {
37
- $req = new HTTP_Request2(null, HTTP_Request2::METHOD_POST);
38
- $body = $req->addPostParameter('foo', 'I am a parameter')
39
- ->addUpload('upload', dirname(dirname(__FILE__)) . '/_files/plaintext.txt')
40
- ->getBody();
41
-
42
- $this->assertTrue($body instanceof HTTP_Request2_MultipartBody);
43
- $asString = $body->__toString();
44
- $boundary = $body->getBoundary();
45
- $this->assertEquals($body->getLength(), strlen($asString));
46
- $this->assertContains('This is a test.', $asString);
47
- $this->assertContains('I am a parameter', $asString);
48
- $this->assertRegexp("!--{$boundary}--\r\n$!", $asString);
49
- }
50
-
51
- /**
52
- *
53
- * @expectedException HTTP_Request2_LogicException
54
- */
55
- public function testRequest16863()
56
- {
57
- $req = new HTTP_Request2(null, HTTP_Request2::METHOD_POST);
58
- $fp = fopen(dirname(dirname(__FILE__)) . '/_files/plaintext.txt', 'rb');
59
- $body = $req->addUpload('upload', $fp)
60
- ->getBody();
61
-
62
- $asString = $body->__toString();
63
- $this->assertContains('name="upload"; filename="anonymous.blob"', $asString);
64
- $this->assertContains('This is a test.', $asString);
65
-
66
- $req->addUpload('bad_upload', fopen('php://input', 'rb'));
67
- }
68
-
69
- public function testStreaming()
70
- {
71
- $req = new HTTP_Request2(null, HTTP_Request2::METHOD_POST);
72
- $body = $req->addPostParameter('foo', 'I am a parameter')
73
- ->addUpload('upload', dirname(dirname(__FILE__)) . '/_files/plaintext.txt')
74
- ->getBody();
75
- $asString = '';
76
- while ($part = $body->read(10)) {
77
- $asString .= $part;
78
- }
79
- $this->assertEquals($body->getLength(), strlen($asString));
80
- $this->assertContains('This is a test.', $asString);
81
- $this->assertContains('I am a parameter', $asString);
82
- }
83
-
84
- public function testUploadArray()
85
- {
86
- $req = new HTTP_Request2(null, HTTP_Request2::METHOD_POST);
87
- $body = $req->addUpload('upload', array(
88
- array(dirname(dirname(__FILE__)) . '/_files/plaintext.txt', 'bio.txt', 'text/plain'),
89
- array(fopen(dirname(dirname(__FILE__)) . '/_files/empty.gif', 'rb'), 'photo.gif', 'image/gif')
90
- ))
91
- ->getBody();
92
- $asString = $body->__toString();
93
- $this->assertContains(file_get_contents(dirname(dirname(__FILE__)) . '/_files/empty.gif'), $asString);
94
- $this->assertContains('name="upload0"; filename="bio.txt"', $asString);
95
- $this->assertContains('name="upload1"; filename="photo.gif"', $asString);
96
-
97
- $body2 = $req->setConfig(array('use_brackets' => false))->getBody();
98
- $asString = $body2->__toString();
99
- $this->assertContains('name="upload"; filename="bio.txt"', $asString);
100
- $this->assertContains('name="upload"; filename="photo.gif"', $asString);
101
- }
102
-}
103
-?>
104
\ No newline at end of file
105
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2/ResponseTest.php
Deleted
131
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/** Sets up includes */
23
-require_once dirname(dirname(__FILE__)) . '/TestHelper.php';
24
-
25
-/**
26
- * Class representing a HTTP response
27
- */
28
-require_once 'HTTP/Request2/Response.php';
29
-
30
-/**
31
- * Unit test for HTTP_Request2_Response class
32
- */
33
-class HTTP_Request2_ResponseTest extends PHPUnit_Framework_TestCase
34
-{
35
- /**
36
- *
37
- * @expectedException HTTP_Request2_MessageException
38
- */
39
- public function testParseStatusLine()
40
- {
41
- $response = new HTTP_Request2_Response('HTTP/1.1 200 OK');
42
- $this->assertEquals('1.1', $response->getVersion());
43
- $this->assertEquals(200, $response->getStatus());
44
- $this->assertEquals('OK', $response->getReasonPhrase());
45
-
46
- $response2 = new HTTP_Request2_Response('HTTP/1.2 222 Nishtyak!');
47
- $this->assertEquals('1.2', $response2->getVersion());
48
- $this->assertEquals(222, $response2->getStatus());
49
- $this->assertEquals('Nishtyak!', $response2->getReasonPhrase());
50
-
51
- $response3 = new HTTP_Request2_Response('Invalid status line');
52
- }
53
-
54
- public function testParseHeaders()
55
- {
56
- $response = $this->readResponseFromFile('response_headers');
57
- $this->assertEquals(7, count($response->getHeader()));
58
- $this->assertEquals('PHP/6.2.2', $response->getHeader('X-POWERED-BY'));
59
- $this->assertEquals('text/html; charset=windows-1251', $response->getHeader('cOnTeNt-TyPe'));
60
- $this->assertEquals('accept-charset, user-agent', $response->getHeader('vary'));
61
- }
62
-
63
- public function testParseCookies()
64
- {
65
- $response = $this->readResponseFromFile('response_cookies');
66
- $cookies = $response->getCookies();
67
- $this->assertEquals(4, count($cookies));
68
- $expected = array(
69
- array('name' => 'foo', 'value' => 'bar', 'expires' => null,
70
- 'domain' => null, 'path' => null, 'secure' => false),
71
- array('name' => 'PHPSESSID', 'value' => '1234567890abcdef1234567890abcdef',
72
- 'expires' => null, 'domain' => null, 'path' => '/', 'secure' => true),
73
- array('name' => 'A', 'value' => 'B=C', 'expires' => null,
74
- 'domain' => null, 'path' => null, 'secure' => false),
75
- array('name' => 'baz', 'value' => '%20a%20value', 'expires' => 'Sun, 03 Jan 2010 03:04:05 GMT',
76
- 'domain' => 'pear.php.net', 'path' => null, 'secure' => false),
77
- );
78
- foreach ($cookies as $k => $cookie) {
79
- $this->assertEquals($expected$k, $cookie);
80
- }
81
- }
82
-
83
- /**
84
- *
85
- * @expectedException HTTP_Request2_MessageException
86
- */
87
- public function testGzipEncoding()
88
- {
89
- $response = $this->readResponseFromFile('response_gzip');
90
- $this->assertEquals('0e964e9273c606c46afbd311b5ad4d77', md5($response->getBody()));
91
-
92
- $response = $this->readResponseFromFile('response_gzip_broken');
93
- $body = $response->getBody();
94
- }
95
-
96
- public function testDeflateEncoding()
97
- {
98
- $response = $this->readResponseFromFile('response_deflate');
99
- $this->assertEquals('0e964e9273c606c46afbd311b5ad4d77', md5($response->getBody()));
100
- }
101
-
102
- public function testBug15305()
103
- {
104
- $response = $this->readResponseFromFile('bug_15305');
105
- $this->assertEquals('c8c5088fc8a7652afef380f086c010a6', md5($response->getBody()));
106
- }
107
-
108
- public function testBug18169()
109
- {
110
- $response = $this->readResponseFromFile('bug_18169');
111
- $this->assertEquals('', $response->getBody());
112
- }
113
-
114
- protected function readResponseFromFile($filename)
115
- {
116
- $fp = fopen(dirname(dirname(__FILE__)) . '/_files/' . $filename, 'rb');
117
- $response = new HTTP_Request2_Response(fgets($fp));
118
- do {
119
- $headerLine = fgets($fp);
120
- $response->parseHeaderLine($headerLine);
121
- } while ('' != trim($headerLine));
122
-
123
- while (!feof($fp)) {
124
- $response->appendBody(fread($fp, 1024));
125
- }
126
- return $response;
127
- }
128
-}
129
-?>
130
\ No newline at end of file
131
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/Request2Test.php
Deleted
201
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/** Sets up includes */
23
-require_once dirname(__FILE__) . '/TestHelper.php';
24
-
25
-/**
26
- * Class representing a HTTP request
27
- */
28
-require_once 'HTTP/Request2.php';
29
-
30
-/**
31
- * Unit test for HTTP_Request2 class
32
- */
33
-class HTTP_Request2Test extends PHPUnit_Framework_TestCase
34
-{
35
- public function testConstructorSetsDefaults()
36
- {
37
- $url = new Net_URL2('http://www.example.com/foo');
38
- $req = new HTTP_Request2($url, HTTP_Request2::METHOD_POST, array('connect_timeout' => 666));
39
-
40
- $this->assertSame($url, $req->getUrl());
41
- $this->assertEquals(HTTP_Request2::METHOD_POST, $req->getMethod());
42
- $this->assertEquals(666, $req->getConfig('connect_timeout'));
43
- }
44
-
45
- /**
46
- *
47
- * @expectedException HTTP_Request2_LogicException
48
- */
49
- public function testSetUrl()
50
- {
51
- $urlString = 'http://www.example.com/foo/bar.php';
52
- $url = new Net_URL2($urlString);
53
-
54
- $req1 = new HTTP_Request2();
55
- $req1->setUrl($url);
56
- $this->assertSame($url, $req1->getUrl());
57
-
58
- $req2 = new HTTP_Request2();
59
- $req2->setUrl($urlString);
60
- $this->assertInstanceOf('Net_URL2', $req2->getUrl());
61
- $this->assertEquals($urlString, $req2->getUrl()->getUrl());
62
-
63
- $req3 = new HTTP_Request2();
64
- $req3->setUrl(array('This will cause an error'));
65
- }
66
-
67
- public function testConvertUserinfoToAuth()
68
- {
69
- $req = new HTTP_Request2();
70
- $req->setUrl('http://foo:b%40r@www.example.com/');
71
-
72
- $this->assertEquals('', (string)$req->getUrl()->getUserinfo());
73
- $this->assertEquals(
74
- array('user' => 'foo', 'password' => 'b@r', 'scheme' => HTTP_Request2::AUTH_BASIC),
75
- $req->getAuth()
76
- );
77
- }
78
-
79
- /**
80
- *
81
- * @expectedException HTTP_Request2_LogicException
82
- */
83
- public function testSetMethod()
84
- {
85
- $req = new HTTP_Request2();
86
- $req->setMethod(HTTP_Request2::METHOD_PUT);
87
- $this->assertEquals(HTTP_Request2::METHOD_PUT, $req->getMethod());
88
-
89
- $req->setMethod('Invalid method');
90
- }
91
-
92
- public function testSetAndGetConfig()
93
- {
94
- $req = new HTTP_Request2();
95
- $this->assertArrayHasKey('connect_timeout', $req->getConfig());
96
-
97
- $req->setConfig(array('connect_timeout' => 123));
98
- $this->assertEquals(123, $req->getConfig('connect_timeout'));
99
- try {
100
- $req->setConfig(array('foo' => 'unknown parameter'));
101
- $this->fail('Expected HTTP_Request2_LogicException was not thrown');
102
- } catch (HTTP_Request2_LogicException $e) {}
103
-
104
- try {
105
- $req->getConfig('bar');
106
- $this->fail('Expected HTTP_Request2_LogicException was not thrown');
107
- } catch (HTTP_Request2_LogicException $e) {}
108
- }
109
-
110
- public function testSetProxyAsUrl()
111
- {
112
- $req = new HTTP_Request2();
113
- $req->setConfig('proxy', 'socks5://foo:bar%25baz@localhost:1080/');
114
-
115
- $this->assertEquals('socks5', $req->getConfig('proxy_type'));
116
- $this->assertEquals('localhost', $req->getConfig('proxy_host'));
117
- $this->assertEquals(1080, $req->getConfig('proxy_port'));
118
- $this->assertEquals('foo', $req->getConfig('proxy_user'));
119
- $this->assertEquals('bar%baz', $req->getConfig('proxy_password'));
120
- }
121
-
122
- /**
123
- *
124
- * @expectedException HTTP_Request2_LogicException
125
- */
126
- public function testHeaders()
127
- {
128
- $req = new HTTP_Request2();
129
- $autoHeaders = $req->getHeaders();
130
-
131
- $req->setHeader('Foo', 'Bar');
132
- $req->setHeader('Foo-Bar: value');
133
- $req->setHeader(array('Another-Header' => 'another value', 'Yet-Another: other_value'));
134
- $this->assertEquals(
135
- array('foo-bar' => 'value', 'another-header' => 'another value',
136
- 'yet-another' => 'other_value', 'foo' => 'Bar') + $autoHeaders,
137
- $req->getHeaders()
138
- );
139
-
140
- $req->setHeader('FOO-BAR');
141
- $req->setHeader(array('aNOTHER-hEADER'));
142
- $this->assertEquals(
143
- array('yet-another' => 'other_value', 'foo' => 'Bar') + $autoHeaders,
144
- $req->getHeaders()
145
- );
146
-
147
- $req->setHeader('Invalid header', 'value');
148
- }
149
-
150
- public function testBug15937()
151
- {
152
- $req = new HTTP_Request2();
153
- $autoHeaders = $req->getHeaders();
154
-
155
- $req->setHeader('Expect: ');
156
- $req->setHeader('Foo', '');
157
- $this->assertEquals(
158
- array('expect' => '', 'foo' => '') + $autoHeaders,
159
- $req->getHeaders()
160
- );
161
- }
162
-
163
- public function testRequest17507()
164
- {
165
- $req = new HTTP_Request2();
166
-
167
- $req->setHeader('accept-charset', 'iso-8859-1');
168
- $req->setHeader('accept-charset', array('windows-1251', 'utf-8'), false);
169
-
170
- $req->setHeader(array('accept' => 'text/html'));
171
- $req->setHeader(array('accept' => 'image/gif'), null, false);
172
-
173
- $headers = $req->getHeaders();
174
-
175
- $this->assertEquals('iso-8859-1, windows-1251, utf-8', $headers'accept-charset');
176
- $this->assertEquals('text/html, image/gif', $headers'accept');
177
- }
178
-
179
- /**
180
- *
181
- * @expectedException HTTP_Request2_LogicException
182
- */
183
- public function testCookies()
184
- {
185
- $req = new HTTP_Request2();
186
- $req->addCookie('name', 'value');
187
- $req->addCookie('foo', 'bar');
188
- $headers = $req->getHeaders();
189
- $this->assertEquals('name=value; foo=bar', $headers'cookie');
190
-
191
- $req->addCookie('invalid cookie', 'value');
192
- }
193
-
194
- /**
195
- *
196
- * @expectedException HTTP_Request2_LogicException
197
- */
198
- public function testPlainBody()
199
- {
200
- $req = new HTTP_Request2();
201
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/TestHelper.php
Deleted
53
1
2
-<?php
3
-/**
4
- * Unit tests for HTTP_Request2 package
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-// If running from SVN checkout, update include_path
23
-if ('@' . 'package_version@' == '@package_version@') {
24
- $classPath = realpath(dirname(dirname(__FILE__)));
25
- $includePath = array($classPath);
26
-
27
- foreach (explode(PATH_SEPARATOR, get_include_path()) as $component) {
28
- if (false !== ($real = realpath($component)) && $real !== $classPath) {
29
- $includePath = $real;
30
- }
31
- }
32
-
33
- set_include_path(implode(PATH_SEPARATOR, $includePath));
34
-}
35
-
36
-if (strpos($_SERVER'argv'0, 'phpunit') === false) {
37
- /** Include PHPUnit dependencies based on version */
38
- require_once 'PHPUnit/Runner/Version.php';
39
- if (version_compare(PHPUnit_Runner_Version::id(), '3.5.0', '>=')) {
40
- require_once 'PHPUnit/Autoload.php';
41
- } else {
42
- require_once 'PHPUnit/Framework.php';
43
- }
44
-}
45
-
46
-if (!defined('HTTP_REQUEST2_TESTS_BASE_URL')
47
- && is_readable(dirname(__FILE__) . '/NetworkConfig.php')
48
-) {
49
- require_once dirname(__FILE__) . '/NetworkConfig.php';
50
-}
51
-?>
52
\ No newline at end of file
53
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_files
Deleted
2
1
-(directory)
2
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_files/bug_15305
Deleted
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_files/bug_18169
Deleted
11
1
2
-HTTP/1.1 200 OK
3
-Date: Fri, 01 Jan 2010 02:03:04 GMT
4
-Server: Apache/3.0.1 (Unix)
5
-X-Powered-By: PHP/6.2.2
6
-Content-Type: text/plain; charset=iso-8859-1
7
-Content-Encoding: deflate
8
-Content-Length: 0
9
-Connection: close
10
-
11
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_files/empty.gif
Deleted
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_files/plaintext.txt
Deleted
4
1
2
-This is a test.
3
\ No newline at end of file
4
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_files/response_cookies
Deleted
16
1
2
-HTTP/1.1 200 OK
3
-Date: Fri, 01 Jan 2010 02:03:04 GMT
4
-Server: Apache/3.0.1 (Unix)
5
-X-Powered-By: PHP/6.2.2
6
-Set-Cookie: foo=bar
7
-Set-Cookie: PHPSESSID=1234567890abcdef1234567890abcdef; path=/; secure
8
-Set-Cookie: A=B=C
9
-Set-Cookie: baz=%20a%20value; expires=Sun, 03 Jan 2010 03:04:05 GMT; domain=pear.php.net
10
-Content-Type: text/html; charset=windows-1251
11
-Content-Length: 32
12
-Connection: close
13
-
14
-Nothing to see here, move along.
15
\ No newline at end of file
16
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_files/response_deflate
Deleted
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_files/response_gzip
Deleted
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_files/response_gzip_broken
Deleted
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_files/response_headers
Deleted
15
1
2
-HTTP/1.1 200 OK
3
-Date: Fri, 01 Jan 2010 02:03:04 GMT
4
-Vary: accept-charset
5
-Server: Apache/3.0.1 (Unix)
6
-X-Powered-By: PHP/6.2.2
7
-Vary: user-agent
8
-Content-Type: text/html;
9
- charset=windows-1251
10
-Content-Length: 32
11
-Connection: close
12
-
13
-Nothing to see here, move along.
14
\ No newline at end of file
15
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network
Deleted
2
1
-(directory)
2
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/basicauth.php
Deleted
36
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-$user = isset($_SERVER'PHP_AUTH_USER') ? $_SERVER'PHP_AUTH_USER' : null;
23
-$pass = isset($_SERVER'PHP_AUTH_PW') ? $_SERVER'PHP_AUTH_PW' : null;
24
-$wantedUser = isset($_GET'user') ? $_GET'user' : null;
25
-$wantedPass = isset($_GET'pass') ? $_GET'pass' : null;
26
-
27
-if (!$user || !$pass || $user != $wantedUser || $pass != $wantedPass) {
28
- header('WWW-Authenticate: Basic realm="HTTP_Request2 tests"', true, 401);
29
- echo "Login required";
30
-} else {
31
- echo "Username={$user};Password={$pass}";
32
-}
33
-
34
-?>
35
\ No newline at end of file
36
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/bug19934.php
Deleted
30
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-for ($i = 0; $i < 20; $i++) {
23
- for ($j = 0; $j < 10; $j++) {
24
- echo str_repeat((string)$j, 98) . "\r\n";
25
- }
26
- flush();
27
- usleep(50000);
28
-}
29
\ No newline at end of file
30
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/bug20228.php
Deleted
26
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-header('Transfer-Encoding: chunked');
23
-
24
-echo "e\r\n";
25
-echo "This is a test\r\n";
26
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/cookies.php
Deleted
27
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-ksort($_COOKIE);
23
-echo serialize($_COOKIE);
24
-
25
-?>
26
\ No newline at end of file
27
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/digestauth.php
Deleted
86
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-/**
23
- * Mostly borrowed from PHP manual and Socket Adapter implementation
24
- *
25
- * @link http://php.net/manual/en/features.http-auth.php
26
- */
27
-
28
-/**
29
- * Parses the Digest auth header
30
- *
31
- * @param string $txt
32
- */
33
-function http_digest_parse($txt)
34
-{
35
- $token = '^\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\\?={}\s+';
36
- $quoted = '"(?:\\\\.|^\\\\")*"';
37
-
38
- // protect against missing data
39
- $needed_parts = array_flip(array('nonce', 'nc', 'cnonce', 'qop', 'username', 'uri', 'response'));
40
- $data = array();
41
-
42
- preg_match_all("!({$token})\\s*=\\s*({$token}|{$quoted})!", $txt, $matches);
43
- for ($i = 0; $i < count($matches0); $i++) {
44
- // ignore unneeded parameters
45
- if (isset($needed_parts$matches1$i)) {
46
- unset($needed_parts$matches1$i);
47
- if ('"' == substr($matches2$i, 0, 1)) {
48
- $data$matches1$i = substr($matches2$i, 1, -1);
49
- } else {
50
- $data$matches1$i = $matches2$i;
51
- }
52
- }
53
- }
54
-
55
- return !empty($needed_parts) ? false : $data;
56
-}
57
-
58
-$realm = 'HTTP_Request2 tests';
59
-$wantedUser = isset($_GET'user') ? $_GET'user' : null;
60
-$wantedPass = isset($_GET'pass') ? $_GET'pass' : null;
61
-$validAuth = false;
62
-
63
-if (!empty($_SERVER'PHP_AUTH_DIGEST')
64
- && ($data = http_digest_parse($_SERVER'PHP_AUTH_DIGEST'))
65
- && $wantedUser == $data'username'
66
-) {
67
- // generate the valid response
68
- $a1 = md5($data'username' . ':' . $realm . ':' . $wantedPass);
69
- $a2 = md5($_SERVER'REQUEST_METHOD' . ':' . $data'uri');
70
- $response = md5($a1. ':' . $data'nonce' . ':' . $data'nc' . ':'
71
- . $data'cnonce' . ':' . $data'qop' . ':' . $a2);
72
-
73
- // check valid response against existing one
74
- $validAuth = ($data'response' == $response);
75
-}
76
-
77
-if (!$validAuth || empty($_SERVER'PHP_AUTH_DIGEST')) {
78
- header('WWW-Authenticate: Digest realm="' . $realm .
79
- '",qop="auth",nonce="' . uniqid() . '"', true, 401);
80
- echo "Login required";
81
-} else {
82
- echo "Username={$data'username'}";
83
-}
84
-?>
85
\ No newline at end of file
86
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/download.php
Deleted
48
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-$payload = str_repeat('0123456789abcdef', 128);
23
-
24
-if (array_key_exists('gzip', $_GET)) {
25
- // we inject a long "filename" into the header to check whether the downloader
26
- // can handle an incomplete header in "slowpoke" mode
27
- $payload = pack('c4Vc2', 0x1f, 0x8b, 8, 8, time(), 2, 255)
28
- . str_repeat('a_really_really_long_file_name', 10) . '.txt' . chr(0)
29
- . gzdeflate($payload)
30
- . pack('V2', crc32($payload), 2048);
31
- header('Content-Encoding: gzip');
32
-}
33
-
34
-if (!array_key_exists('slowpoke', $_GET)) {
35
- echo $payload;
36
-
37
-} else {
38
- $pos = 0;
39
- $length = strlen($payload);
40
- while ($pos < $length) {
41
- echo substr($payload, $pos, 65);
42
- $pos += 65;
43
- flush();
44
- usleep(50000);
45
- }
46
-}
47
\ No newline at end of file
48
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/getparameters.php
Deleted
27
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-ksort($_GET);
23
-echo serialize($_GET);
24
-
25
-?>
26
\ No newline at end of file
27
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/incompletebody.php
Deleted
35
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-header('Connection: close');
23
-
24
-if (array_key_exists('chunked', $_GET)) {
25
- header('Transfer-Encoding: chunked');
26
- echo "2A\r\n";
27
-
28
-} else {
29
- header('Content-Length: 42');
30
-}
31
-
32
-echo "This is a test";
33
-flush();
34
\ No newline at end of file
35
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/postparameters.php
Deleted
27
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-ksort($_POST);
23
-echo serialize($_POST);
24
-
25
-?>
26
\ No newline at end of file
27
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/rawpostdata.php
Deleted
25
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-readfile('php://input');
23
-?>
24
\ No newline at end of file
25
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/redirects.php
Deleted
53
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-$redirects = isset($_GET'redirects')? $_GET'redirects': 1;
23
-$https = !empty($_SERVER'HTTPS') && ('off' != strtolower($_SERVER'HTTPS'));
24
-$special = isset($_GET'special')? $_GET'special': null;
25
-
26
-if ('ftp' == $special) {
27
- header('Location: ftp://localhost/pub/exploit.exe', true, 301);
28
-
29
-} elseif ('youtube' == $special) {
30
- header('Location: https://youtube.com/', true, 301);
31
-
32
-} elseif ('relative' == $special) {
33
- header('Location: ./getparameters.php?msg=did%20relative%20redirect', true, 302);
34
-
35
-} elseif ('cookie' == $special) {
36
- setcookie('cookie_on_redirect', 'success');
37
- header('Location: ./cookies.php', true, 302);
38
-
39
-} elseif ($redirects > 0) {
40
- $url = ($https? 'https': 'http') . '://' . $_SERVER'SERVER_NAME'
41
- . (($https && 443 == $_SERVER'SERVER_PORT' || !$https && 80 == $_SERVER'SERVER_PORT')
42
- ? '' : ':' . $_SERVER'SERVER_PORT')
43
- . $_SERVER'PHP_SELF' . '?redirects=' . (--$redirects);
44
- header('Location: ' . $url, true, 302);
45
-
46
-} else {
47
- echo "Method=" . $_SERVER'REQUEST_METHOD' . ';';
48
- var_dump($_POST);
49
- var_dump($_GET);
50
-}
51
-?>
52
\ No newline at end of file
53
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/setcookie.php
Deleted
30
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-$name = empty($_GET'name')? 'foo': $_GET'name';
23
-$value = empty($_GET'value')? 'bar': $_GET'value';
24
-
25
-setcookie($name, $value);
26
-
27
-echo "Cookie set!";
28
-?>
29
\ No newline at end of file
30
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/timeout.php
Deleted
26
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-sleep(5);
23
-
24
-?>
25
\ No newline at end of file
26
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/_network/uploads.php
Deleted
39
1
2
-<?php
3
-/**
4
- * Helper files for HTTP_Request2 unit tests. Should be accessible via HTTP.
5
- *
6
- * PHP version 5
7
- *
8
- * LICENSE
9
- *
10
- * This source file is subject to BSD 3-Clause License that is bundled
11
- * with this package in the file LICENSE and available at the URL
12
- * https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
13
- *
14
- * @category HTTP
15
- * @package HTTP_Request2
16
- * @author Alexey Borzov <avb@php.net>
17
- * @copyright 2008-2016 Alexey Borzov <avb@php.net>
18
- * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19
- * @link http://pear.php.net/package/HTTP_Request2
20
- */
21
-
22
-if (isset($_GET'slowpoke')) {
23
- sleep(3);
24
-}
25
-
26
-if (!empty($_FILES)) {
27
- foreach ($_FILES as $name => $file) {
28
- if (is_array($file'name')) {
29
- foreach($file'name' as $k => $v) {
30
- echo "{$name}{$k} {$v} {$file'type'$k} {$file'size'$k}\n";
31
- }
32
- } else {
33
- echo "{$name} {$file'name'} {$file'type'} {$file'size'}\n";
34
- }
35
- }
36
-}
37
-?>
38
\ No newline at end of file
39
kolab-webadmin-3.2.16.tar.gz/vendor/pear/http_request2/tests/travis-ci-apache
Deleted
27
1
2
-<VirtualHost *:80>
3
- ServerName hr2.local
4
- ServerAlias hr2 www.hr2.local
5
-
6
- DocumentRoot "%TRAVIS_BUILD_DIR%/tests/_network"
7
-
8
- <Directory "%TRAVIS_BUILD_DIR%/tests/_network">
9
- Options FollowSymLinks MultiViews +ExecCGI
10
- AllowOverride All
11
- Order deny,allow
12
- Allow from all
13
- </Directory>
14
-
15
-
16
- # Wire up Apache to use Travis CI's php-fpm.
17
- #<IfModule mod_fastcgi.c>
18
- # AddHandler php5-fcgi .php
19
- # Action php5-fcgi /php5-fcgi
20
- # Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
21
- # FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
22
- #</IfModule>
23
-
24
- ErrorLog "%TRAVIS_BUILD_DIR%/logs/hr2-error.log"
25
- CustomLog "%TRAVIS_BUILD_DIR%/logs/hr2-access.log" combined
26
-</VirtualHost>
27