pendalf89/yii2-clientinfo 问题修复 & 功能扩展

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

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

pendalf89/yii2-clientinfo

最新稳定版本:1.0.1

Composer 安装命令:

composer require pendalf89/yii2-clientinfo

包简介

Yii2 client info component, that detects real client IP address and device type

README 文档

README

The component provides a convenient way to retrieve information from the client (user), including the IP address, country, and device. It's very fast thanks to caching. Mobile Detect library is used to determine the type of device. The Sypex Geo database is used to determine the country by IP address.

Installation

The preferred way to install this extension is through composer.

Either run

composer require pendalf89/yii2-clientinfo

or add

"pendalf89/yii2-clientinfo": "^1.0.0"

to the require section of your composer.json file.

Configuration

'components' => [
    'clientInfo' => 'pendalf89\clientinfo\ClientInfo',
],

You also can add DocBlock into Yii.php file for IDE autocompleting.

/**
 * Class WebApplication
 * Include only Web application related components here
 *
 * @property pendalf89\clientinfo\ClientInfo $clientInfo
 */
class WebApplication extends yii\web\Application
{
}

Usage

It's very easy to use:

$isMobile = Yii::$app->clientInfo->isMobile();
$ip = Yii::$app->clientInfo->getIP();
$country = Yii::$app->clientInfo->getCountry();
$isFinland = Yii::$app->clientInfo->isCountry('FI');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固