Download the PHP package exteon/uri without Composer

On this page you can find all versions of the php package exteon/uri. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package uri

exteon/uri

Provides a set of objects for parsing, composing and manipulating URIs

Parsing an URI string:

Generating an URI string:

Note

The magic __toString() method is not implemented, I find its meaning to be semantically inconsistent so use the explicit toString().

URI manipulation

Note

Uri objects are not immutable; make sure you clone where appropriate before performing manipulation.

Setters

You can use setScheme(), setUser(), setPass(), setHost(), setPort(), setPath(), setQueryString(), setFragment() setters to modify an URI.

Base and relative urls, composition

The Uri object can be used to combine relative URIs to a base URI:

The converse to composeWithBase() is applyRelative(), which is perfectly symmetrical when run on the base URI with a relative URI as parameter.

A relative URL can also be derived from an absolute URL and a base URL:

Note

Uri will allow parsing and generate relative empty-scheme URIs of the form ://host/path, which are not allowed by RFC 3986 but are a regular occurence in browser urls to specify 'same protocol as browsed page'.

Note

Be mindful about trailing / in paths; the library uses the browser composition algorithm: a relative url of bar composed with base urls foo and foo/ will yield bar and foo/bar respectively. The exception to this is the UnixPathUri.

ascend() and descend()

While not present in RFC 3986, it has become quite ubiquitous that the path component of an URI is a trail of hierarchically organized components separated by /. To serve this convention, all URI objects implement the ascend() and descend() functions.

Note

When using ascend(), the resulting URI will always be considered a directory and have the trailing slash.

Note

When using descend(), the Web convention, applying the descending path to the URI directory, as in the example above. Because a/b does not include a trailing slash, the directory part is a/ to which c/d is applied.

The exception to the above described behavior is the UnixPathUri.

PHP URIs

With Uri, the query string is not assigned any special meaning. You can use the PHPUri object to parse and generate PHP query strings:

Note

PHP's http_build_query() silently discards keys for NULL values in query string aggregation. For consistency's sake, you must explicitly handle null values. For this PHPUri provides two helper methods: nullValuesToEmptyString() and nullValuesUnset() (the default PHP behavior) which you can use on the query before passing to the constructor or setQuery(). If an array with null values is passed to setQuery(), an InvalidArgumentException will be thrown.

Unix path URIs

The UnixPathUri models an URI that can only have a path part (no scheme, host, query string, fragment). They can be composed just like the Web URIs, but with a quite important different convention:

For UnixPathUri, getDirectory() and getPath() represent the same resource even if the URI does not have a trailing slash.

Example:

This has implications on the way relative URIs are applied and derived. For instance:

In a more intuitive way, the UnixPathUri URI type acts just like a Unix shell path, and the relative URIs act just like running a cd command on the base URI. Special path fragments like . and .. are obviously not implemented, you can use the ascend() method to model going to an upper dir.

UnixPathUri can be combined with other types of URIs (i.e. a relative UnixPathUri can be combined with a root web Uri via Uri::applyRelative()) resulting in a full Web Uri.


All versions of uri with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package exteon/uri contains the following files

Loading the files please wait ....