From 94fff2ff05b76411bb9e0c8e728409922e26a2ad Mon Sep 17 00:00:00 2001 From: Crimson <39024757+crimson-gao@users.noreply.github.com> Date: Fri, 27 Sep 2024 15:34:21 +0800 Subject: [PATCH] fix: avoid conflict constants (#49) --- Aliyun/Log/Client.php | 12 ++++++------ docs/namespaces/default.html | 12 ++++++------ docs/packages/LOG.PHP.SDK.html | 12 ++++++------ docs/packages/SLS_PHP_SDK.html | 16 ++++++++-------- docs/packages/default.html | 12 ++++++------ docs/structure.xml | 8 ++++---- 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Aliyun/Log/Client.php b/Aliyun/Log/Client.php index bb816cb..2197683 100644 --- a/Aliyun/Log/Client.php +++ b/Aliyun/Log/Client.php @@ -10,10 +10,10 @@ require_once realpath ( dirname ( __FILE__ ) . '/sls.proto.php' ); require_once realpath ( dirname ( __FILE__ ) . '/protocolbuffers.inc.php' ); -if(!defined('API_VERSION')) - define('API_VERSION', '0.6.0'); -if(!defined('USER_AGENT')) - define('USER_AGENT', 'log-php-sdk-v-0.6.0'); +if(!defined('SLS_API_VERSION')) + define('SLS_API_VERSION', '0.6.0'); +if(!defined('SLS_USER_AGENT')) + define('SLS_USER_AGENT', 'log-php-sdk-v-0.6.0'); /** * Aliyun_Log_Client class is the main class in the SDK. It can be used to @@ -153,7 +153,7 @@ protected function getHttpResponse($method, $url, $body, $headers) { foreach ( $headers as $key => $value ) $request->add_header ( $key, $value ); $request->set_method ( $method ); - $request->set_useragent(USER_AGENT); + $request->set_useragent(SLS_USER_AGENT); if ($method == "POST" || $method == "PUT") $request->set_body ( $body ); $request->send_request (); @@ -225,7 +225,7 @@ private function send($method, $project, $body, $resource, $params, $headers) { $headers ['Content-Type'] = ''; // If not set, http request will add automatically. } - $headers ['x-log-apiversion'] = API_VERSION; + $headers ['x-log-apiversion'] = SLS_API_VERSION; $headers ['x-log-signaturemethod'] = 'hmac-sha1'; if(strlen($credentials->getSecurityToken()) >0) $headers ['x-acs-security-token'] = $credentials->getSecurityToken(); diff --git a/docs/namespaces/default.html b/docs/namespaces/default.html index b2f0e05..878ac4d 100644 --- a/docs/namespaces/default.html +++ b/docs/namespaces/default.html @@ -135,21 +135,21 @@

Constants

-
-

API_VERSION

+
+

SLS_API_VERSION

- « More »
+ « More »
-
-

USER_AGENT

+
+

SLS_USER_AGENT

- « More »
+ « More »
diff --git a/docs/packages/LOG.PHP.SDK.html b/docs/packages/LOG.PHP.SDK.html index f51a764..ecbdbd2 100644 --- a/docs/packages/LOG.PHP.SDK.html +++ b/docs/packages/LOG.PHP.SDK.html @@ -135,18 +135,18 @@

Constants

-
-

API_VERSION

+
+

SLS_API_VERSION

- « More » + « More »
-
-

USER_AGENT

+
+

SLS_USER_AGENT

- « More » + « More »
diff --git a/docs/packages/SLS_PHP_SDK.html b/docs/packages/SLS_PHP_SDK.html index 366a80d..267f0cb 100644 --- a/docs/packages/SLS_PHP_SDK.html +++ b/docs/packages/SLS_PHP_SDK.html @@ -96,8 +96,8 @@
  • Aliyun_Log_Models_GetLogsResponse
  • -
  • API_VERSION
    API_VERSION
  • -
  • USER_AGENT
    USER_AGENT
  • +
  • SLS_API_VERSION
    SLS_API_VERSION
  • +
  • SLS_USER_AGENT
    SLS_USER_AGENT
  • @@ -305,9 +305,9 @@

    ResponseCore

    Constants

    - 
    -

    API_VERSION

    -
    API_VERSION = '0.4.0' 
    + 
    +

    SLS_API_VERSION

    +
    SLS_API_VERSION = '0.4.0' 
    @@ -317,9 +317,9 @@

    API_VERSION

    - 
    -

    USER_AGENT

    -
    USER_AGENT = 'sls-php-sdk-v-0.4.1' 
    + 
    +

    SLS_USER_AGENT

    +
    SLS_USER_AGENT = 'sls-php-sdk-v-0.4.1' 
    diff --git a/docs/packages/default.html b/docs/packages/default.html index 6048e4d..b2b6925 100644 --- a/docs/packages/default.html +++ b/docs/packages/default.html @@ -156,18 +156,18 @@

    Constants

    -
    -

    API_VERSION

    +
    +

    SLS_API_VERSION

    - « More » + « More »
    -
    -

    USER_AGENT

    +
    +

    SLS_USER_AGENT

    - « More » + « More »
    diff --git a/docs/structure.xml b/docs/structure.xml index 54dcf24..69ed6c7 100644 --- a/docs/structure.xml +++ b/docs/structure.xml @@ -2991,8 +2991,8 @@ All rights reserved - API_VERSION - \API_VERSION + SLS_API_VERSION + \SLS_API_VERSION '0.4.0' @@ -3001,8 +3001,8 @@ All rights reserved - USER_AGENT - \USER_AGENT + SLS_USER_AGENT + \SLS_USER_AGENT 'sls-php-sdk-v-0.4.1'