URL related components
Namespace: Sphp \ Network
Uniform Resource Locator (URL)
A Uniform Resource Locator (URL) is a reference to a resource that specifies its
location on a computer network and a mechanism for retrieving it. Every HTTP URL
conforms to the syntax of a generic URI.[1]
The generic URI syntax consists of a hierarchical sequence of components referred
to as the scheme, authority, path, query, and fragment.
[2]
URI
=
scheme
":"
["//"
authority
]
path
["?"
query
]
["#"
fragment
]
authority
=
[
userinfo
"@"]
host
[":"
port
]
userinfo
=
user
":"
pass
URL component manipulation:
scheme: scheme - e.g. http(s)
URL::getScheme() | URL::setScheme() | URL::containsScheme()
authority: optional component
userinfo:
An optional userinfo subcomponent. Providing user information directly
in HTTP URLs is not recommended. Use other methods to avoid for example semantic URL attacks.
[3]
user: optional component
URL::getUsername() | URL::setUsername() | URL::containsUsername()
pass: optional component
URL::getPassword() | URL::setPassword() | URL::containsPassword()
host: A host subcomponent, consisting of either a registered
name (including but not limited to a hostname) or an IP address.
[4]
URL::getHost() | URL::setHost() | URL::containsHost()
port: An optional port subcomponent
URL::getPort() | URL::setPort() | URL::containsPort()
path: A path component, consisting of a sequence of path segments separated by a slash
URL::getPath() | URL::setPath() | URL::containsPath()
query: An optional query component impemented by QueryString
fragment: An optional fragment component
URL::getFragment() | URL::setFragment() | URL::containsFragment()
Error Class "PHPStan\PhpDocParser\Parser\TypeParser" not found code: 0 file: /home3/fjlpxeha/playground.samiholck.fi/vendor/phpdocumentor/type-resolver/src/TypeResolver.php line: 232 Trace information file: /home3/fjlpxeha/playground.samiholck.fi/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php
line: 137
class: phpDocumentor\Reflection\TypeResolver
instance method: __construct
file: /home3/fjlpxeha/playground.samiholck.fi/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php
line: 60
class: phpDocumentor\Reflection\DocBlock\StandardTagFactory
static method: createInstance
file: /home3/fjlpxeha/playground.samiholck.fi/sphp/php/Sphp/Documentation/Reflection/Utils/DocBlockParser.php
line: 37
class: phpDocumentor\Reflection\DocBlockFactory
static method: createInstance
file: /home3/fjlpxeha/playground.samiholck.fi/sphp/php/Sphp/Documentation/Reflection/Signatures/MagicMethodViewBuilder.php
line: 35
class: Sphp\Documentation\Reflection\Utils\DocBlockParser
instance method: __construct
file: /home3/fjlpxeha/playground.samiholck.fi/sphp/php/Sphp/Documentation/Reflection/Signatures/ClassViewBuilder.php
line: 48
class: Sphp\Documentation\Reflection\Signatures\MagicMethodViewBuilder
instance method: __construct
file: /home3/fjlpxeha/playground.samiholck.fi/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php
line: 125
class: Sphp\Documentation\Reflection\Signatures\ClassViewBuilder
instance method: __construct
file: /home3/fjlpxeha/playground.samiholck.fi/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php
line: 55
class: DI\Definition\Resolver\ObjectCreator
instance method: createInstance
file: /home3/fjlpxeha/playground.samiholck.fi/vendor/php-di/php-di/src/Definition/Resolver/ResolverDispatcher.php
line: 62
class: DI\Definition\Resolver\ObjectCreator
instance method: resolve
file: /home3/fjlpxeha/playground.samiholck.fi/vendor/php-di/php-di/src/Container.php
line: 360
class: DI\Definition\Resolver\ResolverDispatcher
instance method: resolve
file: /home3/fjlpxeha/playground.samiholck.fi/vendor/php-di/php-di/src/Container.php
line: 142
class: DI\Container
instance method: resolveDefinition
file: /home3/fjlpxeha/playground.samiholck.fi/manual-app/content/docs/sphp-network-url.inc
line: 54
class: DI\Container
instance method: get
file: /home3/fjlpxeha/playground.samiholck.fi/manual-app/app/commonmark.php
line: 79
function: include
arguments: '/home3/fjlpxeha/playground.samiholck.fi/manual-app/content/docs/sphp-network-url.inc' file: /home3/fjlpxeha/playground.samiholck.fi/manual-app/content/docs/sphp-network.php
line: 17
class: Man\Routers\ManualPageBuilder
instance method: {closure:/home3/fjlpxeha/playground.samiholck.fi/manual-app/app/commonmark.php:73}
file: /home3/fjlpxeha/playground.samiholck.fi/manual-app/app/php/classes/Man/Routers/ManualPageBuilder.php
line: 68
function: include
arguments: '/home3/fjlpxeha/playground.samiholck.fi/manual-app/content/docs/sphp-network.php' file: /home3/fjlpxeha/playground.samiholck.fi/manual-app/app/php/classes/Man/Routers/ManualPageBuilder.php
line: 43
class: Man\Routers\ManualPageBuilder
instance method: parse
class: Man\Routers\ManualPageBuilder
instance method: __invoke
file: /home3/fjlpxeha/playground.samiholck.fi/sphp/php/Sphp/Router/Router.php
line: 150
function: call_user_func
file: /home3/fjlpxeha/playground.samiholck.fi/manual-app/app/php/loaders.php
line: 32
class: Sphp\Router\Router
instance method: execute
file: /home3/fjlpxeha/playground.samiholck.fi/index.php
line: 7
function: require_once
arguments: '/home3/fjlpxeha/playground.samiholck.fi/manual-app/app/php/loaders.php' Query string
A query string is a part of a uniform resource locator (URL) that assigns values
to specified parameters. A query string commonly includes fields added to a base
URL by a Web browser or other client application, for example as part of an HTML
document, choosing the appearance of a page, or jumping to positions in multimedia
content.
[5]
QueryString parameter manipulation:
Parameters can also be manipulated using ArrayAccess interface
Error Class "PHPStan\PhpDocParser\Parser\TypeParser" not found code: 0 file: /home3/fjlpxeha/playground.samiholck.fi/vendor/phpdocumentor/type-resolver/src/TypeResolver.php line: 232 Trace information file: /home3/fjlpxeha/playground.samiholck.fi/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php
line: 137
class: phpDocumentor\Reflection\TypeResolver
instance method: __construct
file: /home3/fjlpxeha/playground.samiholck.fi/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php
line: 60
class: phpDocumentor\Reflection\DocBlock\StandardTagFactory
static method: createInstance
file: /home3/fjlpxeha/playground.samiholck.fi/sphp/php/Sphp/Documentation/Reflection/Utils/DocBlockParser.php
line: 37
class: phpDocumentor\Reflection\DocBlockFactory
static method: createInstance
file: /home3/fjlpxeha/playground.samiholck.fi/sphp/php/Sphp/Documentation/Reflection/Signatures/MagicMethodViewBuilder.php
line: 35
class: Sphp\Documentation\Reflection\Utils\DocBlockParser
instance method: __construct
file: /home3/fjlpxeha/playground.samiholck.fi/sphp/php/Sphp/Documentation/Reflection/Signatures/ClassViewBuilder.php
line: 48
class: Sphp\Documentation\Reflection\Signatures\MagicMethodViewBuilder
instance method: __construct
file: /home3/fjlpxeha/playground.samiholck.fi/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php
line: 125
class: Sphp\Documentation\Reflection\Signatures\ClassViewBuilder
instance method: __construct
file: /home3/fjlpxeha/playground.samiholck.fi/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php
line: 55
class: DI\Definition\Resolver\ObjectCreator
instance method: createInstance
file: /home3/fjlpxeha/playground.samiholck.fi/vendor/php-di/php-di/src/Definition/Resolver/ResolverDispatcher.php
line: 62
class: DI\Definition\Resolver\ObjectCreator
instance method: resolve
file: /home3/fjlpxeha/playground.samiholck.fi/vendor/php-di/php-di/src/Container.php
line: 360
class: DI\Definition\Resolver\ResolverDispatcher
instance method: resolve
file: /home3/fjlpxeha/playground.samiholck.fi/vendor/php-di/php-di/src/Container.php
line: 142
class: DI\Container
instance method: resolveDefinition
file: /home3/fjlpxeha/playground.samiholck.fi/manual-app/content/docs/sphp-network-querystring.inc
line: 32
class: DI\Container
instance method: get
file: /home3/fjlpxeha/playground.samiholck.fi/manual-app/app/commonmark.php
line: 79
function: include
arguments: '/home3/fjlpxeha/playground.samiholck.fi/manual-app/content/docs/sphp-network-querystring.inc' file: /home3/fjlpxeha/playground.samiholck.fi/manual-app/content/docs/sphp-network.php
line: 18
class: Man\Routers\ManualPageBuilder
instance method: {closure:/home3/fjlpxeha/playground.samiholck.fi/manual-app/app/commonmark.php:73}
file: /home3/fjlpxeha/playground.samiholck.fi/manual-app/app/php/classes/Man/Routers/ManualPageBuilder.php
line: 68
function: include
arguments: '/home3/fjlpxeha/playground.samiholck.fi/manual-app/content/docs/sphp-network.php' file: /home3/fjlpxeha/playground.samiholck.fi/manual-app/app/php/classes/Man/Routers/ManualPageBuilder.php
line: 43
class: Man\Routers\ManualPageBuilder
instance method: parse
class: Man\Routers\ManualPageBuilder
instance method: __invoke
file: /home3/fjlpxeha/playground.samiholck.fi/sphp/php/Sphp/Router/Router.php
line: 150
function: call_user_func
file: /home3/fjlpxeha/playground.samiholck.fi/manual-app/app/php/loaders.php
line: 32
class: Sphp\Router\Router
instance method: execute
file: /home3/fjlpxeha/playground.samiholck.fi/index.php
line: 7
function: require_once
arguments: '/home3/fjlpxeha/playground.samiholck.fi/manual-app/app/php/loaders.php' References