This topic provides the sample code of Object Storage Service (OSS) SDK for PHP in various use cases.

Source code

For the source code of OSS SDK for PHP, visit GitHub.

Sample code

OSS SDK for PHP provides a variety of sample code for your reference or use. The following table lists the sample code files provided by OSS SDK for PHP.

Sample code file Content
Object.php Operations related to objects, including uploading, downloading, and managing objects. For more information, see Upload objects, Download objects, and Manage objects.
MultipartUpload.php Multipart upload
Signature.php Authorized access
Callback.php Upload callback
Image.php Image processing
LiveChannel.php Operations related to LiveChannel.
Bucket.php Operations related to buckets, including Create buckets, List buckets, and Delete buckets.
BucketLifecycle.php Operations related to lifecycle management, such as configuring, querying, and deleting lifecycle rules for buckets. For more information, see Manage lifecycle rules.
BucketLogging.php Operations related to logging, such as configuring, querying, and deleting logging configurations. For more information, see Logging.
BucketReferer.php Operations related to hotlink protection on buckets, such as configuring, querying, and deleting hotlink protection configurations for buckets. For more information, see Hotlink protection.
BucketWebsite.php Operations related to static website hosting, such as configuring, querying, and deleting static website hosting configurations for buckets. For more information, see Static website hosting.
BucketCors.php Operations related to cross-origin resource sharing (CORS), such as configuring, querying, and deleting CORS configurations. For more information, see CORS.