PHP code example of tvision / rackspace-cloud-files-bundle

1. Go to this page and download the library: Download tvision/rackspace-cloud-files-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tvision / rackspace-cloud-files-bundle example snippets

 ini
[php-opencloud]
    git=git://github.com/rackspace/php-opencloud.git
    target=/rackspace/php-opencloud

[RackspaceCloudFilesBundle]
    git=https://github.com/tvision/RackspaceCloudFilesBundle.git
    target=/bundles/Tvision/RackspaceCloudFilesBundle

[RackspaceCloudFilesStreamWrapper]
    git=https://github.com/tvision/RackspaceCloudFilesStreamWrapper.git
    target=tvision-rackspace-cloud-files-streamwrapper

 php
$loader->registerNamespaces(array(
    //other namespaces
    'Tvision\\RackspaceCloudFilesStreamWrapper' =>  __DIR__.'/../vendor/tvision-rackspace-cloud-files-streamwrapper/src',
    'Tvision\\RackspaceCloudFilesBundle'        =>  __DIR__.'/../vendor/bundles',
  ));

 php
public function registerBundles()
{
    return array(
        //other bundles
        new Tvision\RackspaceCloudFilesBundle\TvisionRackspaceCloudFilesBundle(),
    );
    ...
 php

 class AppKernel extends Kernel
 {
     public function registerBundles()
     {
         $bundles = array(
         // ...
            new Tvision\RackspaceCloudFilesBundle\TvisionRackspaceCloudFilesBundle(),
         // ...

 php
$auth = $this->get('tvision_rackspace_cloud_files.service')
 php
$conn = $this->get('tvision_rackspace_cloud_files.service');
$container = $conn->apiGetContainer('container-name');
 php
$container = $this->get('tvision_rackspace_cloud_files.service')->apiGetContainer('container-name');

echo "<pre>";
printf("Container %s has %d object(s) consuming %d bytes\n",
    $container->name, $container->count, $container->bytes);
echo "</pre>";