PHP code example of kialex / bpt-store

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

    

kialex / bpt-store example snippets




$client = new \Kialex\BptStore\Client([
    // Necessary
    //
    'login' => 'bpt_store_login',
    'password' => 'bpt_store_password',
    'sandbox' => true, // `false` is Production mode. Default is `false`
    //
    // Optional
    //
    // 'maxAttempts' => 5 // Attempts to reconnect if something went wrong, Default is `3`
    // 'versionNumber' => 1 // API version number, Default is `1`
    // 'url' => ''https://dev-api.bpt-store.com/api/v{apiVersionNumber}/' // API URL, Default: depends of mode
    // See `DEV_URl` and `PROD_URL` constants of class
]);

$bptFileCloud = new \Kialex\BptStore\File($client);

$fileData = $bptFileCloud->add(
    'path_to_file', // Full path to file or Absolute URL
    445566, // Group Id
    true // If U want to create a private file -> set `false`. Default is `true`.
);

$publicUrl = $bptFileCloud->getPublicUrl('58b6ebbd1689275b408feab2f187e367') // Put `hash` from `$fileData`;

$publicUrl = $bptFileCloud->getPrivateUrl('6a29d6bd9267491ab84c6d65280fba1658b6ebbd1689275b408feab2f187e367') // Put `uuid` from `$fileData`;
bash
# Install Composer
curl -sS https://getcomposer.org/installer | php