本文整理汇总了PHP中Support::getServerURI方法的典型用法代码示例。如果您正苦于以下问题:PHP Support::getServerURI方法的具体用法?PHP Support::getServerURI怎么用?PHP Support::getServerURI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Support
的用法示例。
在下文中一共展示了Support::getServerURI方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fatal
} else {
fatal('Another instance of the script is still running for the specified account. ', "If this is not accurate, you may fix it by running this script with 'fix-lock=1'", "in the query string or you may unlock ALL accounts by running this script with 'fix-lock=1'", 'as the only parameter.');
}
exit;
}
// clear the lock in all cases of termination
function cleanup_lock()
{
global $account_id;
Lock::release('download_emails_' . $account_id);
}
register_shutdown_function('cleanup_lock');
$account = Email_Account::getDetails($account_id);
$mbox = Support::connectEmailServer($account);
if ($mbox == false) {
$uri = Support::getServerURI($account);
$login = $account['ema_username'];
$error = imap_last_error();
fatal("{$error}\n", "Could not connect to the email server '{$uri}' with login: '{$login}'.", 'Please verify your email account settings and try again.');
}
// if we only want new emails
if ($account['ema_get_only_new']) {
$new_emails = Support::getNewEmails($mbox);
foreach ($new_emails as $new_email) {
Support::getEmailInfo($mbox, $account, $new_email);
}
} else {
$total_emails = Support::getTotalEmails($mbox);
if ($total_emails > 0) {
for ($i = 1; $i <= $total_emails; $i++) {
Support::getEmailInfo($mbox, $account, $i);
示例2: connectEmailServer
/**
* Method used to connect to the provided email server.
*
* @access public
* @param array $info The email server information
* @return resource The email server connection
*/
function connectEmailServer($info)
{
$mbox = @imap_open(Support::getServerURI($info), $info['ema_username'], $info['ema_password']);
if ($mbox === FALSE) {
$errors = @imap_errors();
if (strstr(strtolower($errors[0]), 'certificate failure')) {
$mbox = @imap_open(Support::getServerURI($info, TRUE), $info['ema_username'], $info['ema_password']);
} else {
Error_Handler::logError('Error while connecting to the email server - ' . $errors[0], __FILE__, __LINE__);
}
}
return $mbox;
}