This topic describes the sample code of OSS SDK for PHP 1.0 in various scenarios.
The latest OSS SDK for PHP 2.0
OSS SDK for PHP 2.0 (alibabacloud-oss-php-sdk-v2) is a major rewrite of the OSS SDK for PHP 1.0 (aliyun-oss-php-sdk) code repository.
OSS SDK for PHP 2.0 is a new version that simplifies underlying operations such as identity authentication, automatic request retry, and error handling. You can access OSS by calling API operations without complex programming.
OSS SDK for PHP 2.0 provides flexible parameter configuration methods and rich advanced operations, such as paginator, transmission managers, and File-like operations. This comprehensively improves development efficiency and experience.
Refer to OSS SDK for PHP 2.0 (preview) to learn about how to get started.
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 |
Operations related to objects, including uploading, downloading, and managing objects. For more information, see Upload objects, Download objects, and Manage objects. | |
Operations related to LiveChannel. | |
Operations related to buckets, including Create buckets, List buckets, and Delete buckets. | |
Operations related to lifecycle management, such as configuring, querying, and deleting lifecycle rules for buckets. For more information, see Manage lifecycle rules. | |
Operations related to logging, such as configuring, querying, and deleting logging configurations. For more information, see Logging. | |
Operations related to hotlink protection on buckets, such as configuring, querying, and deleting hotlink protection configurations for buckets. For more information, see Hotlink protection. | |
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. | |
Operations related to cross-origin resource sharing (CORS), such as configuring, querying, and deleting CORS configurations. For more information, see CORS. |