本文整理汇总了PHP中AddMessage2Log函数的典型用法代码示例。如果您正苦于以下问题:PHP AddMessage2Log函数的具体用法?PHP AddMessage2Log怎么用?PHP AddMessage2Log使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AddMessage2Log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param string $message The message to be shown in trace. If set to false, the default message for this class of exception will be used.
* @param mixed[] $data An array of special data. Could be:
* <li>AUX MESSAGE string|mixed[] String to be attached to the end of the message in round brackets
* <li>AUX ERROR mixed[] An array structure to be dumped with AddMessage2Log(), accompanied with unique-exception-id to be able to establish matching
* <li>ERROR \Bitrix\Tasks\Util\Error\Collection|string[] A collection or string array of high-level errors to show to user
* @param mixed[] $additional Some additional things, usually unused
*/
public function __construct($message = false, array $data = array(), array $additional = array())
{
if (!empty($data)) {
$this->data = $data;
}
if (!empty($additional)) {
$this->additional = $additional;
}
if ($message === false) {
$message = $this->getDefaultMessage();
}
$this->messageOrigin = $message;
if (!isset($additional['FILE'])) {
$additional['FILE'] = '';
}
$additional['LINE'] = intval($additional['LINE']);
$additional['CODE'] = intval($additional['CODE']);
if (!isset($additional['PREVIOUS_EXCEPTION'])) {
$additional['PREVIOUS_EXCEPTION'] = null;
}
$doDump = $this->dumpAuxError();
if ($doDump) {
$exceptionId = uniqid('', true);
if (isset($this->data['AUX']['ERROR'])) {
if (!is_array($this->data['AUX']['ERROR'])) {
$this->data['AUX']['ERROR'] = array((string) $this->data['AUX']['ERROR']);
}
AddMessage2Log('Exception additional data: ' . $exceptionId . ': ' . serialize($this->data['AUX']['ERROR']), 'tasks');
}
}
parent::__construct(($doDump ? $exceptionId . ': ' : '') . $this->prepareMessage($message), $additional['CODE'], $additional['FILE'], $additional['LINE'], $additional['PREVIOUS_EXCEPTION']);
}
示例2: logArray
function logArray()
{
$arArgs = func_get_args();
$strResult = '';
foreach ($arArgs as $arArg) {
$strResult .= "\n\n" . print_r($arArg, true);
}
if (!defined('LOG_FILENAME')) {
define('LOG_FILENAME', $_SERVER['DOCUMENT_ROOT'] . '/bitrix/log.txt');
}
AddMessage2Log($strResult, 'logArray -> ');
}
示例3: Query
public static function Query($strSql, $error_position)
{
global $SECURITY_SESSION_DBH;
if (!is_resource($SECURITY_SESSION_DBH)) {
CSecurityDB::Init(true);
}
if (is_resource($SECURITY_SESSION_DBH)) {
$strSql = preg_replace("/^\\s*SELECT\\s+(?!GET_LOCK|RELEASE_LOCK)/i", "SELECT SQL_NO_CACHE ", $strSql);
$result = @mysql_query($strSql, $SECURITY_SESSION_DBH);
if ($result) {
return $result;
} else {
$db_Error = mysql_error();
AddMessage2Log($error_position . " MySql Query Error: " . $strSql . " [" . $db_Error . "]", "security");
}
}
return false;
}
示例4: OnBeforeUserUpdateHandler
function OnBeforeUserUpdateHandler(&$arFields)
{
if (isset($arFields['UF_GROUPS']) && in_array(1, $arFields['UF_GROUPS'])) {
$user = CUser::GetByID($arFields['ID'])->Fetch();
if (!in_array(1, $user['UF_GROUPS'])) {
AddMessage2Log('update users');
CModule::IncludeModule("iblock");
CIBlockElement::SetPropertyValues(1, 4, getKentLabUsers(), "USERS");
$groups = CUser::GetUserGroup($user['UF_USER_PARENT']);
$fields = array_flip(getValuesList('UF_STATUS', 'USER', 'ID'));
if (intval($user['UF_USER_PARENT']) > 0 && $fields[$user['UF_STATUS']] == 4) {
if (in_array(8, $groups)) {
changeUserStatus($user['ID'], $user['UF_USER_PARENT'], $user['UF_STATUS'], 6, "Регистрация в KENT Lab");
}
}
}
}
}
示例5: beforeLogFormat
/**
* Called before record transformed for log writing.
*
* @param array &$record Database record.
*
* @return void
*/
public function beforeLogFormat(array &$record)
{
global $USER;
if ($record["PARAM_NAME"] !== "FILE_ID" || $record["PARAM_VALUE"] <= 0) {
return;
}
if (!\Bitrix\Main\Loader::includeModule('disk')) {
AddMessage2Log('MessageParamHandler::beforeLogFormat: failed to load disk module.');
return;
}
if (!is_object($USER) || $USER->GetID() < 0) {
AddMessage2Log('MessageParamHandler::beforeLogFormat: no user provided.');
return;
}
/** @var \Bitrix\Disk\File $file */
$fileId = $record["PARAM_VALUE"];
$userId = $USER->GetID();
$file = \Bitrix\Disk\File::loadById($fileId);
if (!$file) {
AddMessage2Log('MessageParamHandler::beforeLogFormat: file (' . $fileId . ') not found for user (' . $userId . ').');
return;
}
$externalLink = $file->addExternalLink(array('CREATED_BY' => $userId, 'TYPE' => \Bitrix\Disk\Internals\ExternalLinkTable::TYPE_MANUAL));
if (!$externalLink) {
AddMessage2Log('MessageParamHandler::beforeLogFormat: failed to get external link for file (' . $fileId . ').');
AddMessage2Log($file->getErrors());
return;
}
$url = \Bitrix\Disk\Driver::getInstance()->getUrlManager()->getUrlExternalLink(array('hash' => $externalLink->getHash(), 'action' => 'default'), true);
$fileName = $file->getName();
$fileSize = $file->getSize();
$attach = new \CIMMessageParamAttach(null, \CIMMessageParamAttach::CHAT);
$attach->AddFiles(array(array("NAME" => $fileName, "LINK" => $url, "SIZE" => $fileSize)));
$record["PARAM_NAME"] = 'ATTACH';
$record["PARAM_VALUE"] = 1;
$record["PARAM_JSON"] = $attach->GetJSON();
}
示例6: call
public function call($methodName, $additionalParams = null)
{
global $APPLICATION;
if (!$this->access_token) {
$interface = Service::getEngine()->getInterface();
if (!$interface->checkAccessToken()) {
if ($interface->getNewAccessToken()) {
Service::getEngine()->setAuthSettings($interface->getResult());
} else {
return $interface->getResult();
}
}
$this->access_token = $interface->getToken();
}
if ($this->access_token) {
if (!is_array($additionalParams)) {
$additionalParams = array();
} else {
$additionalParams = $APPLICATION->ConvertCharsetArray($additionalParams, LANG_CHARSET, "utf-8");
}
$additionalParams['auth'] = $this->access_token;
$http = new HttpClient(array('socketTimeout' => $this->httpTimeout));
$result = $http->post(CBitrixSeoOAuthInterface::URL . self::SERVICE_URL . $methodName, $additionalParams);
/* AddMessage2Log(array(
CBitrixSeoOAuthInterface::URL.self::SERVICE_URL.$methodName,
$additionalParams,
$http->getStatus(),
$result,
));*/
$res = $this->prepareAnswer($result);
if (!$res) {
AddMessage2Log('Strange answer from Seo! ' . $http->getStatus() . ' ' . $result);
}
return $res;
} else {
throw new SystemException("No access token");
}
}
示例7: array
$arDefaultUrlTemplates404 = array("sections" => "", "section" => "#SECTION_ID#/", "element" => "#SECTION_ID#/#ELEMENT_ID#/", "compare" => "compare.php?action=COMPARE", "smart_filter" => $smartBase . "filter/#SMART_FILTER_PATH#/apply/");
$arDefaultVariableAliases404 = array();
$arDefaultVariableAliases = array();
$arComponentVariables = array("SECTION_ID", "SECTION_CODE", "ELEMENT_ID", "ELEMENT_CODE", "action");
if ($arParams["SEF_MODE"] == "Y") {
$arVariables = array();
$engine = new CComponentEngine($this);
if (\Bitrix\Main\Loader::includeModule('iblock')) {
$engine->addGreedyPart("#SECTION_CODE_PATH#");
$engine->addGreedyPart("#SMART_FILTER_PATH#");
$engine->setResolveCallback(array("CIBlockFindTools", "resolveComponentEngine"));
}
$arUrlTemplates = CComponentEngine::MakeComponentUrlTemplates($arDefaultUrlTemplates404, $arParams["SEF_URL_TEMPLATES"]);
$arVariableAliases = CComponentEngine::MakeComponentVariableAliases($arDefaultVariableAliases404, $arParams["VARIABLE_ALIASES"]);
$componentPage = $engine->guessComponentPath($arParams["SEF_FOLDER"], $arUrlTemplates, $arVariables);
AddMessage2Log($componentPage);
if ($componentPage === "smart_filter") {
$componentPage = "section";
}
if (!$componentPage && isset($_REQUEST["q"])) {
$componentPage = "search";
}
$b404 = false;
if (!$componentPage) {
$componentPage = "sections";
$b404 = true;
}
if ($componentPage == "section") {
if (isset($arVariables["SECTION_ID"])) {
$b404 |= intval($arVariables["SECTION_ID"]) . "" !== $arVariables["SECTION_ID"];
} else {
示例8: moderateBanners
public function moderateBanners($campaignId, array $bannerIDs)
{
if (empty($campaignId)) {
throw new ArgumentNullException("campaignId");
}
$queryData = array('CampaignID' => $campaignId, 'BannerIDS' => $bannerIDs);
$result = $this->getProxy()->getInterface()->moderateBanners(static::ENGINE_ID, $queryData);
AddMessage2Log($result);
if (!empty($result['error'])) {
throw new YandexDirectException($result);
}
return $result;
}
示例9: prepareFilter
//.........这里部分代码省略.........
case "<=DATE_CHANGE":
if(strlen($val) > 0)
$arWhere[] = "date_change <= ".intval(MakeTimeStamp($val)-CTimeZone::GetOffset());
break;
case ">=DATE_CHANGE":
if(strlen($val) > 0)
$arWhere[] = "date_change >= ".intval(MakeTimeStamp($val)-CTimeZone::GetOffset());
break;
case "SITE_ID":
if($val !== false)
{
if ($inSelect)
$arWhere[] = "in(site, ".sprintf("%u", crc32($val)).")";
else
$arWhere[] = "site = ".sprintf("%u", crc32($val));
}
break;
case "CHECK_DATES":
if($val == "Y")
{
$ts = time()-CTimeZone::GetOffset();
if ($inSelect)
{
$arWhere[] = "if(date_from, date_from, ".$ts.") <= ".$ts;
$arWhere[] = "if(date_to, date_to, ".$ts.") >= ".$ts;
}
else
{
$arWhere[] = "date_from_nvl <= ".$ts;
$arWhere[] = "date_to_nvl >= ".$ts;
}
}
break;
case "TAGS":
$arTags = explode(",", $val);
foreach($arTags as $i => &$strTag)
{
$strTag = trim($strTag, " \n\r\t\"");
if ($strTag == "")
unset($arTags[$i]);
}
unset($strTag);
$arWhere = array_merge($arWhere, $this->filterField("tags", $arTags, $inSelect));
break;
case "PARAMS":
if (is_array($val))
{
$params = $this->params($val);
if ($params != "")
{
if ($inSelect)
{
$arWhere[] = "in(param, ".$params.")";
}
else
{
foreach(explode(",", $params) as $param)
$arWhere[] = "param = ".$param;
}
}
}
break;
case "URL": //TODO
case "QUERY":
case "LIMIT":
case "USE_TF_FILTER":
break;
default:
if (is_numeric($field) && is_array($val))
{
$subFilter = $this->prepareFilter($val, true);
if (!empty($subFilter))
{
if (isset($subFilter["cond1"]))
$arWhere["cond1"][] = "(".implode(")and(", $subFilter).")";
else
$arWhere[] = "(".implode(")and(", $subFilter).")";
}
}
else
{
AddMessage2Log("field: $field; val: ".$val);
}
break;
}
}
if (isset($arWhere["cond1"]))
$arWhere["cond1"] = "(".implode(")and(", $arWhere["cond1"]).")";
if ($orLogic && !empty($arWhere))
{
$arWhere = array(
"cond1" => "(".implode(")or(", $arWhere).")"
);
}
return $arWhere;
}
示例10: onBeforeRestartBuffer
/**
* OnBeforeRestartBuffer event handler.
* Disables composite mode when called.
*
* @return void
*/
public static function onBeforeRestartBuffer()
{
self::setEnable(false);
if (defined("BX_COMPOSITE_DEBUG")) {
AddMessage2Log("RestartBuffer method was invoked\n" . "Request URI: " . $_SERVER["REQUEST_URI"] . "\n" . "Script: " . (isset($_SERVER["REAL_FILE_PATH"]) ? $_SERVER["REAL_FILE_PATH"] : $_SERVER["SCRIPT_NAME"]), "composite");
}
}
示例11: appendValue
/**
* Добавляет значение ко множественному свойству элемента инфоблока
*
* **Не работает со значениями-массивами**
*
* @param integer $elementId ID элемента инфоблока
* @param integer $iblockId ID инфоблока
* @param string $propertyCode Символьный код свойства
* @param string|integer $value Добавляемое значение
* @return boolean Всегда *true*
*/
function appendValue($elementId, $iblockId, $propertyCode, $value)
{
$failed = false;
if (!isElementOfIblock($elementId, $iblockId)) {
$failed = true;
}
if (!isPropertyOfIblock($propertyCode, $iblockId)) {
$failed = true;
}
if (is_array($value)) {
$failed = true;
}
if (!is_string($propertyCode)) {
$failed = true;
}
if ($failed === true) {
AddMessage2Log(print_r(array('element_id' => $elementId, 'iblock_id' => $iblockId, 'property_code' => $propertyCode, 'value' => $value), true));
return false;
}
$arValues = array();
$resCurrentValues = \CIBlockElement::GetProperty($iblockId, $elementId, 'sort', 'asc', array("CODE" => $propertyCode));
while ($arValue = $resCurrentValues->Fetch()) {
$arValues[$arValue["VALUE"]] = 1;
}
$arValues[$value] = 1;
\CIBlockElement::SetPropertyValuesEx($elementId, $iblockId, array($propertyCode => array_keys($arValues)));
return true;
}
示例12: ReportLog
public static function ReportLog( $title ='debug' , $data, $dump = false){
ob_start();
echo "\n$title\n\n". __FILE__ ."\n";
if( $dump == true){
var_dump ( $data);
}else{
print_r ( $data);
}
echo "\n ";
$toLog = ob_get_contents();
ob_end_clean();
AddMessage2Log("$toLog", " client class ");
}
示例13: IncludeTemplateLangFile
<?php
IncludeTemplateLangFile(__FILE__);
AddMessage2Log($APPLICATION->GetCurDir());
?>
<!DOCTYPE HTML>
<html lang="<?php
echo LANGUAGE_ID;
?>
">
<head>
<title><?php
$APPLICATION->ShowTitle();
?>
- компания «МСТ»</title>
<meta property="og:site_name" content="Ваш сайт" />
<meta property="og:locale" content="ru_RU" />
<meta property="og:title" content="<?php
$APPLICATION->ShowTitle();
?>
" />
<meta property="og:image" content="<?php
echo SITE_TEMPLATE_PATH;
?>
/images/logo.png" />
<link rel="index" title="Arenda-Yamobure.com" href="/" />
<meta name="application-name" content="Arenda-Yamobure.com" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
示例14: WriteElementUpdateDebug
function WriteElementUpdateDebug(&$arFields)
{
define("LOG_FILENAME", $_SERVER["DOCUMENT_ROOT"] . "/import_element_log.txt");
AddMessage2Log(print_r($arFields, true), "------------UPDATE-----------");
}
示例15: applyComponentFrameMode
/**
* Checks component frame mode
* @param string $context
*/
public static function applyComponentFrameMode($context = "")
{
if (defined("USE_HTML_STATIC_CACHE") && USE_HTML_STATIC_CACHE === true && \Bitrix\Main\Page\Frame::getInstance()->getCurrentDynamicId() === false) {
$staticHtmlCache = static::getInstance();
if (!$staticHtmlCache->isVotingEnabled()) {
return;
}
$staticHtmlCache->markNonCacheable();
if (defined("BX_COMPOSITE_DEBUG") && BX_COMPOSITE_DEBUG === true) {
AddMessage2Log("Reason: " . $context . "\n" . "Request URI: " . $_SERVER["REQUEST_URI"] . "\n" . "Script: " . (isset($_SERVER["REAL_FILE_PATH"]) ? $_SERVER["REAL_FILE_PATH"] : $_SERVER["SCRIPT_NAME"]), "Composite was rejected");
}
}
}