本文整理汇总了PHP中Api::connect方法的典型用法代码示例。如果您正苦于以下问题:PHP Api::connect方法的具体用法?PHP Api::connect怎么用?PHP Api::connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Api
的用法示例。
在下文中一共展示了Api::connect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: opration
/**
* 七牛操作
* @method opration
* @param string $op [操作命令]
* @return bool [操作结果]
* @author NewFuture
*/
private static function opration($op)
{
$token = self::sign($op . PHP_EOL);
$url = self::QINIU_RS . $op;
$header = array('Authorization: QBox ' . $token);
if (($response = Api::connect($url, $header, 'POST')) && $response['header'][0] == 'HTTP/1.1 200 OK') {
return true;
} else {
/*操作出错*/
if (\Config::get('isdebug')) {
\PC::debug($response, '七牛请求出错');
}
\Log::write('七牛错误' . $url . ':' . json_encode($response, JSON_UNESCAPED_UNICODE), 'ERROR');
return false;
}
}
示例2: error_reporting
<?php
/* * *******************************************************************************
* The content of this file is subject to the MYC Vtiger Customer Portal license.
* ("License"); You may not use this file except in compliance with the License
* The Initial Developer of the Original Code is Proseguo s.l. - MakeYourCloud
* Portions created by Proseguo s.l. - MakeYourCloud are Copyright(C) Proseguo s.l. - MakeYourCloud
* All Rights Reserved.
* ****************************************************************************** */
$app_stus = "PRODUCTION";
//SET TO PRODUCTION TO DISABLE ERRORS
if ($app_stus == "PRODUCTION") {
error_reporting(0);
}
//Require all files necessary for the application to start, including user settings, soap library for enstablish the connection, and the portal classes
require_once "portal.php";
//Load the portal configuration if presents or run the wizard
PortalConfig::load();
//Establish the connection with the crm customer portal webservices
Portal::connect();
//Check if there are stored variables then if the user is previously logged or if has sent some login/forgot request, else provide him a logging screen
User::check_login();
//Start the vtlib api connection if parameters are given in the config file
Api::connect();
//Load the plugins from the plugins directory
Plugins::load_plugins();
//If the login is passed analyze the REQUEST and call the requested action.
Router::start();
示例3: is_connected
public static function is_connected()
{
global $api_client;
if (!isset($api_client) || $api_client == "NOT_CONFIGURED" || $api_client == "API_LOGIN_FAILED") {
Api::connect();
if (!isset($api_client) || $api_client == "NOT_CONFIGURED" || $api_client == "API_LOGIN_FAILED") {
return false;
} else {
return true;
}
} else {
return true;
}
}