Skip to content

Commit 3f74b47

Browse files
Drop support for PHP 5.6 and 7.x
1 parent ff8bd3d commit 3f74b47

File tree

15 files changed

+77
-360
lines changed

15 files changed

+77
-360
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
fail-fast: false
99
matrix:
1010
php-versions:
11-
- '5.6'
12-
- '7.4'
1311
- '8.0'
1412
- '8.1'
1513
- '8.2'
14+
- '8.3'
15+
- '8.4'
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4

README.md

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,47 @@
55

66
Cloudinary PHP SDK
77
==================
8+
89
## About
10+
911
The Cloudinary PHP SDK allows you to quickly and easily integrate your application with Cloudinary.
1012
Effortlessly optimize, transform, upload and manage your cloud's assets.
1113

12-
1314
#### Note
15+
1416
This Readme provides basic installation and usage information.
1517
For the complete documentation, see the [PHP SDK Guide](https://cloudinary.com/documentation/php_integration).
1618

1719
## Table of Contents
20+
1821
- [Key Features](#key-features)
1922
- [Version Support](#Version-Support)
2023
- [Installation](#installation)
2124
- [Usage](#usage)
2225
- [Setup](#Setup)
2326
- [Transform and Optimize Assets](#Transform-and-Optimize-Assets)
2427

25-
2628
## Key Features
29+
2730
- [Transform](https://cloudinary.com/documentation/php_video_manipulation#video_transformation_examples) and
2831
[optimize](https://cloudinary.com/documentation/php_image_manipulation#image_optimizations) assets.
2932
- Generate [image](https://cloudinary.com/documentation/php_image_manipulation#deliver_and_transform_images) and
3033
[video](https://cloudinary.com/documentation/php_video_manipulation#php_video_transformation_code_examples) tags.
3134
- [Asset Management](https://cloudinary.com/documentation/php_asset_administration).
3235
- [Secure URLs](https://cloudinary.com/documentation/video_manipulation_and_delivery#generating_secure_https_urls_using_sdks).
3336

34-
35-
3637
## Version Support
3738

38-
| SDK Version | PHP 5.4 | PHP 5.5 | PHP 5.6 | PHP 7.x | PHP 8.x |
39-
|-------------|---------|---------|---------|---------|---------|
40-
| 2.x | x | x | v | v | v |
41-
| 1.x | v | v | v | v | x |
39+
| SDK Version | PHP 5.4 | PHP 5.5 | PHP 5.6 | PHP 7.x | PHP 8.0 - 8.3 | PHP 8.4 |
40+
|-------------|---------|---------|---------|---------|---------------|---------|
41+
| 3.x |||||||
42+
| 2.x |||||| ✘ * |
43+
| 1.x |||||||
4244

45+
\* Deprecation warnings
4346

4447
## Installation
48+
4549
```bash
4650
composer require "cloudinary/cloudinary_php"
4751
```
@@ -56,57 +60,71 @@ on migrating to this version of the PHP SDK.
5660
The previous (1.x) version of the SDK is located [here](https://github.com/cloudinary/cloudinary_php/tree/support/1.x).
5761

5862
### Setup
63+
5964
```php
6065
use Cloudinary\Cloudinary;
6166

6267
$cloudinary = new Cloudinary();
6368
```
6469

6570
### Transform and Optimize Assets
71+
6672
- [See full documentation](https://cloudinary.com/documentation/php_image_manipulation).
6773

6874
```php
6975
$cloudinary->image('sample.jpg')->resize(Resize::fill()->width(100)->height(150))->format(Format::auto());
7076
```
7177

7278
### Upload
79+
7380
- [See full documentation](https://cloudinary.com/documentation/php_image_and_video_upload).
7481
- [Learn more about configuring your uploads with upload presets](https://cloudinary.com/documentation/upload_presets).
82+
7583
```php
7684
$cloudinary->uploadApi->upload('my_image.jpg');
7785
```
7886

7987
### Security options
88+
8089
- [See full documentation](https://cloudinary.com/documentation/solution_overview#security).
8190

8291
## Contributions
92+
8393
- Ensure tests run locally
8494
- Open a PR and ensure Travis tests pass
8595

86-
8796
## Get Help
97+
8898
If you run into an issue or have a question, you can either:
99+
89100
- Issues related to the SDK: [Open a GitHub issue](https://github.com/cloudinary/cloudinary_php/issues).
90101
- Issues related to your account: [Open a support ticket](https://cloudinary.com/contact)
91102

92-
93103
## About Cloudinary
94-
Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinary enables developers to efficiently
95-
manage, transform, optimize, and deliver images and videos through multiple CDNs. Ultimately, viewers enjoy responsive
96-
and personalized visual-media experiences—irrespective of the viewing device.
97104

105+
Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinary enables developers to efficiently
106+
manage, transform, optimize, and deliver images and videos through multiple CDNs. Ultimately, viewers enjoy responsive
107+
and personalized visual-media experiences—irrespective of the viewing device.
98108

99109
## Additional Resources
100-
- [Cloudinary Transformation and REST API References](https://cloudinary.com/documentation/cloudinary_references): Comprehensive references, including syntax and examples for all SDKs.
110+
111+
- [Cloudinary Transformation and REST API References](https://cloudinary.com/documentation/cloudinary_references):
112+
Comprehensive references, including syntax and examples for all SDKs.
101113
- [MediaJams.dev](https://mediajams.dev/): Bite-size use-case tutorials written by and for Cloudinary Developers
102-
- [DevJams](https://www.youtube.com/playlist?list=PL8dVGjLA2oMr09amgERARsZyrOz_sPvqw): Cloudinary developer podcasts on YouTube.
103-
- [Cloudinary Academy](https://training.cloudinary.com/): Free self-paced courses, instructor-led virtual courses, and on-site courses.
104-
- [Code Explorers and Feature Demos](https://cloudinary.com/documentation/code_explorers_demos_index): A one-stop shop for all code explorers, Postman collections, and feature demos found in the docs.
105-
- [Cloudinary Roadmap](https://cloudinary.com/roadmap): Your chance to follow, vote, or suggest what Cloudinary should develop next.
106-
- [Cloudinary Facebook Community](https://www.facebook.com/groups/CloudinaryCommunity): Learn from and offer help to other Cloudinary developers.
114+
- [DevJams](https://www.youtube.com/playlist?list=PL8dVGjLA2oMr09amgERARsZyrOz_sPvqw): Cloudinary developer podcasts on
115+
YouTube.
116+
- [Cloudinary Academy](https://training.cloudinary.com/): Free self-paced courses, instructor-led virtual courses, and
117+
on-site courses.
118+
- [Code Explorers and Feature Demos](https://cloudinary.com/documentation/code_explorers_demos_index): A one-stop shop
119+
for all code explorers, Postman collections, and feature demos found in the docs.
120+
- [Cloudinary Roadmap](https://cloudinary.com/roadmap): Your chance to follow, vote, or suggest what Cloudinary should
121+
develop next.
122+
- [Cloudinary Facebook Community](https://www.facebook.com/groups/CloudinaryCommunity): Learn from and offer help to
123+
other Cloudinary developers.
107124
- [Cloudinary Account Registration](https://cloudinary.com/users/register/free): Free Cloudinary account registration.
108-
- [Cloudinary Website](https://cloudinary.com): Learn about Cloudinary's products, partners, customers, pricing, and more.
109-
125+
- [Cloudinary Website](https://cloudinary.com): Learn about Cloudinary's products, partners, customers, pricing, and
126+
more.
110127

111128
## Licence
129+
112130
Released under the MIT license.

RoboFile.php

Lines changed: 0 additions & 82 deletions
This file was deleted.

composer.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,23 @@
2424
"issues": "https://github.com/cloudinary/cloudinary_php/issues"
2525
},
2626
"require": {
27-
"php": ">=5.6.0",
28-
"cloudinary/transformation-builder-sdk": "^1",
29-
"guzzlehttp/guzzle": "^6.5.8|^7.4.5",
27+
"php": ">=8.0.0",
28+
"cloudinary/transformation-builder-sdk": "^2",
29+
"guzzlehttp/guzzle": "^7.4.5",
3030
"guzzlehttp/promises": "^1.5.3|^2.0",
31-
"guzzlehttp/psr7": "^1.9.1|^2.5",
31+
"guzzlehttp/psr7": "^2.7",
3232
"ext-json": "*",
33-
"monolog/monolog": "^1|^2|^3",
34-
"psr/log" : "^1|^2|^3"
33+
"monolog/monolog": "^2|^3",
34+
"psr/log" : "^2|^3"
3535
},
3636
"require-dev": {
37-
"symfony/phpunit-bridge": "^5.2",
37+
"symfony/phpunit-bridge": "^7.2",
3838
"phpmd/phpmd": "*",
39-
"squizlabs/php_codesniffer": "3.*",
39+
"squizlabs/php_codesniffer": "*",
4040
"friendsofphp/php-cs-fixer": "*",
4141
"ext-dom": "*",
4242
"ext-libxml": "*",
43-
"ext-zip": "*",
44-
"consolidation/robo": "~1"
43+
"ext-zip": "*"
4544
},
4645
"autoload": {
4746
"classmap": [

phpunit.xml

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
5-
backupGlobals="false"
6-
backupStaticAttributes="false"
7-
colors="true"
8-
convertErrorsToExceptions="true"
9-
convertNoticesToExceptions="true"
10-
convertWarningsToExceptions="true"
11-
processIsolation="false"
12-
stopOnFailure="false"
13-
bootstrap="vendor/autoload.php"
14-
>
15-
<php>
16-
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0"/>
17-
<env name="SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT" value="1"/>
18-
</php>
19-
<testsuites>
20-
<testsuite name="Unit">
21-
<directory>tests/Unit</directory>
22-
</testsuite>
23-
<testsuite name="Integration">
24-
<directory>tests/Integration</directory>
25-
</testsuite>
26-
</testsuites>
27-
28-
<filter>
29-
<whitelist processUncoveredFilesFromWhitelist="true">
30-
<directory suffix=".php">./src</directory>
31-
</whitelist>
32-
</filter>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" bootstrap="vendor/autoload.php">
3+
<coverage processUncoveredFiles="true">
4+
<include>
5+
<directory suffix=".php">./src</directory>
6+
</include>
7+
</coverage>
8+
<php>
9+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0"/>
10+
<env name="SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT" value="1"/>
11+
</php>
12+
<testsuites>
13+
<testsuite name="Unit">
14+
<directory>tests/Unit</directory>
15+
</testsuite>
16+
<testsuite name="Integration">
17+
<directory>tests/Integration</directory>
18+
</testsuite>
19+
</testsuites>
3320
</phpunit>

src/Api/Provisioning/AccountApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class AccountApi
3535
*
3636
* @param ProvisioningConfiguration $configuration
3737
*/
38-
public function __construct(ProvisioningConfiguration $configuration = null)
38+
public function __construct(?ProvisioningConfiguration $configuration = null)
3939
{
4040
$this->accountApiClient = new AccountApiClient($configuration);
4141
}

src/Api/Provisioning/AccountApiClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ class AccountApiClient extends BaseApiClient
3939
*
4040
* @param ProvisioningConfiguration $configuration
4141
*/
42-
public function __construct(ProvisioningConfiguration $configuration = null)
42+
public function __construct(?ProvisioningConfiguration $configuration = null)
4343
{
4444
$this->init($configuration);
4545
}
4646

4747
/**
4848
* @param ProvisioningConfiguration $configuration
4949
*/
50-
public function init(ProvisioningConfiguration $configuration = null)
50+
public function init(?ProvisioningConfiguration $configuration = null)
5151
{
5252
if ($configuration === null) {
5353
$configuration = ProvisioningConfiguration::instance();

src/Log/Logger.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class Logger
5454
E_USER_ERROR => Monolog::ERROR,
5555
E_USER_WARNING => Monolog::WARNING,
5656
E_USER_NOTICE => Monolog::NOTICE,
57-
E_STRICT => Monolog::NOTICE,
5857
E_RECOVERABLE_ERROR => Monolog::ERROR,
5958
E_DEPRECATED => Monolog::NOTICE,
6059
E_USER_DEPRECATED => Monolog::NOTICE,

src/Log/LoggerDecorator.php

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,6 @@
1515
use Monolog\Handler\TestHandler;
1616
use Psr\Log\LoggerInterface;
1717

18-
/**
19-
* Backwards compatibility with PSR Log v1.
20-
*/
21-
$r = new \ReflectionClass(LoggerInterface::class);
22-
if (PHP_MAJOR_VERSION < 7 || !$r->getMethod('log')->hasReturnType()) {
23-
/**
24-
* Logger decorator trait that exposes PSR-3 Logger methods.
25-
*/
26-
trait LoggerDecoratorTrait
27-
{
28-
use LoggerDecoratorV1Trait;
29-
}
30-
} else {
31-
/**
32-
* Logger decorator trait that exposes PSR-3 Logger methods.
33-
*/
34-
trait LoggerDecoratorTrait
35-
{
36-
use LoggerDecoratorV3Trait;
37-
}
38-
}
39-
4018
/**
4119
* Logger decorator that instantiates logger by configuration and exposes PSR-3 Logger methods
4220
*/
@@ -58,7 +36,7 @@ class LoggerDecorator implements LoggerInterface
5836
*
5937
* @param LoggingConfig|null $config
6038
*/
61-
public function __construct(LoggingConfig $config = null)
39+
public function __construct(?LoggingConfig $config = null)
6240
{
6341
$this->config = $config;
6442
}

0 commit comments

Comments
 (0)