kshabazz / slib
This package is abandoned and no longer maintained.
No replacement package was suggested.
There is no license information available for the latest version (3.0.1) of this package.
A collection of useful functions to aid developing.
3.0.1
2018-12-29 19:57 UTC
Requires
- php: >=7.2
- guzzlehttp/guzzle: ^6.0
- psr/http-message: ^1.0
- psr/log: ^1.0
Requires (Dev)
- phpmd/phpmd: ^2.0
- phpstan/phpstan: ^0.10.3
- phpunit/phpunit: ^7.0
- squizlabs/php_codesniffer: ^2.0
Suggests
- ext-pdo: *
This package is auto-updated.
Last update: 2022-04-26 23:19:11 UTC
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 ?>