本文整理汇总了PHP中ArchivedFile::getTimestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP ArchivedFile::getTimestamp方法的具体用法?PHP ArchivedFile::getTimestamp怎么用?PHP ArchivedFile::getTimestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArchivedFile
的用法示例。
在下文中一共展示了ArchivedFile::getTimestamp方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showFileConfirmationForm
/**
* Show a form confirming whether a tokenless user really wants to see a file
* @param string $key
*/
private function showFileConfirmationForm($key)
{
$out = $this->getOutput();
$lang = $this->getLanguage();
$user = $this->getUser();
$file = new ArchivedFile($this->mTargetObj, '', $this->mFilename);
$out->addWikiMsg('undelete-show-file-confirm', $this->mTargetObj->getText(), $lang->userDate($file->getTimestamp(), $user), $lang->userTime($file->getTimestamp(), $user));
$out->addHTML(Xml::openElement('form', array('method' => 'POST', 'action' => $this->getPageTitle()->getLocalURL(array('target' => $this->mTarget, 'file' => $key, 'token' => $user->getEditToken($key))))) . Xml::submitButton($this->msg('undelete-show-file-submit')->text()) . '</form>');
}
示例2: archivedfileLine
/**
* @param ArchivedFile $file
* @returns string
*/
private function archivedfileLine($file)
{
global $wgLang;
$target = $this->page->getPrefixedText();
$date = $wgLang->timeanddate($file->getTimestamp(), true);
$undelete = SpecialPage::getTitleFor('Undelete');
$pageLink = $this->skin->makeKnownLinkObj($undelete, $date, "target={$target}&file={$file->getKey()}");
$del = '';
if ($file->isDeleted(File::DELETED_FILE)) {
$del = ' <tt>' . wfMsgHtml('deletedrev') . '</tt>';
}
$data = wfMsg('widthheight', $wgLang->formatNum($file->getWidth()), $wgLang->formatNum($file->getHeight())) . ' (' . wfMsgExt('nbytes', 'parsemag', $wgLang->formatNum($file->getSize())) . ')';
$data = htmlspecialchars($data);
return "<li> {$pageLink} " . $this->fileUserTools($file) . " {$data} " . $this->fileComment($file) . "{$del}</li>";
}
示例3: scrubVersion
protected function scrubVersion(ArchivedFile $archivedFile)
{
$key = $archivedFile->getStorageKey();
$name = $archivedFile->getName();
$ts = $archivedFile->getTimestamp();
$repo = RepoGroup::singleton()->getLocalRepo();
$path = $repo->getZonePath('deleted') . '/' . $repo->getDeletedHashPath($key) . $key;
if ($this->hasOption('delete')) {
$status = $repo->getBackend()->delete(['src' => $path]);
if ($status->isOK()) {
$this->output("Deleted version '{$key}' ({$ts}) of file '{$name}'\n");
} else {
$this->output("Failed to delete version '{$key}' ({$ts}) of file '{$name}'\n");
$this->output(print_r($status->getErrorsArray(), true));
}
} else {
$this->output("Would delete version '{$key}' ({$ts}) of file '{$name}'\n");
}
}
示例4: showFileConfirmationForm
/**
* Show a form confirming whether a tokenless user really wants to see a file
*/
private function showFileConfirmationForm($key)
{
$file = new ArchivedFile($this->mTargetObj, '', $this->mFilename);
$this->getOutput()->addWikiMsg('undelete-show-file-confirm', $this->mTargetObj->getText(), $this->getLang()->date($file->getTimestamp()), $this->getLang()->time($file->getTimestamp()));
$this->getOutput()->addHTML(Xml::openElement('form', array('method' => 'POST', 'action' => $this->getTitle()->getLocalURL('target=' . urlencode($this->mTarget) . '&file=' . urlencode($key) . '&token=' . urlencode($this->getUser()->editToken($key))))) . Xml::submitButton(wfMsg('undelete-show-file-submit')) . '</form>');
}
示例5: showFileConfirmationForm
/**
* Show a form confirming whether a tokenless user really wants to see a file
*/
private function showFileConfirmationForm($key)
{
global $wgOut, $wgUser, $wgLang;
$file = new ArchivedFile($this->mTargetObj, '', $this->mFile);
$wgOut->addWikiMsg('undelete-show-file-confirm', $this->mTargetObj->getText(), $wgLang->date($file->getTimestamp()), $wgLang->time($file->getTimestamp()));
$wgOut->addHTML(Xml::openElement('form', array('method' => 'POST', 'action' => SpecialPage::getTitleFor('Undelete')->getLocalUrl('target=' . urlencode($this->mTarget) . '&file=' . urlencode($key) . '&token=' . urlencode($wgUser->editToken($key))))) . Xml::submitButton(wfMsg('undelete-show-file-submit')) . '</form>');
}