百度智能云

All Product Document

          Object Storage

          SDK Installation

          Runtime Environment

          The PHP SDK package requires an operating environment of at least PHP 5.3.2.

          Install SDK

          1.Download tool kit (ZIP kit) in Official Website.

          2.There are three files after decompressing the ZIP package, as follows:

          BaiduBce.phar 	 	 	 //PHP SDK 
          BosClientSample.php      //Example 
          SampleConf.php 	 	 	 //See configuration file; see below for details 

          Note: After configuring AK/SK and Host, you can run Sample with phpunit --debug BosClientSample.php.

          3.Add the following code to the script file and you can use the SDK package:

          include 'BaiduBce.phar';
          require 'YourConf.php';

          For reference to configuration file, please see Configure BosClient.

          SDK's Directory Structure

          BaiduBce.phar
          ├──src
          │   └── BaiduBce
          │       ├── Auth                //BCE signature related 
          │       ├── Exception           //BCE client exception
          │       ├── Http                //BCE's Http communication related 
          │       ├── Log                 //BCE log 
          │       ├── Services
          │       │   └── Bos                   //BOS main directory, which must be retained
          │       │       ├── BosClient.php     //BOS operation class, all operations can be completed via BosClient class
          │       │       ├── BosOptions.php    //BOS custom configuration
          │       │       └── CannedAcl.php     //CannedAcl module
          │       └── Util                //BCE utility
          └──vendor                       //Third-party libraries

          Uninstall SDK

          It is expected that you delete the phar package of include in the script when uninstalling the SDK .

          Previous
          Overview
          Next
          Initialization