PHP code example of luguoit / tencent-wrappers

1. Go to this page and download the library: Download luguoit/tencent-wrappers 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/ */

    

luguoit / tencent-wrappers example snippets



$client = new ExtendedFilesystem(
            new ExtendedCosAdapter(
                new CosClient($config["access_key"],$config["access_secret"],$config["region"]),
                $config["bucket"]
            )
);



$client->has("202212081440_000_6");
$client->put("t001.txt","111");
$a = $client->write("t002.txt","111");
$a = $client->writeStream("t_stream.txt",fopen("README.md","r"));
$a = $client->copy("t_stream.txt","t_stream2.txt");
$a = $client->delete( "t_stream2.txt");
$a = $client->read( "t001.txt");
print_r($a);

$fh = $client->readStream( "202212081440_000_6");
while (!feof($fh)) {
    print_r(fgets($fh));
}