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


PHP FileRepo::__construct方法代码示例

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


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

示例1: isset

 function __construct($info)
 {
     parent::__construct($info);
     global $wgUploadDirectory;
     // http://commons.wikimedia.org/w/api.php
     $this->mApiBase = isset($info['apibase']) ? $info['apibase'] : null;
     $this->directory = isset($info['directory']) ? $info['directory'] : $wgUploadDirectory;
     if (isset($info['apiThumbCacheExpiry'])) {
         $this->apiThumbCacheExpiry = $info['apiThumbCacheExpiry'];
     }
     if (isset($info['fileCacheExpiry'])) {
         $this->fileCacheExpiry = $info['fileCacheExpiry'];
     }
     if (!$this->scriptDirUrl) {
         // hack for description fetches
         $this->scriptDirUrl = dirname($this->mApiBase);
     }
     // If we can cache thumbs we can guess sane defaults for these
     if ($this->canCacheThumbs() && !$this->url) {
         global $wgLocalFileRepo;
         $this->url = $wgLocalFileRepo['url'];
     }
     if ($this->canCacheThumbs() && !$this->thumbUrl) {
         $this->thumbUrl = $this->url . '/thumb';
     }
     if (isset($info['thumbDir'])) {
         $this->thumbDir = $info['thumbDir'];
     } else {
         $this->thumbDir = "{$this->directory}/thumb";
     }
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:31,代码来源:ForeignAPIRepo.php

示例2: isset

 function __construct($info)
 {
     parent::__construct($info);
     // Required settings
     $this->directory = isset($info['directory']) ? $info['directory'] : "http://s3.amazonaws.com/" . $info['wgUploadS3Bucket'] . "/" . $info['wgUploadDirectory'];
     $this->AWS_ACCESS_KEY = $info['AWS_ACCESS_KEY'];
     $this->AWS_SECRET_KEY = $info['AWS_SECRET_KEY'];
     $this->AWS_S3_BUCKET = $info['AWS_S3_BUCKET'];
     $this->cloudFrontUrl = $info['cloudFrontUrl'];
     $this->cloudFrontDirectory = $this->cloudFrontUrl . ($this->directory ? $this->directory : $info['wgUploadDirectory']);
     $this->AWS_S3_SSL = isset($info['AWS_S3_SSL']) ? $info['AWS_S3_SSL'] : true;
     // Optional settings
     $this->AWS_S3_PUBLIC = isset($info['AWS_S3_PUBLIC']) ? $info['AWS_S3_PUBLIC'] : false;
     $this->url = isset($info['url']) ? $info['url'] : ($this->AWS_S3_SSL ? "https://" : "http://") . "s3.amazonaws.com/" . $this->AWS_S3_BUCKET . "/" . $this->directory;
     $this->hashLevels = isset($info['hashLevels']) ? $info['hashLevels'] : 2;
     $this->deletedHashLevels = isset($info['deletedHashLevels']) ? $info['deletedHashLevels'] : $this->hashLevels;
     $this->deletedDir = isset($info['deletedDir']) ? $info['deletedDir'] : false;
     $this->fileMode = isset($info['fileMode']) ? $info['fileMode'] : 0644;
     if (isset($info['thumbDir'])) {
         $this->thumbDir = $info['thumbDir'];
     } else {
         $this->thumbDir = "{$this->directory}/thumb";
     }
     if (isset($info['thumbUrl'])) {
         $this->thumbUrl = $info['thumbUrl'];
     } else {
         $this->thumbUrl = "{$this->url}/thumb";
     }
     $this->urlbase = $info['urlbase'];
 }
开发者ID:CpuID,项目名称:LocalS3Repo,代码行数:30,代码来源:FSs3Repo.php

示例3: isset

 function __construct(array $info = null)
 {
     parent::__construct($info);
     $this->hasSha1Storage = isset($info['storageLayout']) && $info['storageLayout'] === 'sha1';
     if ($this->hasSha1Storage()) {
         $this->backend = new FileBackendDBRepoWrapper(array('backend' => $this->backend, 'repoName' => $this->name, 'dbHandleFactory' => $this->getDBFactory()));
     }
 }
开发者ID:rugby110,项目名称:mediawiki,代码行数:8,代码来源:LocalRepo.php

示例4: dirname

 function __construct($info)
 {
     parent::__construct($info);
     $this->mApiBase = $info['apibase'];
     // http://commons.wikimedia.org/w/api.php
     if (!$this->scriptDirUrl) {
         // hack for description fetches
         $this->scriptDirUrl = dirname($this->mApiBase);
     }
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:10,代码来源:ForeignAPIRepo.php

示例5: isset

 function __construct($info)
 {
     parent::__construct($info);
     // Required settings
     $this->directory = $info['directory'];
     $this->url = $info['url'];
     // Optional settings
     $this->hashLevels = isset($info['hashLevels']) ? $info['hashLevels'] : 2;
     $this->deletedHashLevels = isset($info['deletedHashLevels']) ? $info['deletedHashLevels'] : $this->hashLevels;
     $this->deletedDir = isset($info['deletedDir']) ? $info['deletedDir'] : false;
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:11,代码来源:FSRepo.php

示例6: isset

 /**
  * @param $info array
  * @throws MWException
  */
 function __construct(array $info)
 {
     if (!isset($info['backend'])) {
         // B/C settings...
         $directory = $info['directory'];
         $deletedDir = isset($info['deletedDir']) ? $info['deletedDir'] : false;
         $thumbDir = isset($info['thumbDir']) ? $info['thumbDir'] : "{$directory}/thumb";
         $fileMode = isset($info['fileMode']) ? $info['fileMode'] : 0644;
         $repoName = $info['name'];
         // Get the FS backend configuration
         $backend = new FSFileBackend(array('name' => $info['name'] . '-backend', 'lockManager' => 'fsLockManager', 'containerPaths' => array("{$repoName}-public" => "{$directory}", "{$repoName}-temp" => "{$directory}/temp", "{$repoName}-thumb" => $thumbDir, "{$repoName}-deleted" => $deletedDir), 'fileMode' => $fileMode));
         // Update repo config to use this backend
         $info['backend'] = $backend;
     }
     parent::__construct($info);
     if (!$this->backend instanceof FSFileBackend) {
         throw new MWException("FSRepo only supports FSFileBackend.");
     }
 }
开发者ID:nischayn22,项目名称:mediawiki-core,代码行数:23,代码来源:FSRepo.php

示例7: dirname

 function __construct($info)
 {
     parent::__construct($info);
     $this->mApiBase = $info['apibase'];
     // http://commons.wikimedia.org/w/api.php
     if (isset($info['apiThumbCacheExpiry'])) {
         $this->apiThumbCacheExpiry = $info['apiThumbCacheExpiry'];
     }
     if (!$this->scriptDirUrl) {
         // hack for description fetches
         $this->scriptDirUrl = dirname($this->mApiBase);
     }
     // If we can cache thumbs we can guess sane defaults for these
     if ($this->canCacheThumbs() && !$this->url) {
         global $wgLocalFileRepo;
         $this->url = $wgLocalFileRepo['url'];
     }
     if ($this->canCacheThumbs() && !$this->thumbUrl) {
         $this->thumbUrl = $this->url . '/thumb';
     }
 }
开发者ID:rocLv,项目名称:conference,代码行数:21,代码来源:ForeignAPIRepo.php

示例8: isset

 function __construct($info)
 {
     parent::__construct($info);
     // Required settings
     $this->directory = $info['directory'];
     $this->url = $info['url'];
     // Optional settings
     $this->hashLevels = isset($info['hashLevels']) ? $info['hashLevels'] : 2;
     $this->deletedHashLevels = isset($info['deletedHashLevels']) ? $info['deletedHashLevels'] : $this->hashLevels;
     $this->deletedDir = isset($info['deletedDir']) ? $info['deletedDir'] : false;
     $this->fileMode = isset($info['fileMode']) ? $info['fileMode'] : 0644;
     if (isset($info['thumbDir'])) {
         $this->thumbDir = $info['thumbDir'];
     } else {
         $this->thumbDir = "{$this->directory}/thumb";
     }
     if (isset($info['thumbUrl'])) {
         $this->thumbUrl = $info['thumbUrl'];
     } else {
         $this->thumbUrl = "{$this->url}/thumb";
     }
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:22,代码来源:FSRepo.php

示例9: __construct

	function __construct( $info ) {
		// We don't call parent::_construct because it requires $this->directory,
		// which doesn't exist in Swift.
		FileRepo::__construct( $info );

		// Required settings
		$this->url = $info['url'];

		// Optional settings
		$this->hashLevels = isset( $info['hashLevels'] ) ? $info['hashLevels'] : 2;
		$this->deletedHashLevels = isset( $info['deletedHashLevels'] ) ?
			$info['deletedHashLevels'] : $this->hashLevels;

		// This relationship is also hard-coded in rewrite.py, another part of this
		// extension. If you want to change this here, you might have to change it
		// there, too.
		$this->thumbUrl = "{$this->url}/thumb";

		// we don't have directories
		$this->deletedDir = false;

		// Required settings
		$this->swiftuser = $info['user'];
		$this->swiftkey = $info['key'];
		$this->authurl = $info['authurl'];
		$this->container = $info['container'];
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:27,代码来源:SwiftMedia.body.php


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