forked from cloudinary/cloudinary_php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApiConfig.php
More file actions
93 lines (82 loc) · 2.67 KB
/
Copy pathApiConfig.php
File metadata and controls
93 lines (82 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* This file is part of the Cloudinary PHP package.
*
* (c) Cloudinary
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cloudinary\Configuration;
/**
* Defines the global configuration when making requests to the Cloudinary API.
*
* @property string $uploadPrefix Used for changing default API host.
* @property int|float $timeout Describing the timeout of the request in seconds.
* Use 0 to wait indefinitely (the default value is 60 seconds).
* @property int|float $uploadTimeout Describing the timeout of the upload request in seconds.
* Use 0 to wait indefinitely.
* @property int $chunkSize Size of single chunk when uploading large files.
*
* @api
*/
class ApiConfig extends BaseConfigSection
{
const CONFIG_NAME = 'api';
const DEFAULT_UPLOAD_PREFIX = 'https://api.cloudinary.com';
const DEFAULT_CHUNK_SIZE = 20000000; // bytes
const DEFAULT_TIMEOUT = 60; // seconds
// Supported parameters
const UPLOAD_PREFIX = 'upload_prefix'; // FIXME: rename it! (it is actually prefix for all API calls)
const API_PROXY = 'api_proxy';
const CONNECTION_TIMEOUT = 'connection_timeout';
const TIMEOUT = 'timeout';
const UPLOAD_TIMEOUT = 'upload_timeout';
const CHUNK_SIZE = 'chunk_size';
const CALLBACK_URL = 'callback_url';
/**
* Used for changing default API host.
*
* @var string
*/
protected $uploadPrefix;
/**
* Optional. Specifies a proxy through which to make calls to the Cloudinary API. Format: http://hostname:port.
*
* @var int $apiProxy
*/
public $apiProxy;
/**
* Describing the number of seconds to wait while trying to connect to a server.
* Use 0 to wait indefinitely (the default behavior).
*
* @var int|float
*/
public $connectionTimeout;
/**
* Describing the timeout of the request in seconds.
* Use 0 to wait indefinitely (the default behavior).
*
* @var int|float
*/
protected $timeout;
/**
* Describing the timeout of the upload request in seconds.
* Use 0 to wait indefinitely (the default behavior).
*
* @var int|float
*/
protected $uploadTimeout;
/**
* Size of a single chunk when uploading large files.
*
* @var int
*/
protected $chunkSize;
/**
* A public URL of your web application that has the cloudinary_cors.html file.
*
* @var string
*/
public $callbackUrl;
}