本文整理汇总了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);
}
示例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;
}
示例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
}