2017 © Pedro Peláez
 

library default-device-connector

PHP connector to default device service

image

godsdev/default-device-connector

PHP connector to default device service

  • Monday, February 29, 2016
  • by GodsDev
  • Repository
  • 1 Watchers
  • 0 Stars
  • 207 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

default-device-connector

PHP connector for defauldevice service, (*1)

For security (not revealing files that SHOULD NOT be accessed through browser) mod_alias.c SHOULD be enabled in the directory where this library lives., (*2)

Usage:, (*3)

$deviceInfo = new GodsDev\DefaultDeviceConnector\DefaultDeviceConnector(); //may be initiated with non default latest API URL
var_dump($deviceInfo->request());
var_dump($deviceInfo->getMarkup());

Method request()

Returns either array with device properties (and sets $deviceInfo->properties to the same value) or returns false and puts details into $deviceInfo->error, (*4)

Note: workaround before default device API can process it directly: 'Device-Stock-UA' takes precedence before 'X-OperaMini-Phone-UA' takes precedence before 'HTTP_USER_AGENT'., (*5)

Method getMarkup()

Returns one of strings * html5 (which is default even in case of API call error) * desktop * xhtml, (*6)

Method setCharacteristics(array $characteristics)

Sets arbitrarily the values to request the default device API with., (*7)

'user_agent' key MUST be present., (*8)

'x-wap-profile', 'accept', 'x-operamini-phone-ua', 'device-stock-ua' keys MAY be present., (*9)

Method defaultCharacteristics()

Populates the values to request the default device API with according to the current HTTP headers., (*10)

Is called automatically by the *__constructor*., (*11)

The Versions

29/02 2016

dev-master

9999999-dev

PHP connector to default device service

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar GodsDev

29/02 2016

v1.0.4

1.0.4.0

PHP connector to default device service

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar GodsDev

22/02 2016

v1.0.3

1.0.3.0

PHP connector to default device service

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar GodsDev

11/02 2016

1.0.2

1.0.2.0

Connector to default device service

  Sources   Download

The Requires

  • php >=5.3.0

 

by Avatar GodsDev