PHP code example of jamiehannaford / php-opencloud-zf2

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

    

jamiehannaford / php-opencloud-zf2 example snippets


return array(
    'modules' => array(
        // other modules...
        'OpenCloud'
    )
);


public function indexAction()
{
    // get Rackspace client
    $rackspace = $this->getServiceLocator()->get('OpenCloud');

    // this also works
    $rackspace = $this->getServiceLocator()->get('OpenCloud\Rackspace');

    // get OpenStack client
    $openstack = $this->getServiceLocator()->get('OpenCloud\OpenStack');
}
bash
curl -sS https://getcomposer.org/installer | php
bash
php composer.phar 
json
{
    "amiehannaford/php-opencloud-zf2": "~1.0"
    }
}
bash
php composer.phar install
bash
cp ./vendor/jamiehannaford/php-opencloud-zf2/config/opencloud.local.php.dist ./config/autoload/opencloud.local.php