本文整理汇总了PHP中Server::SetTimeLimit方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::SetTimeLimit方法的具体用法?PHP Server::SetTimeLimit怎么用?PHP Server::SetTimeLimit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server
的用法示例。
在下文中一共展示了Server::SetTimeLimit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ZENDParseEmails
private function ZENDParseEmails(&$_reload, $mails, $_delete, $_test)
{
$list = array();
$message = null;
$starttime = time();
$executiontime = Server::SetTimeLimit(CALLER_TIMEOUT - 10);
$delete = array();
$subject = "";
try {
$counter = 0;
foreach ($mails as $mnum => $message) {
if ($_test) {
return count($mails);
}
try {
$temail = new TicketEmail();
if ($message->headerExists("subject")) {
$subject = $temail->Subject = mimeHeaderDecode($message->Subject);
}
if ($message->headerExists("message-id")) {
$temail->Id = str_replace(array("<", ">"), "", $message->MessageId);
}
if (empty($temail->Id)) {
$temail->Id = getId(32);
}
if ($_delete) {
$delete[$mnum] = $temail->Id;
}
if (strpos($message->From, "<") !== false) {
$fromparts = explode("<", str_replace(">", "", $message->From));
if (!empty($fromparts[0])) {
$temail->Name = str_replace(array("\""), "", mimeHeaderDecode(trim($fromparts[0])));
}
$temail->Email = trim($fromparts[1]);
} else {
$temail->Email = trim($message->From);
}
if (strpos($message->To, "<") !== false) {
$toparts = explode("<", str_replace(">", "", $message->To));
$temail->ReceiverEmail = trim($toparts[1]);
} else {
$temail->ReceiverEmail = trim($message->To);
}
if ($message->headerExists("reply-to")) {
if (strpos($message->ReplyTo, "<") !== false) {
$rtoparts = explode("<", str_replace(">", "", $message->ReplyTo));
$temail->ReplyTo = trim($rtoparts[1]);
} else {
$temail->ReplyTo = trim($message->ReplyTo);
}
}
$parts = array();
if ($message->isMultipart()) {
foreach (new RecursiveIteratorIterator($message) as $part) {
$parts[] = $part;
}
} else {
$parts[] = $message;
}
foreach ($parts as $part) {
try {
if ($part->headerExists("content-type")) {
$ctype = $part->contentType;
} else {
$ctype = 'text/html';
}
if ($part->headerExists("content-disposition")) {
$ctype .= "; " . $part->contentDisposition;
}
$charset = "";
$hparts = explode(";", str_replace(" ", "", $ctype));
foreach ($hparts as $hpart) {
if (strpos(strtolower($hpart), "charset=") === 0) {
$charset = trim(str_replace(array("charset=", "'", "\""), "", strtolower($hpart)));
}
}
$isatt = strpos(strtolower($ctype), "name=") !== false || strpos(strtolower($ctype), "filename=") !== false;
if (DEBUG_MODE) {
Logging::GeneralLog(" PROCESSING EMAIL / charset:" . $ctype . " - " . $charset . " - " . $subject . " - " . $isatt);
}
if (!$isatt && (($html = strpos(strtolower($ctype), 'text/html') !== false) || strpos(strtolower($ctype), 'text/plain') !== false)) {
$content = $part->getContent();
foreach ($part->getHeaders() as $name => $value) {
if (strpos(strtolower($name), 'content-transfer-encoding') !== false && strpos(strtolower($value), 'quoted-printable') !== false) {
$content = quoted_printable_decode($content);
} else {
if (strpos(strtolower($name), 'content-transfer-encoding') !== false && strpos(strtolower($value), 'base64') !== false) {
$content = base64_decode($content);
}
}
}
if ($html) {
$temail->BodyHTML = max($temail->BodyHTML, $content);
$content = MailSystem::DownConvertHTML($content);
}
if ((!$html || empty($temail->Body)) && !empty($content)) {
if (strpos(strtolower($charset), 'utf-8') === false && !empty($charset)) {
if (DEBUG_MODE) {
Logging::GeneralLog(" PROCESSING EMAIL / iconv | " . strtoupper($charset) . " | " . 'UTF-8' . " | " . $subject);
}
//.........这里部分代码省略.........
示例2: SaveVisitorListToFile
function SaveVisitorListToFile()
{
Server::SetTimeLimit(300);
if ($this->CreateVisitorList) {
IOStruct::CreateFile($this->GetFilename(true, true), $this->GetUsersHTML(), true, false, true);
}
}
示例3: define
define("SAFE_MODE", @ini_get('safe_mode'));
define("LIVEZILLA_PATH", "./");
@error_reporting(E_ALL);
require LIVEZILLA_PATH . "_definitions/definitions.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php";
require LIVEZILLA_PATH . "_lib/functions.global.inc.php";
require LIVEZILLA_PATH . "_lib/objects.devices.inc.php";
define("ACCESSTIME", SystemTime::GetRuntime());
if (Server::IsServerSetup()) {
CacheManager::Flush();
}
Server::DefineURL(FILE_SERVER_FILE);
Operator::PrepareConnection();
require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php";
Server::InitDataProvider();
Server::SetTimeLimit(Server::$Configuration->File["timeout_clients"]);
@ini_set('session.use_cookies', '0');
if (DEBUG_MODE) {
@ini_set('display_errors', '1');
}
@set_error_handler("handleError");
header("Access-Control-Allow-Origin: *");
$getRequest = Communication::GetParameterAlias("rqst");
if (isset($_POST[POST_INTERN_REQUEST]) || !empty($getRequest)) {
if (DB_CONNECTION && STATS_ACTIVE) {
Server::InitStatisticProvider();
}
if (DB_CONNECTION && $getRequest == CALLER_TYPE_TRACK) {
define("CALLER_TYPE", CALLER_TYPE_TRACK);
define("CALLER_TIMEOUT", Server::$Configuration->File["timeout_track"]);
header("Keep-Alive: timeout=5, max=100");