laravel-6 support
This commit is contained in:
140
vendor/zendframework/zend-uri/CHANGELOG.md
vendored
140
vendor/zendframework/zend-uri/CHANGELOG.md
vendored
@@ -1,140 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file, in reverse chronological order by release.
|
||||
|
||||
## 2.7.1 - 2019-10-07
|
||||
|
||||
### Added
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Changed
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Deprecated
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Removed
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Fixed
|
||||
|
||||
- [#34](https://github.com/zendframework/zend-uri/pull/34) fixes hostname recognition
|
||||
when port number is not provided. Additional colon is stripped out.
|
||||
|
||||
## 2.7.0 - 2019-02-27
|
||||
|
||||
### Added
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Changed
|
||||
|
||||
- [#29](https://github.com/zendframework/zend-uri/pull/29) changes the behavior of `getHost()`:
|
||||
it will now always return a lowercase representation. This is in accord with
|
||||
[IETF 3986 Section 3.2.2](https://tools.ietf.org/html/rfc3986#section-3.2.2).
|
||||
|
||||
### Deprecated
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Removed
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Nothing.
|
||||
|
||||
## 2.6.2 - 2019-02-26
|
||||
|
||||
### Added
|
||||
|
||||
- [#28](https://github.com/zendframework/zend-uri/pull/28) adds support for PHP 7.3.
|
||||
|
||||
### Changed
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Deprecated
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Removed
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Nothing.
|
||||
|
||||
## 2.6.1 - 2018-04-30
|
||||
|
||||
### Added
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Changed
|
||||
|
||||
- [#23](https://github.com/zendframework/zend-uri/pull/23) updates the zend-validator dependency to the 2.10 series, in order to ensure that
|
||||
this package can run under PHP 7.2.
|
||||
|
||||
### Deprecated
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Removed
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Nothing.
|
||||
|
||||
## 2.6.0 - 2018-04-10
|
||||
|
||||
### Added
|
||||
|
||||
- [#4](https://github.com/zendframework/zend-uri/pull/4) adds and publishes the
|
||||
documentation to https://zendframework.github.io/zend-uri/
|
||||
|
||||
### Deprecated
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Removed
|
||||
|
||||
- [#16](https://github.com/zendframework/zend-uri/pull/16) removes support for
|
||||
PHP 5.5.
|
||||
|
||||
- [#16](https://github.com/zendframework/zend-uri/pull/16) removes support for
|
||||
HHVM.
|
||||
|
||||
### Fixed
|
||||
|
||||
- [#17](https://github.com/zendframework/zend-uri/pull/17) updates the path
|
||||
encoding algorithm to allow `(` and `)` characters as path characters (per
|
||||
the RFC-3986, these are valid sub-delimiters allowed within a path).
|
||||
|
||||
## 2.5.2 - 2016-02-17
|
||||
|
||||
### Added
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Deprecated
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Removed
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Fixed
|
||||
|
||||
- [#3](https://github.com/zendframework/zend-uri/pull/3) updates dependencies to
|
||||
allow the component to work with both PHP 5 and PHP 7 versions, as well as
|
||||
all 2.X versions of required Zend components.
|
||||
27
vendor/zendframework/zend-uri/LICENSE.md
vendored
27
vendor/zendframework/zend-uri/LICENSE.md
vendored
@@ -1,27 +0,0 @@
|
||||
Copyright (c) 2005-2019, Zend Technologies USA, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Zend Technologies USA, Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
27
vendor/zendframework/zend-uri/README.md
vendored
27
vendor/zendframework/zend-uri/README.md
vendored
@@ -1,27 +0,0 @@
|
||||
# zend-uri
|
||||
|
||||
[](https://secure.travis-ci.org/zendframework/zend-uri)
|
||||
[](https://coveralls.io/github/zendframework/zend-uri?branch=master)
|
||||
|
||||
zend-uri aids in manipulating and validating Uniform Resource Identifiers
|
||||
([URIs](http://www.ietf.org/rfc/rfc3986.txt)). zend-uri exists primarily to
|
||||
assist other components, such as zend-http, but is also useful as a standalone
|
||||
utility.
|
||||
|
||||
## Installation
|
||||
|
||||
Run the following to install this library:
|
||||
|
||||
```bash
|
||||
$ composer require zendframework/zend-uri
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
Browse the documentation online at https://docs.zendframework.com/zend-uri/
|
||||
|
||||
## Support
|
||||
|
||||
* [Issues](https://github.com/zendframework/zend-uri/issues/)
|
||||
* [Chat](https://zendframework-slack.herokuapp.com/)
|
||||
* [Forum](https://discourse.zendframework.com/)
|
||||
56
vendor/zendframework/zend-uri/composer.json
vendored
56
vendor/zendframework/zend-uri/composer.json
vendored
@@ -1,56 +0,0 @@
|
||||
{
|
||||
"name": "zendframework/zend-uri",
|
||||
"description": "A component that aids in manipulating and validating \u00bb Uniform Resource Identifiers (URIs)",
|
||||
"license": "BSD-3-Clause",
|
||||
"keywords": [
|
||||
"zf",
|
||||
"zendframework",
|
||||
"uri"
|
||||
],
|
||||
"support": {
|
||||
"docs": "https://docs.zendframework.com/zend-uri/",
|
||||
"issues": "https://github.com/zendframework/zend-uri/issues",
|
||||
"source": "https://github.com/zendframework/zend-uri",
|
||||
"rss": "https://github.com/zendframework/zend-uri/releases.atom",
|
||||
"chat": "https://zendframework-slack.herokuapp.com",
|
||||
"forum": "https://discourse.zendframework.com/c/questions/components"
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.6 || ^7.0",
|
||||
"zendframework/zend-escaper": "^2.5",
|
||||
"zendframework/zend-validator": "^2.10"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4",
|
||||
"zendframework/zend-coding-standard": "~1.0.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Zend\\Uri\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"ZendTest\\Uri\\": "test/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.7.x-dev",
|
||||
"dev-develop": "2.8.x-dev"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"check": [
|
||||
"@cs-check",
|
||||
"@test"
|
||||
],
|
||||
"cs-check": "phpcs",
|
||||
"cs-fix": "phpcbf",
|
||||
"test": "phpunit --colors=always",
|
||||
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @see https://github.com/zendframework/zend-uri for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
|
||||
* @license https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Uri\Exception;
|
||||
|
||||
/**
|
||||
* Exception for Zend\Uri
|
||||
*/
|
||||
interface ExceptionInterface
|
||||
{
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @see https://github.com/zendframework/zend-uri for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
|
||||
* @license https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Uri\Exception;
|
||||
|
||||
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
|
||||
{
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @see https://github.com/zendframework/zend-uri for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
|
||||
* @license https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Uri\Exception;
|
||||
|
||||
/**
|
||||
* Exceptions for Zend\Uri
|
||||
*/
|
||||
class InvalidUriException extends InvalidArgumentException implements ExceptionInterface
|
||||
{
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @see https://github.com/zendframework/zend-uri for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
|
||||
* @license https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Uri\Exception;
|
||||
|
||||
class InvalidUriPartException extends InvalidArgumentException
|
||||
{
|
||||
/**
|
||||
* Part-specific error codes
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
const INVALID_SCHEME = 1;
|
||||
const INVALID_USER = 2;
|
||||
const INVALID_PASSWORD = 4;
|
||||
const INVALID_USERINFO = 6;
|
||||
const INVALID_HOSTNAME = 8;
|
||||
const INVALID_PORT = 16;
|
||||
const INVALID_AUTHORITY = 30;
|
||||
const INVALID_PATH = 32;
|
||||
const INVALID_QUERY = 64;
|
||||
const INVALID_FRAGMENT = 128;
|
||||
}
|
||||
99
vendor/zendframework/zend-uri/src/File.php
vendored
99
vendor/zendframework/zend-uri/src/File.php
vendored
@@ -1,99 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @see https://github.com/zendframework/zend-uri for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
|
||||
* @license https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Uri;
|
||||
|
||||
/**
|
||||
* File URI handler
|
||||
*
|
||||
* The 'file:...' scheme is loosely defined in RFC-1738
|
||||
*/
|
||||
class File extends Uri
|
||||
{
|
||||
protected static $validSchemes = ['file'];
|
||||
|
||||
/**
|
||||
* Check if the URI is a valid File URI
|
||||
*
|
||||
* This applies additional specific validation rules beyond the ones
|
||||
* required by the generic URI syntax.
|
||||
*
|
||||
* @return bool
|
||||
* @see Uri::isValid()
|
||||
*/
|
||||
public function isValid()
|
||||
{
|
||||
if ($this->query) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return parent::isValid();
|
||||
}
|
||||
|
||||
/**
|
||||
* User Info part is not used in file URIs
|
||||
*
|
||||
* @see Uri::setUserInfo()
|
||||
* @param string $userInfo
|
||||
* @return File
|
||||
*/
|
||||
public function setUserInfo($userInfo)
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fragment part is not used in file URIs
|
||||
*
|
||||
* @see Uri::setFragment()
|
||||
* @param string $fragment
|
||||
* @return File
|
||||
*/
|
||||
public function setFragment($fragment)
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a UNIX file path to a valid file:// URL
|
||||
*
|
||||
* @param string $path
|
||||
* @return File
|
||||
*/
|
||||
public static function fromUnixPath($path)
|
||||
{
|
||||
$url = new static('file:');
|
||||
if (0 === strpos($path, '/')) {
|
||||
$url->setHost('');
|
||||
}
|
||||
|
||||
$url->setPath($path);
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a Windows file path to a valid file:// URL
|
||||
*
|
||||
* @param string $path
|
||||
* @return File
|
||||
*/
|
||||
public static function fromWindowsPath($path)
|
||||
{
|
||||
$url = new static('file:');
|
||||
|
||||
// Convert directory separators
|
||||
$path = str_replace(['/', '\\'], ['%2F', '/'], $path);
|
||||
|
||||
// Is this an absolute path?
|
||||
if (preg_match('|^([a-zA-Z]:)?/|', $path)) {
|
||||
$url->setHost('');
|
||||
}
|
||||
|
||||
$url->setPath($path);
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
222
vendor/zendframework/zend-uri/src/Http.php
vendored
222
vendor/zendframework/zend-uri/src/Http.php
vendored
@@ -1,222 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @see https://github.com/zendframework/zend-uri for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
|
||||
* @license https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Uri;
|
||||
|
||||
/**
|
||||
* HTTP URI handler
|
||||
*/
|
||||
class Http extends Uri
|
||||
{
|
||||
/**
|
||||
* @see Uri::$validSchemes
|
||||
*/
|
||||
protected static $validSchemes = [
|
||||
'http',
|
||||
'https'
|
||||
];
|
||||
|
||||
/**
|
||||
* @see Uri::$defaultPorts
|
||||
*/
|
||||
protected static $defaultPorts = [
|
||||
'http' => 80,
|
||||
'https' => 443,
|
||||
];
|
||||
|
||||
/**
|
||||
* @see Uri::$validHostTypes
|
||||
*/
|
||||
protected $validHostTypes = self::HOST_DNS_OR_IPV4_OR_IPV6_OR_REGNAME;
|
||||
|
||||
/**
|
||||
* User name as provided in authority of URI
|
||||
* @var null|string
|
||||
*/
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* Password as provided in authority of URI
|
||||
* @var null|string
|
||||
*/
|
||||
protected $password;
|
||||
|
||||
/**
|
||||
* Get the username part (before the ':') of the userInfo URI part
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the password part (after the ':') of the userInfo URI part
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the User-info (usually user:password) part
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUserInfo()
|
||||
{
|
||||
return $this->userInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the username part (before the ':') of the userInfo URI part
|
||||
*
|
||||
* @param string|null $user
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setUser($user)
|
||||
{
|
||||
$this->user = null === $user ? null : (string) $user;
|
||||
|
||||
$this->buildUserInfo();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the password part (after the ':') of the userInfo URI part
|
||||
*
|
||||
* @param string $password
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setPassword($password)
|
||||
{
|
||||
$this->password = null === $password ? null : (string) $password;
|
||||
|
||||
$this->buildUserInfo();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the URI User-info part (usually user:password)
|
||||
*
|
||||
* @param string|null $userInfo
|
||||
*
|
||||
* @return self
|
||||
*
|
||||
* @throws Exception\InvalidUriPartException If the schema definition does not have this part
|
||||
*/
|
||||
public function setUserInfo($userInfo)
|
||||
{
|
||||
$this->userInfo = null === $userInfo ? null : (string) $userInfo;
|
||||
|
||||
$this->parseUserInfo();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the host part of an HTTP URI
|
||||
*
|
||||
* This overrides the common URI validation method with a DNS or IP only
|
||||
* default. Users may still enforce allowing other host types.
|
||||
*
|
||||
* @param string $host
|
||||
* @param int $allowed
|
||||
* @return bool
|
||||
*/
|
||||
public static function validateHost($host, $allowed = self::HOST_DNS_OR_IPV4_OR_IPV6)
|
||||
{
|
||||
return parent::validateHost($host, $allowed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the user info into username and password segments
|
||||
*
|
||||
* Parses the user information into username and password segments, and
|
||||
* then sets the appropriate values.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function parseUserInfo()
|
||||
{
|
||||
// No user information? we're done
|
||||
if (null === $this->userInfo) {
|
||||
$this->setUser(null);
|
||||
$this->setPassword(null);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// If no ':' separator, we only have a username
|
||||
if (false === strpos($this->userInfo, ':')) {
|
||||
$this->setUser($this->userInfo);
|
||||
$this->setPassword(null);
|
||||
return;
|
||||
}
|
||||
|
||||
// Split on the ':', and set both user and password
|
||||
list($this->user, $this->password) = explode(':', $this->userInfo, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the user info based on user and password
|
||||
*
|
||||
* Builds the user info based on the given user and password values
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function buildUserInfo()
|
||||
{
|
||||
if (null !== $this->password) {
|
||||
$this->userInfo = $this->user . ':' . $this->password;
|
||||
} else {
|
||||
$this->userInfo = $this->user;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the URI port
|
||||
*
|
||||
* If no port is set, will return the default port according to the scheme
|
||||
*
|
||||
* @return int
|
||||
* @see Zend\Uri\Uri::getPort()
|
||||
*/
|
||||
public function getPort()
|
||||
{
|
||||
if (empty($this->port)) {
|
||||
if (array_key_exists($this->scheme, static::$defaultPorts)) {
|
||||
return static::$defaultPorts[$this->scheme];
|
||||
}
|
||||
}
|
||||
return $this->port;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a URI string
|
||||
*
|
||||
* @param string $uri
|
||||
* @return Http
|
||||
*/
|
||||
public function parse($uri)
|
||||
{
|
||||
parent::parse($uri);
|
||||
|
||||
if (empty($this->path)) {
|
||||
$this->path = '/';
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
107
vendor/zendframework/zend-uri/src/Mailto.php
vendored
107
vendor/zendframework/zend-uri/src/Mailto.php
vendored
@@ -1,107 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @see https://github.com/zendframework/zend-uri for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
|
||||
* @license https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Uri;
|
||||
|
||||
use Zend\Validator\EmailAddress as EmailValidator;
|
||||
use Zend\Validator\ValidatorInterface;
|
||||
|
||||
/**
|
||||
* "Mailto" URI handler
|
||||
*
|
||||
* The 'mailto:...' scheme is loosely defined in RFC-1738
|
||||
*/
|
||||
class Mailto extends Uri
|
||||
{
|
||||
protected static $validSchemes = ['mailto'];
|
||||
|
||||
/**
|
||||
* Validator for use when validating email address
|
||||
* @var ValidatorInterface
|
||||
*/
|
||||
protected $emailValidator;
|
||||
|
||||
/**
|
||||
* Check if the URI is a valid Mailto URI
|
||||
*
|
||||
* This applies additional specific validation rules beyond the ones
|
||||
* required by the generic URI syntax
|
||||
*
|
||||
* @return bool
|
||||
* @see Uri::isValid()
|
||||
*/
|
||||
public function isValid()
|
||||
{
|
||||
if ($this->host || $this->userInfo || $this->port) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (empty($this->path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (0 === strpos($this->path, '/')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$validator = $this->getValidator();
|
||||
return $validator->isValid($this->path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the email address
|
||||
*
|
||||
* This is in fact equivalent to setPath() - but provides a more clear interface
|
||||
*
|
||||
* @param string $email
|
||||
* @return Mailto
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
return $this->setPath($email);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the email address
|
||||
*
|
||||
* This is infact equivalent to getPath() - but provides a more clear interface
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->getPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set validator to use when validating email address
|
||||
*
|
||||
* @param ValidatorInterface $validator
|
||||
* @return Mailto
|
||||
*/
|
||||
public function setValidator(ValidatorInterface $validator)
|
||||
{
|
||||
$this->emailValidator = $validator;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve validator for use with validating email address
|
||||
*
|
||||
* If none is currently set, an EmailValidator instance with default options
|
||||
* will be used.
|
||||
*
|
||||
* @return ValidatorInterface
|
||||
*/
|
||||
public function getValidator()
|
||||
{
|
||||
if (null === $this->emailValidator) {
|
||||
$this->setValidator(new EmailValidator());
|
||||
}
|
||||
return $this->emailValidator;
|
||||
}
|
||||
}
|
||||
1371
vendor/zendframework/zend-uri/src/Uri.php
vendored
1371
vendor/zendframework/zend-uri/src/Uri.php
vendored
File diff suppressed because it is too large
Load Diff
123
vendor/zendframework/zend-uri/src/UriFactory.php
vendored
123
vendor/zendframework/zend-uri/src/UriFactory.php
vendored
@@ -1,123 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @see https://github.com/zendframework/zend-uri for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
|
||||
* @license https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Uri;
|
||||
|
||||
/**
|
||||
* URI Factory Class
|
||||
*
|
||||
* The URI factory can be used to generate URI objects from strings, using a
|
||||
* different URI subclass depending on the input URI scheme. New scheme-specific
|
||||
* classes can be registered using the registerScheme() method.
|
||||
*
|
||||
* Note that this class contains only static methods and should not be
|
||||
* instantiated
|
||||
*/
|
||||
abstract class UriFactory
|
||||
{
|
||||
/**
|
||||
* Registered scheme-specific classes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $schemeClasses = [
|
||||
'http' => 'Zend\Uri\Http',
|
||||
'https' => 'Zend\Uri\Http',
|
||||
'mailto' => 'Zend\Uri\Mailto',
|
||||
'file' => 'Zend\Uri\File',
|
||||
'urn' => 'Zend\Uri\Uri',
|
||||
'tag' => 'Zend\Uri\Uri',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register a scheme-specific class to be used
|
||||
*
|
||||
* @param string $scheme
|
||||
* @param string $class
|
||||
*/
|
||||
public static function registerScheme($scheme, $class)
|
||||
{
|
||||
$scheme = strtolower($scheme);
|
||||
static::$schemeClasses[$scheme] = $class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister a scheme
|
||||
*
|
||||
* @param string $scheme
|
||||
*/
|
||||
public static function unregisterScheme($scheme)
|
||||
{
|
||||
$scheme = strtolower($scheme);
|
||||
if (isset(static::$schemeClasses[$scheme])) {
|
||||
unset(static::$schemeClasses[$scheme]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class name for a registered scheme
|
||||
*
|
||||
* If provided scheme is not registered, will return NULL
|
||||
*
|
||||
* @param string $scheme
|
||||
* @return string|null
|
||||
*/
|
||||
public static function getRegisteredSchemeClass($scheme)
|
||||
{
|
||||
if (isset(static::$schemeClasses[$scheme])) {
|
||||
return static::$schemeClasses[$scheme];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a URI from a string
|
||||
*
|
||||
* @param string $uriString
|
||||
* @param string $defaultScheme
|
||||
* @throws Exception\InvalidArgumentException
|
||||
* @return \Zend\Uri\Uri
|
||||
*/
|
||||
public static function factory($uriString, $defaultScheme = null)
|
||||
{
|
||||
if (! is_string($uriString)) {
|
||||
throw new Exception\InvalidArgumentException(sprintf(
|
||||
'Expecting a string, received "%s"',
|
||||
(is_object($uriString) ? get_class($uriString) : gettype($uriString))
|
||||
));
|
||||
}
|
||||
|
||||
$uri = new Uri($uriString);
|
||||
$scheme = strtolower($uri->getScheme());
|
||||
if (! $scheme && $defaultScheme) {
|
||||
$scheme = $defaultScheme;
|
||||
}
|
||||
|
||||
if ($scheme && ! isset(static::$schemeClasses[$scheme])) {
|
||||
throw new Exception\InvalidArgumentException(sprintf(
|
||||
'no class registered for scheme "%s"',
|
||||
$scheme
|
||||
));
|
||||
}
|
||||
if ($scheme && isset(static::$schemeClasses[$scheme])) {
|
||||
$class = static::$schemeClasses[$scheme];
|
||||
$uri = new $class($uri);
|
||||
if (! $uri instanceof UriInterface) {
|
||||
throw new Exception\InvalidArgumentException(
|
||||
sprintf(
|
||||
'class "%s" registered for scheme "%s" does not implement Zend\Uri\UriInterface',
|
||||
$class,
|
||||
$scheme
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $uri;
|
||||
}
|
||||
}
|
||||
241
vendor/zendframework/zend-uri/src/UriInterface.php
vendored
241
vendor/zendframework/zend-uri/src/UriInterface.php
vendored
@@ -1,241 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @see https://github.com/zendframework/zend-uri for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
|
||||
* @license https://github.com/zendframework/zend-uri/blob/master/LICENSE.md New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Uri;
|
||||
|
||||
/**
|
||||
* Interface defining a URI
|
||||
*/
|
||||
interface UriInterface
|
||||
{
|
||||
/**
|
||||
* Create a new URI object
|
||||
*
|
||||
* @param Uri|string|null $uri
|
||||
* @throws Exception\InvalidArgumentException
|
||||
*/
|
||||
public function __construct($uri = null);
|
||||
|
||||
/**
|
||||
* Check if the URI is valid
|
||||
*
|
||||
* Note that a relative URI may still be valid
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isValid();
|
||||
|
||||
/**
|
||||
* Check if the URI is a valid relative URI
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isValidRelative();
|
||||
|
||||
/**
|
||||
* Check if the URI is an absolute or relative URI
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isAbsolute();
|
||||
|
||||
/**
|
||||
* Parse a URI string
|
||||
*
|
||||
* @param string $uri
|
||||
* @return Uri
|
||||
*/
|
||||
public function parse($uri);
|
||||
|
||||
/**
|
||||
* Compose the URI into a string
|
||||
*
|
||||
* @return string
|
||||
* @throws Exception\InvalidUriException
|
||||
*/
|
||||
public function toString();
|
||||
|
||||
/**
|
||||
* Normalize the URI
|
||||
*
|
||||
* Normalizing a URI includes removing any redundant parent directory or
|
||||
* current directory references from the path (e.g. foo/bar/../baz becomes
|
||||
* foo/baz), normalizing the scheme case, decoding any over-encoded
|
||||
* characters etc.
|
||||
*
|
||||
* Eventually, two normalized URLs pointing to the same resource should be
|
||||
* equal even if they were originally represented by two different strings
|
||||
*
|
||||
* @return Uri
|
||||
*/
|
||||
public function normalize();
|
||||
|
||||
/**
|
||||
* Convert the link to a relative link by substracting a base URI
|
||||
*
|
||||
* This is the opposite of resolving a relative link - i.e. creating a
|
||||
* relative reference link from an original URI and a base URI.
|
||||
*
|
||||
* If the two URIs do not intersect (e.g. the original URI is not in any
|
||||
* way related to the base URI) the URI will not be modified.
|
||||
*
|
||||
* @param Uri|string $baseUri
|
||||
* @return Uri
|
||||
*/
|
||||
public function makeRelative($baseUri);
|
||||
|
||||
/**
|
||||
* Get the scheme part of the URI
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getScheme();
|
||||
|
||||
/**
|
||||
* Get the User-info (usually user:password) part
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUserInfo();
|
||||
|
||||
/**
|
||||
* Get the URI host
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getHost();
|
||||
|
||||
/**
|
||||
* Get the URI port
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getPort();
|
||||
|
||||
/**
|
||||
* Get the URI path
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getPath();
|
||||
|
||||
/**
|
||||
* Get the URI query
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getQuery();
|
||||
|
||||
/**
|
||||
* Return the query string as an associative array of key => value pairs
|
||||
*
|
||||
* This is an extension to RFC-3986 but is quite useful when working with
|
||||
* most common URI types
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getQueryAsArray();
|
||||
|
||||
/**
|
||||
* Get the URI fragment
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getFragment();
|
||||
|
||||
/**
|
||||
* Set the URI scheme
|
||||
*
|
||||
* If the scheme is not valid according to the generic scheme syntax or
|
||||
* is not acceptable by the specific URI class (e.g. 'http' or 'https' are
|
||||
* the only acceptable schemes for the Zend\Uri\Http class) an exception
|
||||
* will be thrown.
|
||||
*
|
||||
* You can check if a scheme is valid before setting it using the
|
||||
* validateScheme() method.
|
||||
*
|
||||
* @param string $scheme
|
||||
* @throws Exception\InvalidUriPartException
|
||||
* @return Uri
|
||||
*/
|
||||
public function setScheme($scheme);
|
||||
|
||||
/**
|
||||
* Set the URI User-info part (usually user:password)
|
||||
*
|
||||
* @param string $userInfo
|
||||
* @return Uri
|
||||
* @throws Exception\InvalidUriPartException If the schema definition
|
||||
* does not have this part
|
||||
*/
|
||||
public function setUserInfo($userInfo);
|
||||
|
||||
/**
|
||||
* Set the URI host
|
||||
*
|
||||
* Note that the generic syntax for URIs allows using host names which
|
||||
* are not necessarily IPv4 addresses or valid DNS host names. For example,
|
||||
* IPv6 addresses are allowed as well, and also an abstract "registered name"
|
||||
* which may be any name composed of a valid set of characters, including,
|
||||
* for example, tilda (~) and underscore (_) which are not allowed in DNS
|
||||
* names.
|
||||
*
|
||||
* Subclasses of Uri may impose more strict validation of host names - for
|
||||
* example the HTTP RFC clearly states that only IPv4 and valid DNS names
|
||||
* are allowed in HTTP URIs.
|
||||
*
|
||||
* @param string $host
|
||||
* @throws Exception\InvalidUriPartException
|
||||
* @return Uri
|
||||
*/
|
||||
public function setHost($host);
|
||||
|
||||
/**
|
||||
* Set the port part of the URI
|
||||
*
|
||||
* @param int $port
|
||||
* @return Uri
|
||||
*/
|
||||
public function setPort($port);
|
||||
|
||||
/**
|
||||
* Set the path
|
||||
*
|
||||
* @param string $path
|
||||
* @return Uri
|
||||
*/
|
||||
public function setPath($path);
|
||||
|
||||
/**
|
||||
* Set the query string
|
||||
*
|
||||
* If an array is provided, will encode this array of parameters into a
|
||||
* query string. Array values will be represented in the query string using
|
||||
* PHP's common square bracket notation.
|
||||
*
|
||||
* @param string|array $query
|
||||
* @return Uri
|
||||
*/
|
||||
public function setQuery($query);
|
||||
|
||||
/**
|
||||
* Set the URI fragment part
|
||||
*
|
||||
* @param string $fragment
|
||||
* @return Uri
|
||||
* @throws Exception\InvalidUriPartException If the schema definition
|
||||
* does not have this part
|
||||
*/
|
||||
public function setFragment($fragment);
|
||||
|
||||
/**
|
||||
* Magic method to convert the URI to a string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString();
|
||||
}
|
||||
Reference in New Issue
Block a user