This topic provides the sample code of 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 describes the sample code.

Sample file Content
Object.php Object-related operations, 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 Bucket-related operations, such as creating, deleting, and listing buckets and configuring bucket ACLs. For more information, see Create buckets, List buckets, Delete buckets, and Manage bucket ACLs.
BucketLifecycle.php Lifecycle-related operations on buckets, such as configuring, querying, and deleting lifecycle rules. For more information, see Manage lifecycle rules.
BucketLogging.php Logging-related operations on buckets, 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 more information, see Hotlink protection.
BucketWebsite.php Operations related to static website hosting, such as configuring, querying, and deleting static website hosting configurations. For more information, see Static website hosting.
BucketCors.php Operations related to CORS, such as configuring, querying, and deleting CORS configurations. For more information, see CORS.