定制 dyanakiev/mylarinfocustom 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dyanakiev/mylarinfocustom

Composer 安装命令:

composer require dyanakiev/mylarinfocustom

包简介

Display system information (IP address, OS, versions) for Laravel.

README 文档

README

Build Status Total Download Latest Stable Version

Larinfo provide system information for Laravel 5.x application. It show IP address information for host and client, server software versions, and hardware information.

Installation

To install using Composer, just run this command below.

For Laravel > 5.6

composer require matriphe/larinfo

For Laravel < 5.6

composer require matriphe/larinfo:1.0.2

For Laravel 5.0, 5.1, 5.2, 5.3, and 5.4

Open the config/app.php and add this line in providers section.

Matriphe\Larinfo\LarinfoServiceProvider::class,

Still on config/app.php file, add this line in aliases section.

'Larinfo' => Matriphe\Larinfo\LarinfoFacade::class,

For Laravel > 5.5

Nothing to do. It uses Laravel's package auto discovery.

Usage

To get all info, use facade Larinfo and call the getInfo() method. It will return this array example.

use Larinfo;

$larinfo = Larinfo::getInfo();

If you don't want to use facade, just create the implementation of Matriphe\Larinfo\Larinfo class.

use Matriphe\Larinfo\Larinfo;

$larinfo = (new Larinfo())->getInfo();

Result of that command is shown below.

$larinfo = [
   'host'=> [
       'city'=> '104.20.8.94',
       'country'=> 'US',
       'hostname'=> '',
       'ip'=> '104.20.8.94',
       'loc'=> '37.7697,-122.3933',
       'org'=> 'AS13335 Cloudflare, Inc.',
       'phone'=> '',
       'postal'=> '94107',
       'region'=> ''
   ],
   'client'=> [
       'city'=> 'Bekasi',
       'country'=> 'ID',
       'hostname'=> '',
       'ip'=> '180.252.202.108',
       'loc'=> '-6.2349,106.9896',
       'org'=> 'AS17974 PT Telekomunikasi Indonesia',
       'phone'=> '',
       'postal'=> '',
       'region'=> ''
   ],
   'server'=> [
       'software'=> [
           'os'=> 'Darwin (macOS 10.12.6 )',
           'distro'=> '',
           'kernel'=> '16.7.0',
           'arc'=> 'x86_64',
           'webserver'=> 'nginx/1.12.0',
           'php'=> '7.0.20'
       ],
       'hardware'=> [
           'cpu'=> 'Intel® Core™ i5-3210M CPU @ 2.50GHz',
           'cpu_count'=> 4,
           'model'=> 'MacBook Pro',
           'virtualization'=> '',
           'ram'=> [
               'total'=> 8589934592,
               'free'=> 8578883584
           ],
           'swap'=> [
               'total'=> 4294967296,
               'free'=> 747110400
           ],
           'disk'=> [
               'total'=> 754593608704,
               'free'=> 265534066688
           ]
       ],
       'uptime'=> [
           'uptime'=> '4 days, 8 hours, 38 seconds',
           'booted_at'=> '2017-07-28 07:12:21'
       ]
   ],
   'database'=> [
       'driver'=> 'MySQL',
       'version'=> '5.7.18'
   ]
]

Other method you can use are:

  • getHostIpinfo to get host IP info (Larinfo::getHostIpinfo())
  • getClientIpinfo to get client IP info (Larinfo::getClientIpinfo())
  • getServerInfoSoftware to get server software info (Larinfo::getServerInfoSoftware())
  • getServerInfoHardware to get server hardware info (Larinfo::getServerInfoHardware())
  • getUptime to get server uptime (Larinfo::getUptime())
  • getServerInfo to get server info (Larinfo::getServerInfo())
  • getDatabaseInfo to get database info (Larinfo::getDatabaseInfo())

Config

IP information is taken using ipinfo.io service. If you've registered and has token access, put your token in the config/services.php in ipinfo variable.

'ipinfo' => [
	'token'  => 'your_ipinfo_token',
],

If you don't want to hit ipinfo.io rate limit, you can cache it using Laravel built-in cache.

License

The GPLv3 License. Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2020-10-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固