コード例 #1
0
ファイル: apis.php プロジェクト: buttasg/cowgirlk
 /**
  * Represents the "ping" action.
  *
  * @see http://wiki.shopgate.com/Shopgate_Plugin_API_ping
  */
 protected function ping()
 {
     // obfuscate data relevant for authentication
     $config = $this->config->toArray();
     $config['customer_number'] = ShopgateLogger::OBFUSCATION_STRING;
     $config['shop_number'] = ShopgateLogger::OBFUSCATION_STRING;
     $config['apikey'] = ShopgateLogger::OBFUSCATION_STRING;
     $config['oauth_access_token'] = ShopgateLogger::OBFUSCATION_STRING;
     // prepare response data array
     $this->responseData['pong'] = 'OK';
     $this->responseData['configuration'] = $config;
     $this->responseData['plugin_info'] = $this->plugin->createPluginInfo();
     $this->responseData['permissions'] = $this->getPermissions();
     $this->responseData['php_version'] = phpversion();
     $this->responseData['php_config'] = $this->getPhpSettings();
     $this->responseData['php_curl'] = function_exists('curl_version') ? curl_version() : 'No PHP-CURL installed';
     $this->responseData['php_extensions'] = get_loaded_extensions();
     $this->responseData['shopgate_library_version'] = SHOPGATE_LIBRARY_VERSION;
     $this->responseData['plugin_version'] = defined('SHOPGATE_PLUGIN_VERSION') ? SHOPGATE_PLUGIN_VERSION : 'UNKNOWN';
     $this->responseData['shop_info'] = $this->plugin->createShopInfo();
     // set data and return response
     if (empty($this->response)) {
         $this->response = new ShopgatePluginApiResponseAppJson($this->trace_id);
     }
 }