Download the PHP package ozh/http_build_url without Composer

On this page you can find all versions of the php package ozh/http_build_url. 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 http_build_url

http_build_url() for PHP

Tests Packagist

An implementation of http_build_url(), the URL builder from the pecl_http extension, for environments where that extension isn't installed.

About this fork

The original package, jakeasmith/http_build_url, was abandoned in favor of the URI API built into PHP 8.5. That's good advice for new code, but plenty of existing projects still call http_build_url() and just need it to keep working on modern PHP. So this fork picks up maintenance:

If you are starting fresh on PHP 8.5+, use Uri\Rfc3986\Uri instead; see Modern alternative below.

Install

Usage

$url and $parts are each either a URL string or an associative array in the shape parse_url() returns. The parts of $parts are merged into $url according to $flags. If $new_url is passed, it is filled with the parts of the resulting URL, as parse_url() would return them.

Flags

Constant Effect
HTTP_URL_REPLACE Replace every part given in $parts (default)
HTTP_URL_JOIN_PATH Join the path of $parts onto the path of $url
HTTP_URL_JOIN_QUERY Merge the query strings of $url and $parts
HTTP_URL_STRIP_USER Strip the user
HTTP_URL_STRIP_PASS Strip the password
HTTP_URL_STRIP_AUTH Strip user and password
HTTP_URL_STRIP_PORT Strip the port
HTTP_URL_STRIP_PATH Strip the path
HTTP_URL_STRIP_QUERY Strip the query string
HTTP_URL_STRIP_FRAGMENT Strip the fragment
HTTP_URL_STRIP_ALL Strip everything but scheme and host

Scheme and host given in $parts are always applied, regardless of flags. The constants are defined only if they don't already exist, and use the same values as pecl_http.

Modern alternative

On PHP 8.5+, the built-in URI API covers most of the same ground:

Tests

License

MIT, as the original. See LICENSE.


All versions of http_build_url with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
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 ozh/http_build_url contains the following files

Loading the files please wait ...