kaankilic/serverup
Composer 安装命令:
composer require kaankilic/serverup
包简介
Server Uptime Checker Tool
README 文档
README
Basic useful Server Uptime and connection checker tool.
Installation
You can install the package via composer:
composer require kaankilic/serverup
or require the tool in your composer.json file.
"kaankilic/serverup": "^2.0"
then run composer install command from your command line.
Once ServerUp is installed you need to register the service provider.Open up config/app.php and add the provider key of tool.
'providers' => array( ... Kaankilic\ServerUp\Providers\ServerUpServiceProvider::class, )
After that, you need to register the facade in the aliases key of your config/app.php file.
'aliases' => array( ... aliases 'ServerUp'=> Kaankilic\ServerUp\Facades\ServerUp::class, )
Finally, from the command line again, publish the default configuration file:
php artisan vendor:publish --provider="Kaankilic\ServerUp\Providers\ServerUpServiceProvider"
Usage
Simple Usage
ServerUp::ping("http://facebook.com",80); ServerUp::getIsTotalyAvail(); //returns boolean value
Advanced Usage
You must define Hostname and Port values for the ping values.Then, you can get availibility of ip or domain with ping() facades. Example code is on the below:
ServerUp::setHostname("http://facebook.com"); ServerUp::setPort(80); ServerUp::setSampleAmount(50); ServerUp::setTimeoutDuration(10); // unit is integer based milliseconds ServerUp::getIsTotalyAvail(); //returns boolean value var_dump(ServerUp::ping()); //returns the SocketResponses for each ping request
统计信息
- 总下载量: 59
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-09