本文整理汇总了PHP中api::printError方法的典型用法代码示例。如果您正苦于以下问题:PHP api::printError方法的具体用法?PHP api::printError怎么用?PHP api::printError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api
的用法示例。
在下文中一共展示了api::printError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$clientId = isset($_POST['clientId']) ? $_POST['clientId'] : 0;
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : '';
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$profileId = isset($_POST['profileId']) ? $_POST['profileId'] : '';
$chatId = isset($_POST['chatId']) ? $_POST['chatId'] : 0;
$msgId = isset($_POST['msgId']) ? $_POST['msgId'] : 0;
$clientId = helper::clearInt($clientId);
$accountId = helper::clearInt($accountId);
$profileId = helper::clearInt($profileId);
$chatId = helper::clearInt($chatId);
$msgId = helper::clearInt($msgId);
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$messages = new messages($dbo);
$messages->setRequestFrom($accountId);
if ($chatId == 0) {
$chatId = $messages->getChatId($accountId, $profileId);
}
if ($chatId != 0) {
$result = $messages->getPreviousMessages($chatId, $msgId);
}
echo json_encode($result);
exit;
}
示例2: array
$facebookId = helper::clearText($facebookId);
$gcm_regId = helper::clearText($gcm_regId);
$username = helper::clearText($username);
$fullname = helper::clearText($fullname);
$password = helper::clearText($password);
$email = helper::clearText($email);
$language = helper::clearText($language);
$facebookId = helper::escapeText($facebookId);
$gcm_regId = helper::escapeText($gcm_regId);
$username = helper::escapeText($username);
$fullname = helper::escapeText($fullname);
$password = helper::escapeText($password);
$email = helper::escapeText($email);
$language = helper::escapeText($language);
if ($clientId != CLIENT_ID) {
api::printError(ERROR_UNKNOWN, "Error client Id.");
}
$result = array("error" => true);
$account = new account($dbo);
$result = $account->signup($username, $fullname, $password, $email, $user_sex, $user_year, $user_month, $user_day);
unset($account);
if ($result['error'] === false) {
$account = new account($dbo);
$account->setState(ACCOUNT_STATE_ENABLED);
$account->setLastActive();
$result = $account->signin($username, $password);
unset($account);
if ($result['error'] === false) {
$auth = new auth($dbo);
$result = $auth->create($result['accountId'], $clientId);
if ($result['error'] === false) {