本文整理汇总了PHP中HTTPClient::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP HTTPClient::__construct方法的具体用法?PHP HTTPClient::__construct怎么用?PHP HTTPClient::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTPClient
的用法示例。
在下文中一共展示了HTTPClient::__construct方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sprintf
function __construct($accountid, $curl = null)
{
parent::__construct($curl);
$ProfileURL = sprintf(self::PROFILE_URL_TEMPLATE, $accountid);
$this->Fetch($ProfileURL);
$this->AccountID = $accountid;
}
示例2:
/**
* RPC Client Constructor
*
* @param string hostname
* @param string xml rpc username (optional)
* @param string xml rpc password (optional)
*/
function __construct($host, $user = "", $pass = "")
{
parent::__construct();
$host = str_replace("http://", "", $host);
if ($user) {
$host = "{$user}:{$pass}@{$host}";
}
$this->Host = "http://{$host}";
}
示例3:
/**
* Constructor.
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function __construct()
{
global $conf;
// call parent constructor
parent::__construct();
// set some values from the config
$this->proxy_host = $conf['proxy']['host'];
$this->proxy_port = $conf['proxy']['port'];
$this->proxy_user = $conf['proxy']['user'];
$this->proxy_pass = $conf['proxy']['pass'];
$this->proxy_ssl = $conf['proxy']['ssl'];
}
示例4: sprintf
/**
* Constructor
*
* @var int account ID
* @var resource CURL handler
*/
function __construct($accountid, $curl = null)
{
parent::__construct($curl);
$ProfileURL = sprintf(self::PROFILE_URL_TEMPLATE, $accountid);
$this->SetHeaders(array('Accept-Language: en-us,en;q=0.5'));
$this->SetTimeouts(60, 30);
$this->Fetch($ProfileURL);
$this->AccountID = $accountid;
}
示例5:
/**
* Constructor.
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function __construct()
{
global $conf;
// call parent constructor
parent::__construct();
// set some values from the config
$this->proxy_host = $conf['proxy']['host'];
$this->proxy_port = $conf['proxy']['port'];
$this->proxy_user = $conf['proxy']['user'];
$this->proxy_pass = conf_decodeString($conf['proxy']['pass']);
$this->proxy_ssl = $conf['proxy']['ssl'];
$this->proxy_except = $conf['proxy']['except'];
// allow enabling debugging via URL parameter (if debugging allowed)
if ($conf['allowdebug']) {
if (isset($_REQUEST['httpdebug']) || isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'httpdebug') !== false) {
$this->debug = true;
}
}
}
示例6:
/**
* Constructor
*/
function __construct()
{
parent::__construct();
}
示例7:
/**
* @param string $username API username allowed to post notification for this Manialink
* @param string $password API password
* @param string $manialink Short Manialink code
*/
function __construct($username, $password, $manialink)
{
parent::__construct($username, $password);
$this->manialink = $manialink;
}
示例8:
/**
* Sets shorter timeout
*/
function __construct()
{
parent::__construct();
$this->timeout = 8;
// slightly faster timeouts
}
示例9: __construct
/**
* Create the client.
* @param string $session_key if you haven't gotten a session key yet, leave
* this as null and then set it later by just directly accessing the
* $session_key member variable.
* @param bool $desktop set to true if you are a desktop client
*/
public function __construct($url, $api_key, $secret, $session_key = null, $desktop = false, $throw_errors = true)
{
parent::__construct();
$this->URL = $url;
$this->Secret = $secret;
$this->SessionKey = $session_key;
$this->API_Key = $api_key;
$this->IsDesktop = $desktop;
$this->ThrowErrors = $throw_errors;
$this->IsLastCallSuccess = true;
$this->LastError = array();
$this->ProfileFields = array("about_me", "affiliations", "birthday", "books",
"clubs", "current_location", "first_name", "gender", "hometown_location",
"hs_info", "interests", "last_name", "meeting_for", "meeting_sex", "pic",
"movies", "music", "name", "notes_count", "political", "profile_update_time",
"quote", "relationship_status", "religion", "school_info", "work_history",
"significant_other_id", "status", "timezone", "tv", "wall_count"
);
if ($this->DebugMode)
{
$this->CurID = 0;
echo "
<script type=\"text/javascript\">
var types = ['params', 'xml', 'php', 'sxml'];
function toggleDisplay(id, type) {
for each (var t in types) {
if (t != type || document.getElementById(t + id).style.display == 'block') {
document.getElementById(t + id).style.display = 'none';
} else {
document.getElementById(t + id).style.display = 'block';
}
}
return false;
}
</script>
";
}
}
示例10:
/**
* Constructor
*
* @var int account ID
* @var resource CURL handler
*/
function __construct($accountid, $curl = null)
{
parent::__construct($curl);
$this->AccountID = $accountid;
}