Can’t return the amount of objects in a container?


I am attempting to return the amount of objects in a container. When loading the page it shows only the bit of text ‘number of objects: ‘ and no number.

No errors show when loading the page, its connecting to the cloud and the container name is correct too.



 // cloud info
 $username = "username"; 
 $key = "key"; 

 // Connect to Rackspace
 $auth = new CF_Authentication($username, $key);
 $conn = new CF_Connection($auth);
 $files = $conn->get_container("containername");
 print "Number of Objects: ". $files->count ."\n";


$c =$ conn->get_container(“my_container”);

object_count and bytes_used should give you the two attributes you are looking for.

Rackspace Secrets

Leave a Reply

Your email address will not be published. Required fields are marked *