当前位置: 首页>>代码示例>>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;未经允许,请勿转载。