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

1. Go to this page and download the library: Download liuggio/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/ */

    

liuggio / rackspace-cloud-files-bundle example snippets


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

[RackspaceCloudFilesBundle]
    git=https://github.com/liuggio/RackspaceCloudFilesBundle.git
    target=/bundles/Liuggio/RackspaceCloudFilesBundle

[RackspaceCloudFilesStreamWrapper]
    git=https://github.com/liuggio/RackspaceCloudFilesStreamWrapper.git
    target=liuggio-rscf-streamwrapper


$loader->registerNamespaces(array(
    //other namespaces
    'Liuggio\\RackspaceCloudFilesStreamWrapper' =>  __DIR__.'/../vendor/liuggio-rscf-streamwrapper/src',
    'Liuggio\\RackspaceCloudFilesBundle'        =>  __DIR__.'/../vendor/bundles',
  ));


public function registerBundles()
{
    return array(
        //other bundles
        new Liuggio\RackspaceCloudFilesBundle\LiuggioRackspaceCloudFilesBundle(),
    );
    ...
 yaml

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


$auth = $this->get('liuggio_rackspace_cloud_files.service')



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

or

$container = $this->get('liuggio_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>";