I am using composer package 'rackspace/php-opencloud' installed with
composer require rackspace/php-opencloud
and trying to upload and get the list of files inside the folder
included the autoload file and add
require 'vendor/autoload.php';
using the process given on document http://docs.php-opencloud.com/en/latest/services/object-store/index.html but I do not get the solution to access the folders inside a container(recipes in my case). How can I upload the files into the directory "images" and "uploads" present inside container "recipes".
$client = new OpenCloud\OpenStack('{keystoneUrl}', array(
'username' => '{username}',
'password' => '{apiKey}',
'tenantId' => '{tenantId}',
));
$service = $client->objectStoreService('{catalogName}', '{region}', '{urlType}');
$containers = $service->listContainers();
foreach ($containers as $container) {
/** @param $container OpenCloud\ObjectStore\Resource\Container */
printf("Container name: %s\n", $container->name);
printf("Number of objects within container: %d\n", $container->getObjectCount());
}
By the above code, I am able to access the the list of container and I can set the container and can fetch the list of
$containers = $service->listContainers();
** @param $container OpenCloud\ObjectStore\Resource\Container */
$container = $service->getContainer('{containerName}');