PHP Classes

Writing variables to cloud

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  Writing variables to cloud  
Subject:Writing variables to cloud
Summary:I am trying to write variables to a cloud container
Messages:1
Author:Richard Fogal
Date:2011-12-04 16:36:21
Update:2012-06-10 22:48:25
 

  1. Writing variables to cloud   Reply   Report abuse  
Picture of Richard Fogal Richard Fogal - 2012-06-10 22:48:25
Here is the code:
//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');

I need to write files where it says 'LetsPutSomeDataHere'. Any advice?