本文整理汇总了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";
}
}
示例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'];
}
示例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()));
}
}
示例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);
}
}
示例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;
}
示例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.");
}
}
示例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';
}
}
示例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";
}
}
示例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'];
}