Download the PHP package in2code/ipandlanguageredirect without Composer

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

TYPO3 Extension ipandlanguageredirect

TYPO3 FE visitor automatic or manual redirect to another language or another root page.

Introduction

This extension allows multi-language and multi-domain handling with redirects to best fitting pages with best fitting language based on the visitors browser language and region (IP-Address).

An AJAX-request (VanillaJS only - no JavaScript framework is needed) will handle the serverside-domain-logic to redirect or suggest a new webpage or a new language.

Define in your PHP-configuration which countries belongs to which pagetree and which browserlanguage belongs to which frontend language

In short words

Automaticly redirect or show a note for the visitor to give him the best fitting website version for his/her needs.

Screens

Example suggest message in frontend:

Which way is used to get the country code of the user?

This is completely your choice now. You can choose between different ip2country service classes. There is a local table with ip-ranges and countries on the one hand and on the other hand, you can also use external services to convert the visitors ip to a countryCode. While the first methods respects all privacy the second method is more current of course.

Or: You can combine different methods: Because the service of IpApi is for free for 1000 requests a month, you can use this and in addition the offline-table variant.

Available classes per default:

Go to the extension manager settings and choose the classes that you want to use or simply add your own service. Example string in the extension manager settings for ipToCountryService could be In2code\Ipandlanguageredirect\Domain\Service\IpToCountry\IpApi,In2code\Ipandlanguageredirect\Domain\Service\IpToCountry\LocalDatabase to use the service of IpApi as long as it is free and then fall back to the local database.

What's the difference to other extensions like rmpl_language_detect?

There is a basic difference in the concept. While most of the language-redirect extensions hook into the page rendering process via USER_INT, we choose an ansynchronical way with JavaScript and PHP (AJAX). This solution needs JavaScript on the one hand but is much faster for high availability and more complex websites on the other hand. This means: You can use e.g. staticfilecache or another static solution to improve web performance. While it's not possible to use staticfilecache with a USER_INT, which is included on every single page.

Testing!

This extension allows you to test how your website will react if a visitor from a different country checks out your website. See below for a lot of testings possibilities.

Installation

Example configuration

TypoScript

If you add the static TypoScript, this lines have an effect:

Testing

Simulate browserlanguage, country and referrer

Note: Be aware that this settings are cached by default. So you have to always add a &no_cache=1

Don't redirect or suggest but show the redirectUri in the browserconsole

Example answer from your server:

FAQ

Routing example:

Your Contribution

Pull requests are welcome in general! Nevertheless please don't forget to add a description to your pull requests. This is very helpful to understand what kind of issue the PR is going to solve.

Contribution with ddev

Requirements

  1. Install ddev, see: https://ddev.readthedocs.io/en/stable/#installation
  2. Install git-lfs, see: https://git-lfs.github.com/

Installation

  1. Clone this repository
  2. Run ddev start
  3. Run ddev initialize to setup configurations and test database

What's not (yet?) possible at the moment

Changelog

Version Date State Description Note
5.2.1 2023-04-23 Bugfix Bugfix for correct constraints
5.2.0 2023-04-20 Feabure Support for TYPO3 12
5.1.2 2023-06-12 Security Fix a possible SQL injection
5.1.1 2023-02-07 Bugfix Fixed undefined array key exception in PHP 8
5.1.0 2022-07-12 Task Css and frontend toolchain update
5.0.0 2022-04-08 Task Update for TYPO3 11 (9 and 10 support is dropped now)
4.0.1 2021-11-22 Task Define extension key in composer.json file
4.0.0 2020-12-31 Task Update for TYPO3 9 and 10
3.1.0 2020-02-07 Task Small update: Move ext icon to Public, clean composer.json, doc update
3.0.1 2019-08-06 Bugfix Don't use a configuration of a wrong rootpage
3.0.0 !!! 2019-07-05 Feature Do actions based on user agent (disable redirect for google page speed) Update your configuration
2.2.0 2019-04-26 Task Support language handling in TYPO3 9, small documentation fixes
2.1.0 2019-01-10 Task Small cleanup, small text changes
2.0.0 !!! 2018-10-18 Feature Multi domain handling, actionOnHomeOnly, offline ip2geo, stayOnCurrentPage Update your configuration
1.8.0 2018-08-23 Task Add extension icon, add some documentation
1.7.2 2018-01-21 Task Allow ipapi key now without &key=
1.7.1 2018-01-16 Bugfix Don't send "null" for an IP-address value if not testvalue is given
1.7.0 2017-09-25 Feature Support paid variant of IpApi.co for more then 1000 visitors a day
1.6.4 2017-08-11 Bugfix Fix header output in TYPO3 8
1.6.3 2017-07-28 Bugfix Disable cHash check for AJAX requests in T3 8
1.6.2 2017-07-12 Bugfix Fix small typo in composer.json
1.6.1 2017-04-12 Bugfix Fix getting browserlanguage from chrome
1.6.0 2017-02-04 Feature Redirection should be only once in a session
1.5.3 2017-02-01 Bugfix Make code readable for PHP 5.5
1.5.2 2017-01-31 Task Remove unused typoscript
1.5.1 2017-01-26 Bugfix Avoid JS exception if state == none
1.5.0 2017-01-25 Feature New option to disable functions for a pagetree
1.4.1 2016-11-15 Task Semantic code cleanup for HTML and CSS
1.4.0 2016-11-15 Feature Semantic code cleanup for HTML and CSS
1.3.0 2016-11-07 Feature Hide suggest message on GET parameter
1.2.0 2016-11-03 Feature Allow hideMessage on multi-links now
1.1.0 2016-11-01 Feature Add testing features
1.0.0 2016-11-01 Initial Initial release

All versions of ipandlanguageredirect with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
typo3/cms-core Version ^11.5 || ^12.4
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 in2code/ipandlanguageredirect contains the following files

Loading the files please wait ....