1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-10 09:26:15 +00:00
Greg Ross 6e86c48486 Updated phone formatter (#241)
* Add locale and libphonenumber libraries.

* Update country code information

Updated existing country codes, fixed incorrect NANP codes for member countries (as well as several UK based ones).

Also added in Country Name to ISO country code mapping array for use with libphonenumber.

* Convert phone number formatting to use libphonenumber

libphonenumber parses phone number more consistantly than the old regex's that mismatched number on a regular basis.
2018-06-26 09:49:22 +02:00
..
2018-06-26 09:49:22 +02:00
2018-06-26 09:49:22 +02:00
2018-06-26 09:49:22 +02:00
2018-06-26 09:49:22 +02:00
2018-06-26 09:49:22 +02:00
2018-06-26 09:49:22 +02:00
2018-06-26 09:49:22 +02:00
2018-06-26 09:49:22 +02:00
2018-06-26 09:49:22 +02:00
2018-06-26 09:49:22 +02:00

Locale Build Status Coverage Status StyleCI

Total Downloads Latest Stable Version License

A library providing up to date CLDR. Primarily as a requirement of libphonenumber-for-php.

Reasoning

This was created because libphonenumber-for-php required the intl extension to use the Geo Coder. The extension is not installed by default, and can be a hurdle for users. It also relies on the CLDR data provided by the Operating System, which is quite often out of date.

Generating data

Data is compiled from the latest CLDR Data as specified in CLDR-VERSION.txt.

A Phing task is used to compile the data from JSON into native PHP arrays.

It is not normally needed to compile the data, as this repository will always have the up to date CLDR data. To manually compile the data, ensure you have all the dependencies installed, then run:

vendor/bin/phing compile