當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PSU::curl方法代碼示例

本文整理匯總了PHP中PSU::curl方法的典型用法代碼示例。如果您正苦於以下問題:PHP PSU::curl方法的具體用法?PHP PSU::curl怎麽用?PHP PSU::curl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PSU的用法示例。


在下文中一共展示了PSU::curl方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testCurlReadfile

 function testCurlReadfile()
 {
     ob_start();
     $f = PSU::curl(self::$url . '/e', PSU::READFILE);
     $get = ob_get_contents();
     ob_end_clean();
     $this->assertEquals('E', $get);
 }
開發者ID:AholibamaSI,項目名稱:plymouth-webapp,代碼行數:8,代碼來源:CurlTest.php

示例2: get_json_source

 /**
  * Method to grab JSON data from a feed source URL and return it as an array
  * @param string $url A string containing the url of the feed source
  */
 public function get_json_source($url)
 {
     // Set up the feed_data array
     $feed_data = array();
     // PSU::curl throws an exception if the document doesn't return a perfect 200 error
     try {
         // Get the JSON data with a CURL request to the url
         $feed_data = \PSU::curl($url, \PSU::FILE_GET_CONTENTS);
         // Return the JSON decoded as an array
         return json_decode($feed_data, true);
     } catch (\PSUToolsException $e) {
         // For now, lets just grab the exception and put it into the session
         $_SESSION['errors'][] = $e->getMessage();
     }
     return $feed_data;
 }
開發者ID:AholibamaSI,項目名稱:plymouth-webapp,代碼行數:20,代碼來源:Feed.php

示例3: __construct

 /**
  * workflow
  *
  * constructor initializes SOAP connection to the workflow wsdl
  *
  * @access		public
  * @since		version 0.1.0
  */
 function __construct($in = null)
 {
     if (is_null($in)) {
         if (PSU::isDev()) {
             $which = 'test';
             $domain = 'https://www.dev.plymouth.edu/';
         } else {
             $which = 'psc1';
             $domain = 'https://www.plymouth.edu/';
         }
     } else {
         $which = $in;
     }
     $this->_instance = $which;
     try {
         //$wsdl_url = "https://draco.plymouth.edu/wf".$this->_instance."/ws/services/WorkflowWS/v1_1?WSDL";
         $wsdl_url = $domain . "webapp/workflow/" . $this->_instance . ".wsdl.xml";
         if (PSU::curl($wsdl_url, PSU::FILE_GET_CONTENTS)) {
             $this->_client = new SoapClient($wsdl_url, array('trace' => 1, 'connection_timeout' => 5, 'cache_wsdl' => WSDL_CACHE_MEMORY));
         } else {
             return false;
         }
     } catch (Exception $e) {
         return false;
     }
     $this->_num_soap_calls++;
     include 'oracle/' . $this->_instance . '_wf_webservice.php';
     $this->_authentication = array('principal' => $_DB['oracle'][$this->_instance . '_wf_webservice']['username'], 'credential' => PSUSecurity::password_decode($_DB['oracle'][$this->_instance . '_wf_webservice']['password']));
     // auth string for lookup
 }
開發者ID:AholibamaSI,項目名稱:plymouth-webapp,代碼行數:38,代碼來源:workflow.class.php


注:本文中的PSU::curl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。