PHP code example of linuzilla / ncucc-coreapi

1. Go to this page and download the library: Download linuzilla/ncucc-coreapi 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/ */

    

linuzilla / ncucc-coreapi example snippets



NCUCC\CoreAPI\Client;
use NCUCC\CoreAPI\APIException;

$config_file = "config.json";
$config = json_decode(file_get_contents($config_file));

$coreapi = new Client($config);

try {
	$coreapi->some_api_function();
} catch (NCUCC\CoreAPI\APIException $e) {
	echo 'Caught exception: ',  $e->getMessage(), "\n";
}
bash
php composer.phar