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


PHP UploadBase::getMaxPhpUploadSize方法代码示例

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


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

示例1: str_replace

if ($wgMetaNamespace === false) {
    $wgMetaNamespace = str_replace(' ', '_', $wgSitename);
}
// Default value is 2000 or the suhosin limit if it is between 1 and 2000
if ($wgResourceLoaderMaxQueryLength === false) {
    $suhosinMaxValueLength = (int) ini_get('suhosin.get.max_value_length');
    if ($suhosinMaxValueLength > 0 && $suhosinMaxValueLength < 2000) {
        $wgResourceLoaderMaxQueryLength = $suhosinMaxValueLength;
    } else {
        $wgResourceLoaderMaxQueryLength = 2000;
    }
    unset($suhosinMaxValueLength);
}
// Ensure the minimum chunk size is less than PHP upload limits or the maximum
// upload size.
$wgMinUploadChunkSize = min($wgMinUploadChunkSize, UploadBase::getMaxUploadSize('file'), UploadBase::getMaxPhpUploadSize(), (wfShorthandToInteger(ini_get('post_max_size') ?: ini_get('hhvm.server.max_post_size'), PHP_INT_MAX) ?: PHP_INT_MAX) - 1024);
/**
 * Definitions of the NS_ constants are in Defines.php
 * @private
 */
$wgCanonicalNamespaceNames = [NS_MEDIA => 'Media', NS_SPECIAL => 'Special', NS_TALK => 'Talk', NS_USER => 'User', NS_USER_TALK => 'User_talk', NS_PROJECT => 'Project', NS_PROJECT_TALK => 'Project_talk', NS_FILE => 'File', NS_FILE_TALK => 'File_talk', NS_MEDIAWIKI => 'MediaWiki', NS_MEDIAWIKI_TALK => 'MediaWiki_talk', NS_TEMPLATE => 'Template', NS_TEMPLATE_TALK => 'Template_talk', NS_HELP => 'Help', NS_HELP_TALK => 'Help_talk', NS_CATEGORY => 'Category', NS_CATEGORY_TALK => 'Category_talk'];
/// @todo UGLY UGLY
if (is_array($wgExtraNamespaces)) {
    $wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + $wgExtraNamespaces;
}
// These are now the same, always
// To determine the user language, use $wgLang->getCode()
$wgContLanguageCode = $wgLanguageCode;
// Easy to forget to falsify $wgDebugToolbar for static caches.
// If file cache or CDN cache is on, just disable this (DWIMD).
if ($wgUseFileCache || $wgUseSquid) {
开发者ID:paladox,项目名称:mediawiki,代码行数:31,代码来源:Setup.php

示例2: getSourceSection

 /**
  * Get the descriptor of the fieldset that contains the file source
  * selection. The section is 'source'
  *
  * @return array Descriptor array
  */
 protected function getSourceSection()
 {
     if ($this->mSessionKey) {
         return array('SessionKey' => array('type' => 'hidden', 'default' => $this->mSessionKey), 'SourceType' => array('type' => 'hidden', 'default' => 'Stash'));
     }
     $canUploadByUrl = UploadFromUrl::isEnabled() && UploadFromUrl::isAllowed($this->getUser()) === true && $this->getConfig()->get('CopyUploadsFromSpecialUpload');
     $radio = $canUploadByUrl;
     $selectedSourceType = strtolower($this->getRequest()->getText('wpSourceType', 'File'));
     $descriptor = array();
     if ($this->mTextTop) {
         $descriptor['UploadFormTextTop'] = array('type' => 'info', 'section' => 'source', 'default' => $this->mTextTop, 'raw' => true);
     }
     $this->mMaxUploadSize['file'] = min(UploadBase::getMaxUploadSize('file'), UploadBase::getMaxPhpUploadSize());
     $help = $this->msg('upload-maxfilesize', $this->getContext()->getLanguage()->formatSize($this->mMaxUploadSize['file']))->parse();
     // If the user can also upload by URL, there are 2 different file size limits.
     // This extra message helps stress which limit corresponds to what.
     if ($canUploadByUrl) {
         $help .= $this->msg('word-separator')->escaped();
         $help .= $this->msg('upload_source_file')->parse();
     }
     $descriptor['UploadFile'] = array('class' => 'UploadSourceField', 'section' => 'source', 'type' => 'file', 'id' => 'wpUploadFile', 'radio-id' => 'wpSourceTypeFile', 'label-message' => 'sourcefilename', 'upload-type' => 'File', 'radio' => &$radio, 'help' => $help, 'checked' => $selectedSourceType == 'file');
     if ($canUploadByUrl) {
         $this->mMaxUploadSize['url'] = UploadBase::getMaxUploadSize('url');
         $descriptor['UploadFileURL'] = array('class' => 'UploadSourceField', 'section' => 'source', 'id' => 'wpUploadFileURL', 'radio-id' => 'wpSourceTypeurl', 'label-message' => 'sourceurl', 'upload-type' => 'url', 'radio' => &$radio, 'help' => $this->msg('upload-maxfilesize', $this->getContext()->getLanguage()->formatSize($this->mMaxUploadSize['url']))->parse() . $this->msg('word-separator')->escaped() . $this->msg('upload_source_url')->parse(), 'checked' => $selectedSourceType == 'url');
     }
     Hooks::run('UploadFormSourceDescriptors', array(&$descriptor, &$radio, $selectedSourceType));
     $descriptor['Extensions'] = array('type' => 'info', 'section' => 'source', 'default' => $this->getExtensionsMessage(), 'raw' => true);
     return $descriptor;
 }
开发者ID:Acidburn0zzz,项目名称:mediawiki,代码行数:35,代码来源:SpecialUpload.php


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