当前位置: 首页>>代码示例>>PHP>>正文


PHP CEventLog类代码示例

本文整理汇总了PHP中CEventLog的典型用法代码示例。如果您正苦于以下问题:PHP CEventLog类的具体用法?PHP CEventLog怎么用?PHP CEventLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CEventLog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addRecord

 /**
  * @param int $level Record level.
  * @param string $type Record type.
  * @param string $itemId Identifier of record object.
  * @param string $description Record description.
  * @return bool
  * @throws \Bitrix\Main\SystemException
  */
 public function addRecord($level, $type, $itemId, $description)
 {
     if ($this->logLevel < $level || $level == static::LOG_LEVEL_DISABLE) {
         return false;
     }
     if (!array_key_exists($level, $this->severities)) {
         throw new SystemException("Unknown type of severity: " . $level . ". " . __METHOD__);
     }
     $eventLog = new \CEventLog();
     return $eventLog->Add(array("SEVERITY" => $this->severities[$level], "AUDIT_TYPE_ID" => $type, "MODULE_ID" => "sale", "ITEM_ID" => $itemId, "DESCRIPTION" => $description));
 }
开发者ID:Satariall,项目名称:izurit,代码行数:19,代码来源:logger.php

示例2: dbg2EventLog

 /**
  * @param mixed                 $data
  * @param bool | string | false $die
  * @param string                $msg
  *
  * @return null
  */
 public static function dbg2EventLog($data, $die = false, $msg = 'DEBUG')
 {
     if (!is_bool($die)) {
         $msg = $die;
         $die = false;
     }
     $sDebug = self::_debugmessage($data);
     $oEventLog = new \CEventLog();
     $oEventLog->Add(array("SEVERITY" => "SECURITY", "AUDIT_TYPE_ID" => "DEBUG_MESSAGE", "MODULE_ID" => "DEBUG", "ITEM_ID" => $msg, "DESCRIPTION" => $sDebug));
     if ($die && self::isValidIP()) {
         die;
     }
 }
开发者ID:Varfann,项目名称:bx-features,代码行数:20,代码来源:dbg.php

示例3: getEventsLog

 /**
  * Return array with events list and users
  *
  * @param int $iblockId Info-block ID
  * @param int $elementId Info-block element ID
  * @param int $limit Limit returned rows
  * @return array (EVENTS => array(), USERS => array())
  */
 public static function getEventsLog($iblockId, $elementId, $limit = 0)
 {
     $arEvents = array();
     $arUsersId = array();
     $arUsers = array();
     $limit = intval($limit);
     if ($limit > 0) {
         $rsEventsNav = array('nTopCount' => $limit);
     } else {
         $rsEventsNav = false;
     }
     $rsEvents = \CEventLog::GetList(array('ID' => 'DESC'), array('MODULE_ID' => 'iblock', 'ITEM_ID' => $iblockId), $rsEventsNav);
     while ($arEvent = $rsEvents->Fetch()) {
         $arEventDesc = unserialize($arEvent['DESCRIPTION']);
         if ($arEventDesc['ID'] === $elementId) {
             $arEvents[] = array_merge($arEvent, array('DESCRIPTION' => $arEventDesc));
             $arUsersId[] = $arEventDesc['USER_ID'];
         }
     }
     if (!empty($arUsersId)) {
         $rsUsers = \CUser::GetList($by = 'id', $order = 'asc', array('ID' => $arUsersId), array('FIELDS' => array('ID', 'LOGIN', 'NAME', 'LAST_NAME')));
         while ($arUser = $rsUsers->Fetch()) {
             $arUsers[$arUser['ID']] = $arUser;
         }
     }
     return array('EVENTS' => $arEvents, 'USERS' => $arUsers);
 }
开发者ID:ASDAFF,项目名称:nik.elementary,代码行数:35,代码来源:helpers.php

示例4: custom_mail

 /**
  * @see CEvent::HandleEvent()
  * @see bxmail()
  *
  * @param string $to
  * @param string $subject
  * @param string $message
  * @param string $additionalHeaders Additional headers setted by Bitrix.
  *
  * @return bool
  */
 function custom_mail($to, $subject, $message, $additionalHeaders = '')
 {
     // Cache to send many mails in one script run.
     static $transport, $sender;
     try {
         if (!$sender) {
             if (!$transport) {
                 $host = COption::GetOptionString('sh.mailtransport', 'host');
                 if (COption::GetOptionInt('sh.mailtransport', 'ssl')) {
                     $host = 'ssl://' . $host;
                 }
                 $port = COption::GetOptionInt('sh.mailtransport', 'port');
                 $user = COption::GetOptionString('sh.mailtransport', 'username');
                 $password = COption::GetOptionString('sh.mailtransport', 'password');
                 $transport = new Net_SMTP($host, $port);
                 if (PEAR::isError($connectionResult = $transport->connect())) {
                     throw new Capall_MailTransportException($connectionResult);
                 }
                 // TODO Server without authentication?..
                 if (PEAR::isError($authenticationResult = $transport->auth($user, $password))) {
                     throw new Capall_MailTransportException($authenticationResult);
                 }
             }
             $sender = new Capall_MailTransport_Sender($transport);
         }
         $sender->send($to, $subject, $message, $additionalHeaders);
         return true;
     } catch (Capall_MailTransportException $error) {
         CEventLog::Log('WARNING', 'MAILTRANSPORT_ERROR', 'sh.mailtransport', null, $error->__toString());
         return false;
     } catch (Exception $error) {
         // Unknown error...
         return false;
     }
 }
开发者ID:alexeyshockov,项目名称:bitrix-mail-transport,代码行数:46,代码来源:include.php

示例5: BXCreateSection

function BXCreateSection(&$fileContent, &$sectionFileContent, &$absoluteFilePath, &$sectionPath)
{
    //Check quota
    $quota = new CDiskQuota();
    if (!$quota->CheckDiskQuota(array("FILE_SIZE" => strlen($fileContent) + strlen($sectionFileContent)))) {
        $GLOBALS["APPLICATION"]->ThrowException($quota->LAST_ERROR, "BAD_QUOTA");
        return false;
    }
    $io = CBXVirtualIo::GetInstance();
    //Create dir
    if (!$io->CreateDirectory($absoluteFilePath)) {
        $GLOBALS["APPLICATION"]->ThrowException(GetMessage("PAGE_NEW_FOLDER_CREATE_ERROR") . "<br /> (" . htmlspecialcharsbx($absoluteFilePath) . ")", "DIR_NOT_CREATE");
        return false;
    }
    //Create .section.php
    $f = $io->GetFile($absoluteFilePath . "/.section.php");
    if (!$GLOBALS["APPLICATION"]->SaveFileContent($absoluteFilePath . "/.section.php", $sectionFileContent)) {
        return false;
    }
    //Create index.php
    if (!$GLOBALS["APPLICATION"]->SaveFileContent($absoluteFilePath . "/index.php", $fileContent)) {
        return false;
    } else {
        if (COption::GetOptionString($module_id, "log_page", "Y") == "Y") {
            $res_log['path'] = $sectionPath . "/index.php";
            CEventLog::Log("content", "PAGE_ADD", "main", "", serialize($res_log));
        }
    }
    return true;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:30,代码来源:file_new.php

示例6: put

 public function put()
 {
     if ($this->_stateSaved) {
         throw new \Exception("Log instance saved before");
     }
     $this->_stateSaved = true;
     return \CEventLog::Log($this->_severity, $this->_type, $this->_moduleId, $this->_itemId, $this->_description);
 }
开发者ID:Under5,项目名称:bitrix-module-tools,代码行数:8,代码来源:log.php

示例7: Log

 static function Log($object, $action, $id, $description)
 {
     if (!COption::GetOptionString("webdav", "webdav_log", "N") == "Y") {
         return;
     }
     $type = CWebDavEventLog::_name($object, $action);
     CEventLog::Log("NOTICE", $type, "webdav", $id, $description);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:event_log.php

示例8: addRecord

 /**
  * @param $level
  * @param $auditType
  * @param $itemId
  * @param $description
  * @return bool
  */
 public static function addRecord($level, $auditType, $itemId, $description)
 {
     if ($level == self::LOG_LEVEL_ERROR) {
         $severity = "ERROR";
     } elseif ($level == self::LOG_LEVEL_INFO) {
         $severity = "INFO";
     } elseif ($level == self::LOG_LEVEL_DEBUG) {
         $severity = "DEBUG";
     } else {
         $severity = "UNKNOWN";
     }
     \CEventLog::Add(array("SEVERITY" => $severity, "AUDIT_TYPE_ID" => $auditType, "MODULE_ID" => "scale", "ITEM_ID" => $itemId, "DESCRIPTION" => $description));
     return true;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:21,代码来源:logger.php

示例9: Request

 function Request($server, $page, $port, $params, $uri = false)
 {
     if ($uri && strlen($uri) > 0) {
         $strURI = $uri;
     } else {
         $strURI = "http://" . $server . (strlen($port) > 0 && intval($port) > 0 ? ":" . intval($port) : "") . (strlen($page) ? $page : "/") . (strlen($params) > 0 ? "?" . $params : "");
     }
     $http = new \Bitrix\Main\Web\HttpClient(array("version" => "1.0", "socketTimeout" => 30, "streamTimeout" => 30, "redirect" => true, "redirectMax" => 5));
     $strData = $http->get($strURI);
     $errors = $http->getError();
     $arRSSResult = array();
     if (!$strData && !empty($errors)) {
         $strError = "";
         foreach ($errors as $errorCode => $errMes) {
             $strError .= $errorCode . ": " . $errMes;
         }
         \CEventLog::Add(array("SEVERITY" => "ERROR", "AUDIT_TYPE_ID" => "XDIMPORT_HTTP", "MODULE_ID" => "xdimport", "ITEM_ID" => "RSS_REQUEST", "DESCRIPTION" => $strError));
     }
     if ($strData) {
         $rss_charset = "windows-1251";
         if (preg_match("/<" . "\\?XML[^>]{1,}encoding=[\"']([^>\"']{1,})[\"'][^>]{0,}\\?" . ">/i", $strData, $matches)) {
             $rss_charset = Trim($matches[1]);
         }
         $strData = preg_replace("/<" . "\\?XML.*?\\?" . ">/i", "", $strData);
         $strData = $GLOBALS["APPLICATION"]->ConvertCharset($strData, $rss_charset, SITE_CHARSET);
     }
     if (strlen($strData) > 0) {
         require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/xml.php";
         $objXML = new CDataXML();
         $res = $objXML->LoadString($strData);
         if ($res !== false) {
             $ar = $objXML->GetArray();
             if (is_array($ar) && isset($ar["rss"]) && is_array($ar["rss"]) && isset($ar["rss"]["#"]) && is_array($ar["rss"]["#"]) && isset($ar["rss"]["#"]["channel"]) && is_array($ar["rss"]["#"]["channel"]) && isset($ar["rss"]["#"]["channel"][0]) && is_array($ar["rss"]["#"]["channel"][0]) && isset($ar["rss"]["#"]["channel"][0]["#"])) {
                 $arRSSResult = $ar["rss"]["#"]["channel"][0]["#"];
             } else {
                 $arRSSResult = array();
             }
             $arRSSResult["rss_charset"] = strtolower(SITE_CHARSET);
         }
     }
     if (is_array($arRSSResult) && !empty($arRSSResult)) {
         $arRSSResult = CXDILFSchemeRSS::FormatArray($arRSSResult);
         if (!empty($arRSSResult) && array_key_exists("item", $arRSSResult) && is_array($arRSSResult["item"]) && !empty($arRSSResult["item"])) {
             $arRSSResult["item"] = array_reverse($arRSSResult["item"]);
         }
     }
     return $arRSSResult;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:48,代码来源:lf_scheme_rss.php

示例10: Log

 function Log($object, $action, $id, $description = "", $title = "")
 {
     if (COption::GetOptionString("forum", "LOGS", "Q") <= "A") {
         return false;
     }
     $arTypesTitle = array("FORUM_MESSAGE_APPROVE" => GetMessage("FORUM_MESSAGE_APPROVE"), "FORUM_MESSAGE_UNAPPROVE" => GetMessage("FORUM_MESSAGE_UNAPPROVE"), "FORUM_MESSAGE_MOVE" => GetMessage("FORUM_MESSAGE_MOVE"), "FORUM_MESSAGE_EDIT" => GetMessage("FORUM_MESSAGE_EDIT"), "FORUM_MESSAGE_DELETE" => GetMessage("FORUM_MESSAGE_DELETE"), "FORUM_MESSAGE_SPAM" => GetMessage("FORUM_MESSAGE_SPAM"), "FORUM_TOPIC_APPROVE" => GetMessage("FORUM_TOPIC_APPROVE"), "FORUM_TOPIC_UNAPPROVE" => GetMessage("FORUM_TOPIC_UNAPPROVE"), "FORUM_TOPIC_STICK" => GetMessage("FORUM_TOPIC_STICK"), "FORUM_TOPIC_UNSTICK" => GetMessage("FORUM_TOPIC_UNSTICK"), "FORUM_TOPIC_OPEN" => GetMessage("FORUM_TOPIC_OPEN"), "FORUM_TOPIC_CLOSE" => GetMessage("FORUM_TOPIC_CLOSE"), "FORUM_TOPIC_MOVE" => GetMessage("FORUM_TOPIC_MOVE"), "FORUM_TOPIC_EDIT" => GetMessage("FORUM_TOPIC_EDIT"), "FORUM_TOPIC_DELETE" => GetMessage("FORUM_TOPIC_DELETE"), "FORUM_TOPIC_SPAM" => GetMessage("FORUM_TOPIC_SPAM"), "FORUM_FORUM_EDIT" => GetMessage("FORUM_FORUM_EDIT"), "FORUM_FORUM_DELETE" => GetMessage("FORUM_FORUM_DELETE"));
     $object = strToUpper($object);
     $action = strToUpper($action);
     $type = "FORUM_" . $object . "_" . $action;
     $title = trim($title);
     if (empty($title)) {
         $title = $arTypesTitle[$type];
     }
     $description = trim($description);
     CEventLog::Log("NOTICE", $type, "forum", $id, $description);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:16,代码来源:event_log.php

示例11: doLog

 /**
  * @param string $severity
  * @param string $auditType
  * @param string $itemName
  * @param string $itemDescription
  * @return bool
  */
 public function doLog($severity, $auditType, $itemName, $itemDescription)
 {
     $savedInDB = $savedInFile = $savedInSyslog = false;
     if ($this->isDBEngineActive) {
         $savedInDB = CEventLog::log($severity, $auditType, "security", $itemName, base64_encode($itemDescription));
     }
     $message = "";
     if ($this->isSyslogEngineActive) {
         $message = $this->messageFormatter->format($auditType, $itemName, $itemDescription);
         $savedInSyslog = syslog($this->syslogPriority, $message);
     }
     if ($this->isFileEngineActive) {
         if (!$message) {
             $message = $this->messageFormatter->format($auditType, $itemName, $itemDescription);
         }
         $message .= "\n";
         $savedInFile = file_put_contents($this->filePath, $message, FILE_APPEND) > 0;
     }
     return $savedInDB || $savedInSyslog || $savedInFile;
 }
开发者ID:spas-viktor,项目名称:books,代码行数:27,代码来源:event.php

示例12: foreach

             $arOffersOldFields = CIBlock::GetFields($OF_IBLOCK_ID);
             $arOffersFields["FIELDS"] = $arOffersOldFields;
             foreach ($arLogFields as $keyLogField => $valueLogField) {
                 $arOffersFields["FIELDS"][$keyLogField] = $valueLogField;
             }
         }
         $obIBlock = new CIBlock();
         $mxOffersID = $obIBlock->Update($OF_IBLOCK_ID, $arOffersFields);
         if (false == $mxOffersID) {
             $strWarning .= $obIBlock->LAST_ERROR . "<br>";
             $bVarsFromForm = true;
         } else {
             $res_log = array();
             $res_log['NAME'] = CIBlock::GetArrayByID($OF_IBLOCK_ID, 'NAME');
             if (COption::GetOptionString("iblock", "event_log_iblock", "N") === "Y") {
                 CEventLog::Log("IBLOCK", "IBLOCK_EDIT", "iblock", $OF_IBLOCK_ID, serialize($res_log));
             }
         }
     } else {
         $strWarning .= str_replace(array('#ID#'), array($OF_IBLOCK_ID), GetMessage('IB_E_RIGHTS_IBLOCK_ACCESS_DENIED')) . '<br>';
         $bVarsFromForm = true;
     }
 }
 if (!$bVarsFromForm) {
     $arSKUProp = CheckSKUProperty($ID, $OF_IBLOCK_ID);
     if ('OK' == $arSKUProp['RESULT']) {
         $intSKUPropID = $arSKUProp['VALUE'];
     } else {
         $bVarsFromForm = true;
         $strWarning .= $arSKUProp['MESSAGE'] . '<br>';
     }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:iblock_edit.php

示例13: unserialize

        $abs_path = $DOC_ROOT . $path;
    }
    if (strlen($strWarning) <= 0) {
        if ($REQUEST_METHOD == "POST" && strlen($save) > 0 && is_array($ids) && check_bitrix_sessid()) {
            CFileMan::SaveMenu(array($site, $menufilename), $aMenuLinksTmp, $sMenuTemplateTmp);
            $bEdit = true;
            $module_id = "fileman";
            if (COption::GetOptionString($module_id, "log_menu", "Y") == "Y") {
                $mt = COption::GetOptionString("fileman", "menutypes", $default_value, $site);
                $mt = unserialize(str_replace("\\", "", $mt));
                $res_log['menu_name'] = $mt[$name];
                $res_log['path'] = substr($path, 1);
                if (strlen($new) <= 0) {
                    CEventLog::Log("content", "MENU_EDIT", "fileman", "", serialize($res_log));
                } else {
                    CEventLog::Log("content", "MENU_ADD", "fileman", "", serialize($res_log));
                }
            }
            if (strlen($apply) <= 0) {
                if (strlen($back_url) > 0) {
                    LocalRedirect("/" . ltrim($back_url, "/"));
                } else {
                    LocalRedirect("/bitrix/admin/fileman_admin.php?" . $addUrl . "&site=" . $site . "&path=" . UrlEncode($path));
                }
            } else {
                LocalRedirect("/bitrix/admin/fileman_menu_edit.php?" . $addUrl . "&site=" . $site . "&path=" . UrlEncode($path) . "&name=" . $name);
            }
        }
    }
}
if ($bEdit) {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:fileman_menu_edit.php

示例14: GetMessage

					$strWarning = GetMessage("pub_src_edit_err");
				}
			}
			else
			{
				$bEdit = true;
				CUndo::ShowUndoMessage(CUndo::Add($arUndoParams));

				$module_id = "fileman";
				if(COption::GetOptionString($module_id, "log_page", "Y")=="Y")
				{
					$res_log['path'] = substr($path, 1);
					CEventLog::Log(
						"content",
						"PAGE_EDIT",
						"main",
						"",
						serialize($res_log),
						$_REQUEST["site"]
					);
				}

				if (CAutoSave::Allowed())
					$AUTOSAVE->Reset();
			}

			if(strlen($strWarning)<=0)
			{
?>
<script type="text/javascript" bxrunfirst="true">
top.BX.showWait();
top.BX.reload('<?php 
开发者ID:ASDAFF,项目名称:open_bx,代码行数:32,代码来源:file_edit_src.php

示例15: Start

	function Start()
	{
		$this->test_percent = 100; // by default

		ob_start();
		try
		{
			$this->result = call_user_func(array($this,$this->function));
		}
		catch (Exception $e)
		{
			$this->Result(null, GetMessage("MAIN_SC_TEST_IS_INCORRECT"));
			echo $e->getMessage();
		}
		$this->strError = ob_get_clean();

		if (!$this->strResult)
			$this->Result($this->result);

		if (!$this->fix_mode)
		{
			// write to log
			if (@$this->OpenLog())
			{
				$text = date('Y-M-d H:i:s') . ' ' . $this->strCurrentTestName . ' (' . $this->function . "): " . $this->LogResult . "\n";
				if ($this->test_percent < 100)
					$text .= $this->test_percent.'% done' . "\n";

				if ($this->strError)
				{
					$text .= str_replace('<br>', "\n", $this->strError)."\n";
				}

				if ($this->test_percent >= 100) // test finished
					$text .= preg_replace('#<[^<>]+>#','',$this->strResult)."\n";

				$text = htmlspecialchars_decode($text);

				fwrite($this->LogResourse, $text);
			}
		}

		$this->last_function = $this->function;
		$this->percent = floor(($this->step + $this->test_percent / 100) / count($this->arTest) * 100);

		if ($this->test_percent >= 100) // test finished
		{
			if ($this->step + 1 < count($this->arTest))
			{
				$this->step++;
				$this->test_percent = 0;
				$this->arTestVars['last_value'] = '';
				list($this->function, $this->strNextTestName) = each($this->arTest[$this->step]);
			}
			else // finish
			{
				if (!$this->fix_mode) // if we have a kernel
				{
					COption::SetOptionString('main', 'site_checker_success', $this->arTestVars['site_checker_success']);
					CEventLog::Add(array(
						"SEVERITY" => "WARNING",
						"AUDIT_TYPE_ID" => $this->arTestVars['site_checker_success'] == 'Y' ? 'SITE_CHECKER_SUCCESS' : 'SITE_CHECKER_ERROR',
						"MODULE_ID" => "main",
						"ITEM_ID" => $_SERVER['DOCUMENT_ROOT'],
						"DESCRIPTION" => '',
					));
					if ($this->arTestVars['site_checker_success'] == 'Y')
						CAdminNotify::DeleteByTag('SITE_CHECKER');
				}
			}
		}
		elseif ($this->result === true)
			$this->strResult = ''; // in case of temporary result on this step

		if ($this->result === false)
			$this->arTestVars['site_checker_success'] = 'N';
	}
开发者ID:nycmic,项目名称:bittest,代码行数:77,代码来源:site_checker.php


注:本文中的CEventLog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。