本文整理汇总了PHP中API::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP API::getInstance方法的具体用法?PHP API::getInstance怎么用?PHP API::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类API
的用法示例。
在下文中一共展示了API::getInstance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$this->sysKrn->krn_audit_log(AUDIT_APPLICATION, __DIR__, __FILE__, __LINE__, __CLASS__, __METHOD__, __FUNCTION__, "Send AJAX ---> API: " . $URL);
/*
// SOLO SI NO FUNCIONA CURL get_content_curl
// Creamos el flujo para la llamada
$HEADER_OPTIONS = array(
'http'=>array(
'timeout' => 1200,
'method'=>"GET",
'header'=>"Accept-language: es\r\n" .
"Cookie: Cookie_Agent_API\r\n" . // check function.stream-context-create on php.net
"User-Agent: HTTP_USER_AGENT_API\r\n" // i.e. An iPad
)
);
// Creamos el contexto
$CONTEXT = stream_context_create( $HEADER_OPTIONS );
$RESPONSE = file_get_contents ( $URL, false, $CONTEXT );
*/
// Hacemos la llamada a q.php con los parámetros de URL
// Hemos puesto el timeout a 1200 para la llamada a q.php?q=... que a veces se va de madre
$DATA = array("local" => "1", "q" => base64_encode($JSON));
$RESPONSE = $this->get_content_curl($URL, 'GET');
$this->sysKrn->krn_audit_log(AUDIT_APPLICATION, __DIR__, __FILE__, __LINE__, __CLASS__, __METHOD__, __FUNCTION__, "Send API ---> AJAX: " . $RESPONSE['content']);
echo $RESPONSE['content'];
}
}
$A = API::getInstance();
echo $A->echoAPI();
?>
示例2: addClassToBody
public function addClassToBody(&$str, $layout)
{
if (API::getInstance()->isEnabled() && 'dashboard' === $layout) {
$str .= ' leftMenuPlugin';
}
}
示例3: getTrackerHosts
/**
* Returns the hosts alias URLs
* @param int $idSite
* @return array
*/
private function getTrackerHosts($idSite)
{
$urls = API::getInstance()->getSiteUrlsFromId($idSite);
$hosts = array();
foreach ($urls as $url) {
$url = parse_url($url);
if (isset($url['host'])) {
$hosts[] = $url['host'];
}
}
return $hosts;
}
示例4: save
/**
* Save the record to Fulcrum.
*/
public function save()
{
if (!is_null($this->objStdRecord)) {
if ($this->getId() != "") {
$objReturn = API::getInstance()->updateRecord($this->getId(), $this->objStdRecord);
} else {
$objReturn = API::getInstance()->insertRecord($this->objStdRecord);
}
}
return $objReturn;
}
示例5: API
public function API()
{
return API::getInstance();
}
示例6: createRecord
/**
* Create a new record for this form.
*
* @param array $arrFields An array with values for fields in the new record.
* @return \Fulcrum\Record
*/
public function createRecord($arrFields, $strApiKey = null)
{
$objReturn = null;
if (!is_null($this->objStdForm)) {
$arrFormFields = $this->mapFieldsToKeys($arrFields);
$arrSettings = array("record" => array("longitude" => isset($arrFields["location"]["lng"]) ? $arrFields["location"]["lng"] : -68.89904, "latitude" => isset($arrFields["location"]["lat"]) ? $arrFields["location"]["lat"] : 12.115844, "form_id" => $this->objStdForm->id, "form_values" => $arrFormFields));
if (isset($arrFields["assigned_to_id"])) {
$arrSettings["assigned_to_id"] = $arrFields["assigned_to_id"];
}
$objReturn = API::getInstance()->createRecord($arrSettings, $strApiKey);
}
return $objReturn;
}