Problems with OpenCloud \ Rackspace PHP

I'm having trouble trying to get the Rackspace Opencloud API to work as expected (especially cloud files).

I follow these guides:

https://github.com/rackspace/php-opencloud/blob/master/docs/userguide/ObjectStore/Access.md http://docs.rackspace.com/sdks/api/php/namespace-OpenCloud.ObjectStore.html

Authentication works fine because the token and service catalog are returned.

header("Content-Type: text/plain");
require '/vendor/autoload.php';

use OpenCloud\Rackspace;

$client = new Rackspace('https://lon.identity.api.rackspacecloud.com/v2.0/', array(
    'username' => 'MY_USERNAME',
    'apiKey'   => 'MY_APIKEY'
));

$client->authenticate();

echo 'Authenticated with token: '.$client->getToken()."\n\n";

print_r($client->getCatalog());

My problems begin when I try to use the service from the API:

$service = $client->objectStoreService('cloudFiles');

This line kills the code. I copied the Rackspace documentation line for the line, but I still got out of luck, I can't get any services to work.

Can someone see where I am wrong, or give any advice on how to best fix this problem?

+4
1

, . , , LON.

$service = $client->objectStoreService('cloudFiles', 'LON'); # Or IAD, HKG, SYD, etc.

. php-opencloud, .

+6

All Articles