godsdev/default-device-connector 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

godsdev/default-device-connector

Composer 安装命令:

composer require godsdev/default-device-connector

包简介

PHP connector to default device service

README 文档

README

PHP connector for defauldevice service

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.

Usage:

$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

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'.

Method getMarkup()

Returns one of strings

  • html5 (which is default even in case of API call error)
  • desktop
  • xhtml

Method setCharacteristics(array $characteristics)

Sets arbitrarily the values to request the default device API with.

'user_agent' key MUST be present.

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

Method defaultCharacteristics()

Populates the values to request the default device API with according to the current HTTP headers.

Is called automatically by the __constructor.

统计信息

  • 总下载量: 226
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-02-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固