From Authentication to Objects
<?php //Includes the CloudFiles PHP API.. Ensure the API files are located in your Global includes folder or in the same directory require('cloudfiles.php'); //Now lets create a new instance of the authentication Class. $auth = new CF_Authentication('UsernameGoesHere','APIKeyGoesHere'); //Calling the Authenticate method returns a valid storage token and allows you to connect to the CloudFiles Platform. $auth->authenticate(); //The Connection Class Allows us to connect to CloudFiles and make changes to containers; Create, Delete, Return existing containers. $conn = new CF_Connection($auth); //Lets go ahead and create container. $cont = $conn->create_container('PutContainerNameHere'); //Now lets make a new Object $obj = $cont->create_object('PutObjectNameHere'); //Now lets put some stuff into the Object =) $obj->write('LetsPutSomeDataHere'); ?>
© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License