本文整理汇总了PHP中LogPage::makeParamBlob方法的典型用法代码示例。如果您正苦于以下问题:PHP LogPage::makeParamBlob方法的具体用法?PHP LogPage::makeParamBlob怎么用?PHP LogPage::makeParamBlob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogPage
的用法示例。
在下文中一共展示了LogPage::makeParamBlob方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addEntry
/**
* Add a log entry
*
* @param $action String: one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'
* @param $target Title object
* @param $comment String: description associated
* @param $params Array: parameters passed later to wfMsg.* functions
* @param $doer User object: the user doing the action
*/
public function addEntry($action, $target, $comment, $params = array(), $doer = null)
{
if (!is_array($params)) {
$params = array($params);
}
if ($comment === null) {
$comment = '';
}
$this->action = $action;
$this->target = $target;
$this->comment = $comment;
$this->params = LogPage::makeParamBlob($params);
if ($doer === null) {
global $wgUser;
$doer = $wgUser;
} elseif (!is_object($doer)) {
$doer = User::newFromId($doer);
}
$this->doer = $doer;
$this->actionText = LogPage::actionText($this->type, $action, $target, null, $params);
return $this->saveContent();
}
示例2: addEntry
/**
* Add a log entry
*
* @param string $action One of '', 'block', 'protect', 'rights', 'delete',
* 'upload', 'move', 'move_redir'
* @param Title $target Title object
* @param string $comment Description associated
* @param array $params Parameters passed later to wfMessage function
* @param null|int|User $doer The user doing the action. null for $wgUser
*
* @return int The log_id of the inserted log entry
*/
public function addEntry($action, $target, $comment, $params = array(), $doer = null)
{
global $wgContLang;
if (!is_array($params)) {
$params = array($params);
}
if ($comment === null) {
$comment = '';
}
# Trim spaces on user supplied text
$comment = trim($comment);
# Truncate for whole multibyte characters.
$comment = $wgContLang->truncate($comment, 255);
$this->action = $action;
$this->target = $target;
$this->comment = $comment;
$this->params = LogPage::makeParamBlob($params);
if ($doer === null) {
global $wgUser;
$doer = $wgUser;
} elseif (!is_object($doer)) {
$doer = User::newFromId($doer);
}
$this->doer = $doer;
$logEntry = new ManualLogEntry($this->type, $action);
$logEntry->setTarget($target);
$logEntry->setPerformer($doer);
$logEntry->setParameters($params);
// All log entries using the LogPage to insert into the logging table
// are using the old logging system and therefore the legacy flag is
// needed to say the LogFormatter the parameters have numeric keys
$logEntry->setLegacy(true);
$formatter = LogFormatter::newFromEntry($logEntry);
$context = RequestContext::newExtraneousContext($target);
$formatter->setContext($context);
$this->actionText = $formatter->getPlainActionText();
$this->ircActionText = $formatter->getIRCActionText();
return $this->saveContent();
}
示例3: addEntry
/**
* Add a log entry
* @param string $action one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'
* @param object &$target A title object.
* @param string $comment Description associated
* @param array $params Parameters passed later to wfMsg.* functions
*/
function addEntry($action, $target, $comment, $params = array())
{
if (!is_array($params)) {
$params = array($params);
}
$this->action = $action;
$this->target = $target;
$this->comment = $comment;
$this->params = LogPage::makeParamBlob($params);
$this->actionText = LogPage::actionText($this->type, $action, $target, NULL, $params);
return $this->saveContent();
}
示例4: addEntry
/**
* Add a log entry
*
* @param $action String: one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'
* @param $target Title object
* @param $comment String: description associated
* @param $params Array: parameters passed later to wfMessage function
* @param $doer User object: the user doing the action
*
* @return int log_id of the inserted log entry
*/
public function addEntry($action, $target, $comment, $params = array(), $doer = null)
{
global $wgContLang;
if (!is_array($params)) {
$params = array($params);
}
if ($comment === null) {
$comment = '';
}
# Truncate for whole multibyte characters.
$comment = $wgContLang->truncate($comment, 255);
$this->action = $action;
$this->target = $target;
$this->comment = $comment;
$this->params = LogPage::makeParamBlob($params);
if ($doer === null) {
global $wgUser;
$doer = $wgUser;
} elseif (!is_object($doer)) {
$doer = User::newFromId($doer);
}
$this->doer = $doer;
$logEntry = new ManualLogEntry($this->type, $action);
$logEntry->setTarget($target);
$logEntry->setPerformer($doer);
$logEntry->setParameters($params);
$formatter = LogFormatter::newFromEntry($logEntry);
$context = RequestContext::newExtraneousContext($target);
$formatter->setContext($context);
$this->actionText = $formatter->getPlainActionText();
$this->ircActionText = $formatter->getIRCActionText();
return $this->saveContent();
}
示例5: expandDatabaseRow
protected function expandDatabaseRow($data, $legacy)
{
return ['log_type' => $data['type'], 'log_action' => $data['action'], 'log_timestamp' => isset($data['timestamp']) ? $data['timestamp'] : wfTimestampNow(), 'log_user' => isset($data['user']) ? $data['user'] : 0, 'log_user_text' => isset($data['user_text']) ? $data['user_text'] : 'User', 'log_namespace' => isset($data['namespace']) ? $data['namespace'] : NS_MAIN, 'log_title' => isset($data['title']) ? $data['title'] : 'Main_Page', 'log_page' => isset($data['page']) ? $data['page'] : 0, 'log_comment' => isset($data['comment']) ? $data['comment'] : '', 'log_params' => $legacy ? LogPage::makeParamBlob($data['params']) : LogEntryBase::makeParamBlob($data['params']), 'log_deleted' => isset($data['deleted']) ? $data['deleted'] : 0];
}