2 require_once __DIR__ .
'/../src/HPCloud/Bootstrap.php';
4 use \HPCloud\Bootstrap;
5 Bootstrap::useAutoloader();
6 Bootstrap::useStreamWrappers();
8 $ini = parse_ini_file(getenv(
'HOME') .
'/.hpcloud.ini');
10 'account' =>
$ini[
'account'],
11 'key' =>
$ini[
'secret'],
12 'tenantid' =>
$ini[
'tenantId'],
13 'endpoint' =>
$ini[
'url'],
18 $newfile = fopen(
'swift://Example/my_file.txt',
'w');
23 if (file_exists(
'swift://Example/my_file.txt')) {
24 print
"Found my_file.txt." .
PHP_EOL;
28 $file = file_get_contents(
'swift://Example/my_file.txt');
31 $cxt = stream_context_create(array(
33 'account' =>
$ini[
'account'],
34 'key' =>
$ini[
'secret'],
35 'tenantid' =>
$ini[
'tenantId'],
36 'endpoint' =>
$ini[
'url'],
40 print file_get_contents(
'swift://Example/my_file.txt', FALSE,
$cxt);