Download the PHP package siment/module-http-header-theme-switch without Composer

On this page you can find all versions of the php package siment/module-http-header-theme-switch. 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 module-http-header-theme-switch

siment/module-http-header-theme-switch

Build status

Build Status Code Climate Test Coverage Issue Count

Magento 2 module that enables automatic theme switching based on X-UA-Device header. (Or any other header)

What does this module do?

This module makes sure that Magento's design exceptions logic checks the value of the header "X-UA-Device" in addition to "User-Agent" when determining what theme it should use. You can also configure it to listen to other headers than the pre-configured "X-UA-Device" header.

Why this module?

Short version

Because many web proxies, like Varnish, suggest to use the "X-UA-Device" header for device detection and Magento should respect it.

Longer version

Magento 2 allows for theme switching based on design exceptions which enables "you to specify an alternative theme for particular user-agents".

There are hundreds of user agents out there now and it makes it challenging to correctly identify which agents are coming from mobile, tablet and desktop devices.

There are great libraries for making detection easier - like the generic mobiledetect/mobiledetectlib and the excellent Magento module eadesignro/module-mobiledetect. Those modules will not work out of the box if you have a web proxy like Varnish installed.

That is why I wanted to use the Varnish Mobile Detect module which sends the "X-UA-Device" header from Varnish for device detection rather than tampering with the "User-Agent" header.

How to install

In Magento root:

Configuration

In Magento admin:

Stores -> (Settings) Configuration -> General -> Design -> HTTP Header Theme Switch -> HTTP Header:

HTTP header which will be matched for theme exceptions in addition to the standard header "User-Agent". Standard value is "HTTP_X_UA_DEVICE"

You define the matching rules under Content -> (Design) Configuration -> (Select a theme) Edit -> User Agent Rules

How to test

Make sure the Composer dependencies have been installed and that the "post-install-cmd" scripts have executed.

In module directory:

How to contribute

Create an issue or a pull request.

Changelog

See CHANGELOG.md

License


All versions of module-http-header-theme-switch with dependencies

PHP Build Version
Package Version
Requires magento/framework Version ~100.1.0
magento/module-store Version ~100.1.0
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 siment/module-http-header-theme-switch contains the following files

Loading the files please wait ....