PHP code example of mateusz-blaszczyk / php-ocsclient

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

    

mateusz-blaszczyk / php-ocsclient example snippets









// Create new OSC Client instance for "somebucket" bucket
$OCSClient = new Oktawave_OCS_OCSClient('somebucket');

// Authenticate your OCS user
$OCSClient->authenticate('account:user', 'pa$$w0rd');


// Upload single object
$url = $OCSClient->createObject('/path/to/file.txt', 'destination/path/file.txt');

// Download object
$fileContent = $OCSClient->downloadObject('destination/path/file.txt');

//  Get a list of all objects
$list = $OCSClient->listObjects();
bash
# Install Composer
curl -sS https://getcomposer.org/installer | php

# Add OCS Client dependency to your project
php composer.phar