本文整理汇总了PHP中erLhcoreClassModelChatOnlineUser::executeRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassModelChatOnlineUser::executeRequest方法的具体用法?PHP erLhcoreClassModelChatOnlineUser::executeRequest怎么用?PHP erLhcoreClassModelChatOnlineUser::executeRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassModelChatOnlineUser
的用法示例。
在下文中一共展示了erLhcoreClassModelChatOnlineUser::executeRequest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeCustomer
public static function removeCustomer($instance)
{
$cfg = erConfigClassLhConfig::getInstance();
$secretHash = $cfg->getSetting('site', 'seller_secret_hash');
$hash = sha1($instance->id . date('Ym') . $secretHash);
$url = erConfigClassLhConfig::getInstance()->getSetting('site', 'http_mode') . $instance->address . '.' . $cfg->getSetting('site', 'seller_domain') . '/index.php/instance/remove/' . $instance->id . '/' . date('Ym') . '/' . $hash;
$response = erLhcoreClassModelChatOnlineUser::executeRequest($url);
$responseData = json_decode($response);
if (isset($responseData->error) && $responseData->error == false) {
self::deleteDatabase($instance->id);
return true;
} else {
throw new Exception('Instance removement failed');
}
}
示例2: foreach
<?php
/**
* Iterates through all instances and executes callback timeout
* At the moment it's a simple foreach. In the future we may need to enahance this part
* with some queues etc.
*
* php cron.php -s site_admin -e instance -c cron/extensions_update
* */
$cfg = erConfigClassLhConfig::getInstance();
$db = ezcDbInstance::get();
foreach (erLhcoreClassModelInstance::getList(array('limit' => 1000000, 'filter' => array('status' => erLhcoreClassModelInstance::WORKING))) as $instance) {
echo "Executing request to update instance internal structure for extensions - ", $instance->id, "\n";
$secretHash = $cfg->getSetting('site', 'seller_secret_hash');
$hash = sha1($instance->id . 'extensions' . date('Ym') . $secretHash);
if ($instance->full_domain == 1) {
$url = erConfigClassLhConfig::getInstance()->getSetting('site', 'http_mode') . $instance->address . '/index.php/instance/extensionsstructure/' . $instance->id . '/' . date('Ym') . '/' . $hash;
} else {
$url = erConfigClassLhConfig::getInstance()->getSetting('site', 'http_mode') . $instance->address . '.' . $cfg->getSetting('site', 'seller_domain') . '/index.php/instance/extensionsstructure/' . $instance->id . '/' . date('Ym') . '/' . $hash;
}
$response = erLhcoreClassModelChatOnlineUser::executeRequest($url);
echo "Response:\n";
print_r($response);
echo PHP_EOL;
}
示例3: json_encode
<?php
if ((string) $Params['user_parameters_unordered']['action'] == 'statusdb' || (string) $Params['user_parameters_unordered']['action'] == 'statusdbdoupdate') {
if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) {
echo json_encode(array('error' => 'true', 'result' => 'Invalid CSRF Token'));
exit;
}
$tpl = erLhcoreClassTemplate::getInstance('lhsystem/update/statusdb.tpl.php');
$contentData = erLhcoreClassModelChatOnlineUser::executeRequest('https://raw.githubusercontent.com/LiveHelperChat/livehelperchat/master/lhc_web/doc/update_db/structure.json');
if ((string) $Params['user_parameters_unordered']['action'] == 'statusdbdoupdate') {
erLhcoreClassUpdate::doTablesUpdate(json_decode($contentData, true));
}
$tables = erLhcoreClassUpdate::getTablesStatus(json_decode($contentData, true));
$tpl->set('tables', $tables);
echo json_encode(array('result' => $tpl->fetch()));
exit;
}
$tpl = erLhcoreClassTemplate::getInstance('lhsystem/update.tpl.php');
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode', 'System configuration')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/update', 'Live Helper Chat update information')));