xplo.re Medusa Core Framework 3.1
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Authentication
  • Authentication_Token
  • Autoloader
  • Cache
  • Charset
  • ClassDescriptor
  • Closure
  • Controller
  • Converter
  • Date
  • Decoder
  • Delegate
  • Dispatcher
  • Encoder
  • Env
  • Env_Field
  • Env_File
  • Env_FileList
  • Env_Request
  • Env_SERVER
  • Exchange
  • Fault
  • Field
  • Filter
  • Filter_Value
  • Formatter
  • Hash
  • IP
  • Loader
  • Locale
  • Locale_Iterator
  • Locale_Node
  • Log
  • Module
  • Module_Iterator
  • Nothing
  • Object
  • OS
  • Plugin
  • Profiler
  • Query
  • Registry
  • Resource
  • Server
  • Session
  • Session_Token
  • Set
  • Storage
  • Storage_Result
  • Storage_Statement
  • Stream
  • String
  • Translation
  • URI
  • URI_Parameters
  • UUID
  • Value
  • Version
  • View

Interfaces

  • Accessor
  • Chainable
  • Comparable
  • Configurable
  • Equality
  • Identity
  • Inquiry
  • Masquerade
  • Mutator
  • SeekableStream
  • Storable
  • Variator

Exceptions

  • Exception

Constants

  • Copyright
  • ProductName
  • UseVersion
  • Version

Functions

  • ns_expand
  • ns_file_exists
  • ns_get_version
  • ns_resolve

Class URI

Represents an immutable uniform resource identifier (URI).

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\URI

Direct known subclasses

Core\URI\Driver\mailto, Core\URI\URL

Indirect known subclasses

Core\URI\Driver\file, Core\URI\Driver\ftp, Core\URI\Driver\http, Core\URI\Driver\ssl, Core\URI\Driver\tcp

Namespace: Core
Package: Core\URI
Link: http://www.ietf.org/rfc/rfc2396.txt
Since: 3.0
Requires: PHP 5.3
Version: 1.1
Located at URI.inc.php

Methods summary

public
# __construct( string|array|Core\URI $resource, array $mods = null )

Initialises a URI instance.

Initialises a URI instance.

Parameters

$resource

Properties to initialise URI with. Supports the following types of initialisation data:

  • URI string to parse and read properties from.

  • Reference to an existing URI instance to clone properties from.

  • Hash of URI properties to initialise new instance with.

$mods

Hash of URI properties that overwrite properties derived from the resource parameter. This is mainly used to create modified URI instances based on an existing URI and a delta set.

Since

3.0
public static Core\URI
# autocreate( string|Core\URI $uri, array $mods = null )

Creates an URI object specific to an URI scheme. If no specific URI driver for the scheme exists, a basic URI object is returned.

Creates an URI object specific to an URI scheme. If no specific URI driver for the scheme exists, a basic URI object is returned.

Parameters

$uri

URI string to create URI object from or reference to an existing URI instance to clone.

$mods

Hash of URI properties that overwrite properties derived from the URI parameter.

Returns

Core\URI

Since

3.0
public static string
# decode( string $string )

Decodes an encoded URI component string.

Decodes an encoded URI component string.

Parameters

$string
URI component string to decode.

Returns

string
Decoded URI component string.

Since

3.0
public static string
# encode( string|array $data, string $keyName = null, string $delimiter = null, string $valueDelimiter = null )

Encodes a string as an URI component or URI parameter key-value pairs.

Encodes a string as an URI component or URI parameter key-value pairs.

Parameters

$data

String to encode for being used as an URI component or a hash of key-value parameter pairs.

$keyName

Optional. Key name to create an URI conform parameter pair. If the data argument is an array, this value is used for all elements of the hash.

$delimiter

Optional. Separator string for key-value pairs. If null, the default URI_Parameters::DefaultParameterDelimiter is used.

$valueDelimiter

Optional. Separator string for key and value fragments. If null, the default URI_Parameters::DefaultValueDelimiter is used.

Returns

string
Encoded URI-conform component string.

See

URI_Parameters::DefaultParameterDelimiter
URI_Parameters::DefaultValueDelimiter

Since

3.0
public static Core\URI
# remoteURIForPath( string $pathName_ = null )

Returns an URI object for the remote URL of a local file or path.

Returns an URI object for the remote URL of a local file or path.

Parameters

$pathName_

Optional. Local path or filename. If omitted, the application root URL is returned.

Returns

Core\URI

Reference to URI instance for remote application URL of the resolved path or file.

Since

3.0
public string
# __toString( )

Returns the URI string representation of this URI.

Returns the URI string representation of this URI.

Returns

string
URI string of this URI.

Since

3.0

Overrides

Core\Object::__toString
public Core\URI
# cloneWithAppendedParameters( array $parameters = null, string $delimiter = null, string $valueDelimiter = null )

Creates a clone of this URI with a set of added parameters. If the provided parameters array is empty or null, a reference to this instance is returned instead, as URI instances are per default immutable.

Creates a clone of this URI with a set of added parameters. If the provided parameters array is empty or null, a reference to this instance is returned instead, as URI instances are per default immutable.

Parameters

$parameters

Hash or parameters to add. If a parameter defined in the hash is already set on this URI, the parameter in the cloned URI will be overwritten with the provided value. If the provided value is null, the parameter is removed in the cloned URI.

$delimiter

Optional. Separator string for key-value pairs. If null, the default URI_Parameters::DefaultParameterDelimiter is used.

$valueDelimiter

Optional. Separator string for key and value fragments. If null, the default URI_Parameters::DefaultValueDelimiter is used.

Returns

Core\URI

Clone of this instance that differs in an added set of parameters or reference to this instance, if no parameters were provided.

See

URI_Parameters::DefaultParameterDelimiter
URI_Parameters::DefaultValueDelimiter

Since

3.1
public boolean
# isAbsolute( )

Indicates, whether this URI is absolute.

Indicates, whether this URI is absolute.

A URI is considered absolute, if and only if the scheme part is not empty.

An URI may be absolute even though the described resource path is not. This method only returns whether the URI itself as defined by RFC 2396 is absolute regardless of its components.

Returns

boolean
true, if this URI is absolute, otherwise false.

Since

3.0
public Core\URI_Parameters
# parameters( string $delimiter = null, string $valueDelimiter = null )

Returns reference to URI parameters instance specific to this URI and the provided parameter and value delimiters.

Returns reference to URI parameters instance specific to this URI and the provided parameter and value delimiters.

Parses parameter sets are cached, hence multiple calls to this method using the same delimiters is safe.

Parameters

$delimiter

Optional. PCRE expression or single character defining delimiter(s) between query parameters. Expansion is optimised for single character delimiters that are exactly a single byte wide. For multi-byte delimiters a PCRE expression should be used. If null, the default URI_Parameters::DefaultParameterDelimiter is used.

$valueDelimiter

Optional. Separator string for key and value fragments. If null, the default URI_Parameters::DefaultValueDelimiter is used.

Returns

Core\URI_Parameters

Reference to URI parameters instance specific to this URI and the provided parameter and value delimiters.

See

Core\URI_Parameters

Since

3.1
public boolean
# validate( & $report = null )

Validates URI parts according to RFC 2396.

Validates URI parts according to RFC 2396.

Parameters

$report
reference that is assigned per-part validation results.

Returns

boolean

false, if at least one URI part is not valid according to RFC 2396, otherwise true.

Link

http://www.ietf.org/rfc/rfc2396.txt

Since

3.0
protected
# _parseArray( array $parts )

Assigns known array fields to URI part KVC fields.

Assigns known array fields to URI part KVC fields.

Parameters

$parts
Hash of URI parts.

Since

3.0
protected
# _parseURI( $uri )

Parses URI parts from a URI string.

Parses URI parts from a URI string.

Parameters

$uri
string to parse.

Since

3.0

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), attachMethod(), chain(), getValueForKey(), getValueForKeyPath(), getValueForUndefinedKey(), hash(), issetValueForKey(), setValueForKey(), setValueForKeyPath(), setValueForUndefinedKey(), uuid()

Constants summary

Constants inherited from Core\Object

AnyParameterType, AutochainParameterType, AutocreateParameterType, BooleanParameterType, CharParameterType, EnumParameterType, IntegerParameterType, RealParameterType, StringParameterType, UserParameterType

Properties summary

protected string $_v_scheme

KVC property.

KVC property.

Since

3.0
#
protected string $_v_schemeNS

KVC property.

KVC property.

Since

3.1
#
protected string $_v_authority

KVC property.

KVC property.

Since

3.0
#
protected string $_v_path

KVC property.

KVC property.

Since

3.0
#
protected string $_v_query

KVC property.

KVC property.

Since

3.0
#
protected string $_v_fragment

KVC property.

KVC property.

Since

3.0
#
protected array $_parameterCache

Cache for created parameter instances identified by field and value delimiters for optimised parameter retrieval; URIs are immutable, hence the query part does not change and caching has no side effects.

Cache for created parameter instances identified by field and value delimiters for optimised parameter retrieval; URIs are immutable, hence the query part does not change and caching has no side effects.

# array ()

Magic properties

public read-only string $scheme

Scheme part of this URI. The scheme is the alphanumeric part prior to the first double colon, for example »http« in a typical link. If the URI is relative, the scheme is null.

public read-only string $schemeNS

Scheme namespace part. This is a Core-specific extension to standard URI parsing: If the URI scheme contains a dot, the scheme is split into a scheme namespace and a scheme part. This extension allows to describe inter-library driver class relations such as views in the Application namespace. If the URI does not contain a scheme part or no scheme namespace is defined, the scheme namespace is null.

public read-only string $authority

Authority of this URI. If the URI starts with a double-slash after the scheme part, the authority is the part between the double-slash and the first following slash. For URLs this usually denotes the server. Defaults to null If no authority is present.

public read-only string $path

Path part of this URI. The path is the string between the authority and query parts of the URI. Default to null if no path is present.

public read-only string $query

Query part of this URI without question mark. A query is the URI component following the first question mark and ends in an optional hash mark. A query usually contains several parameters provided as key-value pairs. Standard URIs either use an ampersand or a semicolon to separate key-value pairs, key and values are usually separated by an equality sign. See Core\URI::parameters() for details on parsing query strings. If no query is present, the value defaults to null.

public read-only string $fragment

Fragment part of this URI without hash character. The fragment is the tail of a URI following an optional hash, for example HTML anchors. Defaults to null, if no fragment is present.

public read-only boolean $isAbsolute

Indicates, whether the URI is absolute. See Core\URI::isAbsolute() for details.

public read-only Core\URI_Parameters $parameters

Hash of URI parameters using default delimiters. See Core\URI::parameters() for details.

Magic properties inherited from Core\Object

$hash, $uuid

xplo.re Medusa Core Framework 3.1 API documentation generated by ApiGen