PHP code example of myena / php-rgw-api

1. Go to this page and download the library: Download myena/php-rgw-api 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/ */

    

myena / php-rgw-api example snippets


$config = new \MyENA\RGW\Config([
    'address'   => '',
    'adminPath' => '',
    'apiKey'    => '',
    'apiSecret' => '',
]);
$client = new \MyENA\RGW\Client($config, new \MyENA\RGW\Signature\V2Signature());

[$users, $err] = $client->Metadata()->User()->List()->execute();
if (null !== $err) {
    die((string)$err);
}
var_dump($users);

// and whatever else you wanna do...

$config = new \MyENA\RGW\Config([
    'address'   => '',  // REQUIRED
    'apiKey'    => '',  // REQUIRED
    'apiSecret' => '',  // REQUIRED

    'adminPath'     => '',  // optional, whatever your admin ops path is

    'silent' => false // optional, silences all logging
]);
json
{
  "na/php-rgw-api": "4.*"
  }
}