PHP code example of alex-qiu / sdkit

1. Go to this page and download the library: Download alex-qiu/sdkit library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alex-qiu / sdkit example snippets


use AlexQiu\Sdkit\ServiceContainer;

$config = [
    'http' => [
        'timeout' => 30.0,
    ],
    'logger' => [
        'default' => 'single',
        'channels' => [
            'single' => [
                'driver' => 'single',
                'path' => 'php://stdout',
                'level' => 'debug',
            ],
        ],
    ],
];

$container = new ServiceContainer($config);

use AlexQiu\Sdkit\BaseClient;

$client = new BaseClient($container);
$response = $client->httpGet('https://api.example.com/resource');

$logger = $container->logger;

$logger->info('This is an informational message.');
$logger->error('This is an error message.');