Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite03988c

Browse files
author
Nathan Sutton
committed
Make it so that you can set curl opts for CA paths and files
1 parent4607c61 commite03988c

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

‎Services/Zencoder.php

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,16 @@ class Services_Zencoder extends Services_Zencoder_Base
9696
* @param string $api_version API version
9797
* @param string $api_host API host
9898
* @param bool $debug Enable debug mode
99+
* @param string $ca_path Path to a directory that holds multiple CA certificates
100+
* @param string $ca_file Path to a file holding one or more certificates to verify the peer with
99101
*/
100102
publicfunction__construct(
101103
$api_key =NULL,
102104
$api_version ='v2',
103105
$api_host ='https://app.zencoder.com',
104-
$debug =false
106+
$debug =false,
107+
$ca_path =NULL,
108+
$ca_file =NULL
105109
)
106110
{
107111
// Check that library dependencies are met
@@ -114,13 +118,18 @@ public function __construct(
114118
if (!function_exists('curl_init')) {
115119
thrownewServices_Zencoder_Exception('cURL extension must be enabled.');
116120
}
121+
117122
$this->version =$api_version;
118-
$this->http =newServices_Zencoder_Http(
119-
$api_host,
120-
array("curlopts" =>array(
121-
CURLOPT_USERAGENT =>self::USER_AGENT
122-
),"api_key" =>$api_key,"debug" =>$debug)
123-
);
123+
124+
$http_options =array("api_version" =>$api_key,"debug" =>$debug,"curlopts" =>array(CURLOPT_USERAGENT =>self::USER_AGENT));
125+
if (isset($ca_path)) {
126+
$http_options["curlopts"][CURLOPT_CAPATH] =realpath($ca_path);
127+
}
128+
if (isset($ca_file)) {
129+
$http_options["curlopts"][CURLOPT_CAINFO] =realpath($ca_file);
130+
}
131+
132+
$this->http =newServices_Zencoder_Http($api_host,$http_options);
124133
$this->accounts =newServices_Zencoder_Accounts($this);
125134
$this->inputs =newServices_Zencoder_Inputs($this);
126135
$this->jobs =newServices_Zencoder_Jobs($this);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp