Download the PHP package phil/address without Composer

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

phil/address

Postal addresses checked and written the way each country writes them.

phil/address holds a postal address as a value object and knows the address format of each country. A format gives the order of the fields, the ones the country requires, the pattern of its postal codes, what it calls its states and its towns, and its lines in its own script. The library knows subdivisions down to three levels, with their local names. AddressValidator checks an address against its country: missing or unused fields, postal codes, unknown subdivisions. AddressFormatter writes it for a page or for a postal label. SchemaOrg gives a PostalAddress, and AddressArray an array for one JSON column. It does not geocode, autocomplete, or check that a street exists.

It is for any application that takes addresses from more than one country: a shop that ships abroad, a directory of places, an event's venue. A single set of fields with a "state" and a "ZIP code" fits one country badly and the others worse. Here, a Québec address and a Japanese one each follow their own rules.

It is a plain PHP library, usable in any PHP code. In a Symfony application, reach for phil/address-bundle, which adds a form that follows the country chosen, a validation constraint, a Doctrine column type and Twig filters.

The formats and subdivisions are those of commerceguys/addressing, imported as PHP files by the library's own DataImporter. The library reads those files at run time and never depends on commerceguys/addressing. Country names come from symfony/intl, in every language it has.

Status

Part State
Address, AddressField, AddressFormat, AddressFormats Implemented and tested
Subdivision, Subdivisions: three levels, local names Implemented and tested
AddressValidator: required, unused, postal codes, subdivisions Implemented and tested
AddressFormatter: lines, local formats, postal labels Implemented and tested
SchemaOrg: a schema.org PostalAddress Implemented and tested
AddressArray; DataImporter and the data of commerceguys/addressing v2.3.2 Implemented and tested

Documentation

Document What it covers
Installation Requirements and installing.
Addresses and formats Address, the fields, each country's format.
Subdivisions States, provinces, cities and districts, and their names.
Checking and writing AddressValidator, AddressFormatter, schema.org, storage.
Data Where the data come from, their licence, and updating them.
Extension points The ports, arguments and data an application chooses or replaces.
Testing The library's tests and mutation bar.
Reference Every type of the library, with its role.

Quick start

Requirements

PHP 8.5 or later with ext-mbstring; symfony/intl 8.2.

Contributing

Contributions are welcome on the PHIL monorepo: read the contribution guide and the security policy explains, never in a public issue.

License

MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See NOTICE and data/LICENSE.


All versions of address with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
ext-mbstring Version *
symfony/intl Version ^8.2
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 phil/address contains the following files

Loading the files please wait ...