Download the PHP package simonschaufi/typo3-phone without Composer

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

TYPO3 Phone

Donate GitHub Sponsors Buy me a coffee CI Latest Stable Version Total Downloads License TYPO3

Adds phone number functionality to TYPO3 based on the PHP port of libphonenumber by Google.

Installation

Run the following command to install the latest applicable version of the package:

Validation

For each action (here updateAction) you want to validate your object (in this case an Address with two properties "phone" and "fax") add the following code in your controller:

Alternatively you can instantiate the validator anywhere in your code like this:

Note: country codes should be ISO 3166-1 alpha-2 compliant.

To support any valid internationally formatted phone number next to the whitelisted countries, use the international option. This can be useful when you're expecting locally formatted numbers from a specific country but also want to accept any other foreign number entered properly:

The validator will try to extract the country from the number itself and then check if the number is valid for that country. If the country could not be guessed it will be validated using the fallback countries if provided. Note that country guessing will only work when phone numbers are entered in international format (prefixed with a + sign, e.g. +32 ....). Leading double zeros will NOT be parsed correctly as this isn't an established consistency.

To specify constraints on the number type, set the allowed types, e.g.:

The most common types are mobile and fixed_line, but feel free to use any of the types defined here.

You can also enable lenient validation by using the lenient option. With leniency enabled, only the length of the number is checked instead of actual carrier patterns.

Validation outside of Extbase

If you don't want to use the extbase validator and instead a more low level approach, use the following code:

Info: In this case the Address object has a property "country" that is of type \SJBR\StaticInfoTables\Domain\Model\Country

Utility PhoneNumber class

A phone number can be wrapped in the SimonSchaufi\TYPO3Phone\PhoneNumber class to enhance it with useful utility methods. It's safe to directly reference these objects in views or when saving to the database as they will degrade gracefully to the E.164 format.

Formatting

A PhoneNumber can be formatted in various ways:

Number information

Get some information about the phone number:

Equality comparison

Check if a given phone number is (not) equal to another one:

Database considerations

Disclaimer: Phone number handling is quite different in each application. The topics mentioned below are therefore meant as a set of thought starters; support will not be provided.

Storing phone numbers in a database has always been a speculative topic and there's simply no silver bullet. It all depends on your application's requirements. Here are some things to take into account, along with an implementation suggestion. Your ideal database setup will probably be a combination of some of the pointers detailed below.

Uniqueness

The E.164 format globally and uniquely identifies a phone number across the world. It also inherently implies a specific country and can be supplied as-is to the phone() helper.

You'll need:

Example:

Presenting the phone number the way it was inputted

If you store formatted phone numbers the raw user input will irretrievably get lost. It may be beneficial to present your users with their very own inputted phone number, for example in terms of improved user experience.

You'll need:

Example:

Supporting searches

Searching through phone numbers can quickly become ridiculously complex and will always require deep understanding of the context and extent of your application. Here's a possible approach covering quite a lot of "natural" use cases.

You'll need:

Example:

Need help with integrating this extension into your website?

Please contact me via my website: https://www.simonschaufelberger.de/de/kontakt.html and I will help you!

Giving thanks

This extension is heavily inspired by https://github.com/Propaganistas/Laravel-Phone. Thank you!


All versions of typo3-phone with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-json Version *
giggsey/libphonenumber-for-php Version ^7.0 || ^8.0
league/iso3166 Version ^2.0 || ^4.0
simonschaufi/typo3-support Version ^1.0 || ^2.0 || ^3.0
symfony/polyfill-php80 Version ^1.25
typo3/cms-core Version ^10.4 || ^11.5
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 simonschaufi/typo3-phone contains the following files

Loading the files please wait ....