kshabazz/slib
最新稳定版本:3.0.1
Composer 安装命令:
composer require kshabazz/slib
包简介
A collection of useful functions to aid developing.
README 文档
README
This is a library with some tools to aid in performing common task.
Examples:
How to use the HttpClient object to make an HTTP Request
<?php use \Kshabazz\Slib\HttpClient; // Initialize a new HTTP client object. $httpClient = new HttpClient(); $url = 'http://www.example.com'; // Set headers // Please note that the same header can be set multiple times, just like in the HTTP RFC. $httpClient->setHeaders([ 'Content-Type: application/json; charset=utf-8', 'Custom-Header: custom value', ]); // Make a request and check the response. $httpClient->send( $url ); $responseCode = $http->responseCode(); if ( $responseCode === 200 ) { echo $httpClient->responseBody(); } else { // DEBUG // Show what was sent in the last request. var_dump( $httpClient->lastRequest() ); // Show the response headers. var_dump( $httpClient->responseHeaders() ); } ?>
Functions
<?php echo \Kshabazz\Slib\camelCase( 'test-me' ); // Output: TestMe echo \Kshabazz\Slib\camelCase( 'test-me', TRUE ); // Output: testMe ?>
统计信息
- 总下载量: 126
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-03-31