Best laravel framework open-source packages.

Phubic

PHP class to interact with Hubic Cloud Storage
Updated 2 years ago

Phubic

Phubic is a PHP helper library for OVH Hubic Cloud storage service.

WARNING :

Since the new - new new - update on Hubic this library no longer works. Check my OVH PHP SDK project as alternative (Hubic API should arrive soon...)

Read before anything else

  • This library is not supported by OVH.
  • As OVH does not provide official API (yet), i coded this library using reverse engineering on the web application.
  • For the moment the library is in development, all functions are not implemented yet. Be patient ;)
  • And the more important : YOU ARE RESPONSIBLE OF WHAT YOU DO !

Requirement

Your PHP setup need Curl

Examples

Here is a CLI example :

<?
require_once'../src/phubic.php';

// Config (tempDir must be writable)
$config = array('login'=>'YOUR HUBIC LOGIN HERE ','passwd'=>'YOUR HUBIC PASSWD HERE', 'tempDir'=>'/tmp/');
$phubic=new Phubic($config);

/*
 * Get Settings
 */
$settings=$phubic->getSettings();
var_dump($settings);

/*
 * Upload file
 */
$phubic->upload('/local/path/to/file','/hubic/path/');

/*
 * Upload folder recursively
 */
$phubic->upload('/local/path/to/folder','/hubic/path/');

/*
 *  Download file
 */
if($hubic->download('/hubic/path/of/file/to/download','/local/path/'))
     echo "\n".$file.' downloaded !';

/*
 *  Download folder (recursively)
 */
if($hubic->download('/hubic/path/of/folder/to/download','/local/path/'))
     echo "\n".$file.' downloaded !';


 /*
 *  Remove file or folder
 */
if($hubic->remove('/hubic/path/to/file/or/folder/to/remove'));
     echo "\n removed !';

/*
 * List Folder
 */
$l=$phubic->listFolder('/hubic/path/');
var_dump($l);

/*
 * Publish /hubic/path/to/fileOrFolder/to/publish for 5 days
 */
$r=$hubic->publish('/hubic/path/to/fileOrFolder/to/publish', 'My publish comment', 5);
echo "You can find my publication at location : ".$r->url;
Tags storage php