Skip to content

Commit 3c926d8

Browse files
Version 1.0.0
0 parents  commit 3c926d8

File tree

544 files changed

+50508
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

544 files changed

+50508
-0
lines changed

.code-generation/config.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
module.exports = {
2+
"SDKSpecVersion": {},
3+
"langConfig": {
4+
newInstanceSyntax: '(new #name(#req))#optional',
5+
lang: 'PHP',
6+
methodDelimiter: '->',
7+
groupDelimiter: '::',
8+
openQualifiersChar: '',
9+
closeQualifiersChar: '',
10+
closeTransformationChar: '',
11+
unsupportedTxParams: [],
12+
unsupportedSyntaxList: [],
13+
mainTransformationString: {
14+
openSyntaxString: {
15+
image: '(new ImageTransformation())',
16+
video: '(new VideoTransformation())',
17+
media: '(new Transformation())'
18+
},
19+
closeSyntaxString: ';'
20+
},
21+
openActionChar: '(',
22+
closeActionChar: ')',
23+
hideActionGroups: false,
24+
overwritePreset: 'php',
25+
arraySeparator: ', ',
26+
arrayOpen: '[',
27+
arrayClose: ']',
28+
formats: {
29+
formatMethod: 'camelCase',
30+
formatClassOrEnum: 'PascalCase',
31+
formatFloat: (f) => {
32+
if (!f.toString().includes('.')) {
33+
return `${f}.0` // In JS world, 1.0 is 1, so we make sure 1.0 stays 1.0
34+
} else {
35+
return f;
36+
}
37+
}
38+
},
39+
methodNameMap: {
40+
'signature': 'sign',
41+
'url_suffix': 'suffix'
42+
},
43+
classNameMap: {},
44+
childTransformations: {
45+
image: {
46+
open: "(new ImageTransformation())", // TODO Seems like we should reuse the newInstanceSyntax
47+
close: '',
48+
},
49+
video: {
50+
open: "(new VideoTransformation())",// TODO Seems like we should reuse the newInstanceSyntax
51+
close: '',
52+
},
53+
media: {
54+
open: "(new Transformation())",// TODO Seems like we should reuse the newInstanceSyntax
55+
close: '',
56+
}
57+
},
58+
},
59+
"overwrites": {
60+
"qualifiers": {
61+
color_override: (payload) => {
62+
const {qualifierDTO, langConfig} = payload;
63+
const colorName = qualifierDTO.qualifiers[0].name;
64+
const group = qualifierDTO.qualifiers[0].group;
65+
66+
// TODO this should be streamlined with how we de. al with color.
67+
return `->colorOverride(Color::${colorName.toUpperCase()})`
68+
}
69+
}
70+
}
71+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Bug report
3+
about: Bug report for Cloudinary PHP Transformation Builder SDK
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## Bug report for Cloudinary PHP Transformation Builder SDK
11+
Before proceeding, please update to the latest version and test if the issue persists
12+
13+
## Describe the bug in a sentence or two.
14+
15+
16+
## Issue Type (Can be multiple)
17+
- [ ] Build - Can’t install or import the SDK
18+
- [ ] Performance - Performance issues
19+
- [ ] Behaviour - Functions aren’t working as expected (such as generate URL)
20+
- [ ] Documentation - Inconsistency between the docs and behaviour
21+
- [ ] Other (Specify)
22+
23+
## Steps to reproduce
24+
… if applicable
25+
26+
## Error screenshots or Stack Trace (if applicable)
27+
28+
29+
## Operating System
30+
- [ ] Linux
31+
- [ ] Windows
32+
- [ ] macOS
33+
- [ ] All
34+
35+
## Environment and Frameworks (fill in the version numbers)
36+
37+
- PHP Cloudinary SDK version - 0.0.0
38+
- PHP Version - 0.0.0
39+
- Framework (Laravel, Symphony, etc) - 0.0.0
40+
41+
## Repository
42+
43+
If possible, please provide a link to a reproducible repository that showcases the problem
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature request
3+
about: Feature request for Cloudinary PHP Transformation Builder SDK
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## Feature request for Cloudinary PHP Transformation Builder SDK
11+
…(If your feature is for other SDKs, please request them there)
12+
13+
14+
## Explain your use case
15+
… (A high level explanation of why you need this feature)
16+
17+
## Describe the problem you’re trying to solve
18+
… (A more technical view of what you’d like to accomplish, and how this feature will help you achieve it)
19+
20+
## Do you have a proposed solution?
21+
… (yes, no? Please elaborate if needed)

.github/pull_request_template.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
### Brief Summary of Changes
2+
<!-- Provide some context as to what was changed, from an implementation standpoint. -->
3+
4+
#### What does this PR address?
5+
- [ ] GitHub issue (Add reference - #XX)
6+
- [ ] Refactoring
7+
- [ ] New feature
8+
- [ ] Bug fix
9+
- [ ] Adds more tests
10+
11+
#### Are tests included?
12+
- [ ] Yes
13+
- [ ] No
14+
15+
#### Reviewer, please note:
16+
<!--
17+
List anything here that the reviewer should pay special attention to. This might
18+
include, for example:
19+
* Dependence on other PRs
20+
* Reference to other Cloudinary SDKs
21+
* Changes that seem arbitrary without further explanations
22+
-->
23+
24+
#### Checklist:
25+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
26+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
27+
- [ ] My code follows the code style of this project.
28+
- [ ] My change requires a change to the documentation.
29+
- [ ] I ran the full test suite before pushing the changes and all of the tests pass.

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
vendor/
2+
composer.lock
3+
tests/coverage
4+
output/
5+
.idea
6+
composer.phar
7+
docs/sami.phar
8+
docs/cache/
9+
docs/build/
10+
tools/dev/sanity/node_modules
11+
tools/dev/sanity/package-lock.json
12+
tools/dev/sanity/results.json
13+
tools/dev/sanity/TransformationSanityTest.php

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
language: php
2+
php:
3+
- '7.4'
4+
- '7.3'
5+
- '7.2'
6+
- '7.1'
7+
- '7.0'
8+
- '5.6'
9+
10+
before_install:
11+
- export COMPOSER_MEMORY_LIMIT=-1
12+
install: composer install
13+
14+
script: vendor/bin/phpunit
15+
16+
branches:
17+
except:
18+
- staging-test
19+
20+
notifications:
21+
email:
22+
recipients:
23+
- sdk_developers@cloudinary.com

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1.0.0 / 2022-05-23
2+
===================
3+
4+
* The first version of the Cloudinary PHP Transformation Builder SDK

CONTRIBUTING.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Contributing to Cloudinary PHP library
2+
3+
Contributions are welcome and greatly appreciated!
4+
5+
## Reporting a bug
6+
7+
- Make sure that the bug was not already reported by searching in GitHub under [Issues](https://github.com/cloudinary/cloudinary_php) and the Cloudinary [Support forms](https://support.cloudinary.com).
8+
- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/cloudinary/cloudinary_php/issues/new).
9+
Be sure to include a **title and clear description**, as relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.
10+
- If you require assistance in the implementation of cloudinary_php please [submit a request](https://support.cloudinary.com/hc/en-us/requests/new) on Cloudinary's site.
11+
12+
## Requesting a feature
13+
14+
We would love to receive your requests!
15+
Please be aware that the library is used in a wide variety of environments and that some features may not be applicable to all users.
16+
17+
- Open a GitHub [issue](https://github.com/cloudinary/cloudinary_php) describing the benefits (and possible drawbacks) of the requested feature
18+
19+
## Fixing a bug / Implementing a new feature
20+
21+
- Follow the instructions detailed in [Code contribution](#code-contribution)
22+
- Open a new GitHub pull request
23+
- Ensure the PR description clearly describes the bug / feature. Include relevant issue number if applicable.
24+
- Provide test code that covers the new code
25+
- The code should support:
26+
- PHP >= 5.6
27+
28+
## Code contribution
29+
30+
When contributing code, either to fix a bug or to implement a new feature, please follow these guidelines:
31+
32+
#### Fork the Project
33+
34+
Fork [project on Github](https://github.com/cloudinary/cloudinary_php) and check your copy.
35+
36+
```
37+
git clone https://github.com/contributor/cloudinary_php.git
38+
cd cloudinary_php
39+
git remote add upstream https://github.com/cloudinary/cloudinary_php.git
40+
```
41+
42+
#### Create a Topic Branch
43+
44+
Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
45+
46+
```
47+
git checkout master
48+
git pull upstream master
49+
git checkout -b my-feature-branch
50+
```
51+
#### Rebase
52+
53+
If you've been working on a change for a while, rebase with upstream/master.
54+
55+
```
56+
git fetch upstream
57+
git rebase upstream/master
58+
git push origin my-feature-branch -f
59+
```
60+
61+
62+
#### Write Tests
63+
64+
Try to write a test that reproduces the problem you're trying to fix or describes a feature you would like to build.
65+
66+
We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.
67+
68+
#### Write Code
69+
70+
Implement your feature or bug fix.
71+
Follow the following PHP coding standards, described in [PSR-0](http://www.php-fig.org/psr/psr-0/), [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/) and [PSR-4](http://www.php-fig.org/psr/psr-4/) documentation.
72+
The code should support:
73+
74+
- PHP >= 5.6
75+
76+
Make sure that `phpunit` completes without errors.
77+
78+
#### Write Documentation
79+
80+
Document any external behavior in the [README](README.md).
81+
82+
#### Commit Changes
83+
84+
Make sure git knows your name and email address:
85+
86+
```
87+
git config --global user.name "Your Name"
88+
git config --global user.email "contributor@example.com"
89+
```
90+
91+
Writing good commit logs is important. A commit log should describe what changed and why.
92+
93+
```
94+
git add ...
95+
git commit
96+
```
97+
98+
99+
> Please squash your commits into a single commit when appropriate. This simplifies future cherry picks and keeps the git log clean.
100+
101+
#### Push
102+
103+
```
104+
git push origin my-feature-branch
105+
```
106+
107+
#### Make a Pull Request
108+
109+
Go to https://github.com/contributor/cloudinary_php and select your feature branch. Click the 'Pull Request' button and fill out the form. Pull requests are normally reviewed within a few days.
110+
Ensure the PR description clearly describes the problem and solution. Include relevant issue number if applicable.
111+
112+
#### Rebase
113+
114+
If you've been working on a change for a while, rebase with upstream/master.
115+
116+
```
117+
git fetch upstream
118+
git rebase upstream/master
119+
git push origin my-feature-branch -f
120+
```
121+
122+
#### Check on Your Pull Request
123+
124+
Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise - fix issues and amend your commit as described above.
125+
126+
#### Be Patient
127+
128+
It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang on there!
129+
130+
#### Thank You
131+
132+
Please do know that we really appreciate and value your time and work. We love you, really.

DEVELOPER_GUIDELINE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Developing Cloudinary PHP
2+
3+
## Code style
4+
5+
### Recommended Standards
6+
All code should follow the following standards:
7+
- [PSR-1](http://www.php-fig.org/psr/psr-1/)
8+
- [PSR-2](http://www.php-fig.org/psr/psr-2/)
9+
- [PSR-3 _Recommended_](http://www.php-fig.org/psr/psr-3/)
10+
- [PSR-5 _Recommended_](https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc.md)
11+
- [PSR-12](https://www.php-fig.org/psr/psr-12/)
12+
13+
### PHP Code Size Control
14+
All code should meet default configuration of [PHPMD](https://phpmd.org/rules/codesize.html)
15+
16+
## Tests Coverage
17+
All code must be covered by tests using [PHPUnit](https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html)
18+
For functional tests unique IDs should be used and after test is done all data from remote server should be removed.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Cloudinary
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)