Skip to content

Commit e781bbd

Browse files
authored
Merge pull request #81 from pages-solutions/patch-2
Downgrade to php 5.4(::class keyword not supported)
2 parents fbc6138 + a65005e commit e781bbd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/JiraClient.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public function __construct(ConfigurationInterface $configuration = null, Logger
7474
$this->configuration = $configuration;
7575
$this->json_mapper = new \JsonMapper();
7676

77-
$this->json_mapper->undefinedPropertyHandler = [\JiraRestApi\JsonMapperHelper::class, 'setUndefinedProperty'];
77+
// Fix "\JiraRestApi\JsonMapperHelper::class" syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'
78+
$this->json_mapper->undefinedPropertyHandler = [new \JiraRestApi\JsonMapperHelper(), 'setUndefinedProperty'];
7879

7980
// create logger
8081
if ($logger) {
@@ -188,7 +189,11 @@ public function exec($context, $post_data = null, $custom_request = null)
188189
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $this->getConfiguration()->isCurlOptSslVerifyHost());
189190
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->getConfiguration()->isCurlOptSslVerifyPeer());
190191

191-
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
192+
// curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set
193+
if (!function_exists('ini_get') || !ini_get('open_basedir')){
194+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
195+
}
196+
192197
curl_setopt($ch, CURLOPT_HTTPHEADER,
193198
array('Accept: */*', 'Content-Type: application/json'));
194199

0 commit comments

Comments
 (0)