Dodo
DOm DOcument implementation
Loading...
Searching...
No Matches
Wikimedia\Dodo\URL Class Reference

URL. More...

Public Member Functions

string __construct (string $url='')
 
bool isAbsolute ()
 XXX: not sure if this is the precise definition of absolute.
 
bool isAuthorityBased ()
 
bool isHierarchical ()
 
string toString ()
 
string resolve ( $relative)
 

Static Public Member Functions

static percent_encode (string $s)
 Return a percentEncoded version of s.
 
static merge (URL $basepath, URL $refpath)
 
static remove_dot_segments ( $path)
 

Public Attributes

string null $scheme = null
 
string null $host = null
 
string null $port = null
 
string null $username = null
 
string null $password = null
 
string null $path = null
 
string null $query = null
 
string null $fragment = null
 
 $hostname = null
 
 $pathname = null
 
 $search = null
 
 $searchParams = null
 
 $hash = null
 

Detailed Description

URL.

TODO: This is currently NOT implementing https://url.spec.whatwg.org/#api, but it could, and probably should.

TODO: Should probably lean heavily on existing PHP URL-parsing functions? -forbid-undeclared-magic-properties

Constructor & Destructor Documentation

◆ __construct()

string Wikimedia\Dodo\URL::__construct ( string $url = '')
Parameters
string$url

Member Function Documentation

◆ isAbsolute()

bool Wikimedia\Dodo\URL::isAbsolute ( )

XXX: not sure if this is the precise definition of absolute.

Returns
bool

◆ isAuthorityBased()

bool Wikimedia\Dodo\URL::isAuthorityBased ( )
Returns
bool

◆ isHierarchical()

bool Wikimedia\Dodo\URL::isHierarchical ( )
Returns
bool

◆ merge()

static Wikimedia\Dodo\URL::merge ( URL $basepath,
URL $refpath )
static
Parameters
URL$basepath
URL$refpath
Returns
string|URL

◆ percent_encode()

static Wikimedia\Dodo\URL::percent_encode ( string $s)
static

Return a percentEncoded version of s.

S should be a single-character string XXX: needs to do utf-8 encoding?

Parameters
string$s
Returns
string

◆ remove_dot_segments()

static Wikimedia\Dodo\URL::remove_dot_segments ( $path)
static
Parameters
string | null$path
Returns
string|null only null if $path was null, otherwise a string

◆ resolve()

string Wikimedia\Dodo\URL::resolve ( $relative)

◆ toString()

string Wikimedia\Dodo\URL::toString ( )
Returns
string

Member Data Documentation

◆ $fragment

string null Wikimedia\Dodo\URL::$fragment = null

◆ $host

string null Wikimedia\Dodo\URL::$host = null

◆ $password

string null Wikimedia\Dodo\URL::$password = null

◆ $path

string null Wikimedia\Dodo\URL::$path = null

◆ $port

string null Wikimedia\Dodo\URL::$port = null

◆ $query

string null Wikimedia\Dodo\URL::$query = null

◆ $scheme

string null Wikimedia\Dodo\URL::$scheme = null

◆ $username

string null Wikimedia\Dodo\URL::$username = null

The documentation for this class was generated from the following file: