本文整理汇总了PHP中FileManager::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP FileManager::__construct方法的具体用法?PHP FileManager::__construct怎么用?PHP FileManager::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileManager
的用法示例。
在下文中一共展示了FileManager::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($options)
{
$this->scandir_alias_lu_arr = null;
$options = array_merge(array('Aliases' => null), is_array($options) ? $options : array());
parent::__construct($options);
/*
* Now process the Aliases array:
* it works as-is for transforming URI to FILE path, but we need
* to munch the list for scandir() to have fast access at the same info:
*
* here the goal is for scandir() to show the aliases as (fake) directory
* entries, hence we need to collect the aliases per parent directory:
*/
if (is_array($this->options['Aliases'])) {
$alias_arr = $this->options['Aliases'];
// collect the set of aliases per parent directory: we need a fully set up options['URLpath4FileManagedDirTree'] for this now
$scandir_lookup_arr = array();
// NOTE: we can use any of the url2file_path methods here as those only use the raw [Aliases] array
foreach ($alias_arr as $uri => $file) {
$isdir = !is_file($file);
$p_uri = parent::getParentDir($uri);
$a_name = basename($uri);
// as scandir works with filesystem paths, convert this URI path to a filesystem path:
$p_dir = $this->url_path2file_path($p_uri);
$p_dir = self::enforceTrailingSlash($p_dir);
if (!isset($scandir_lookup_arr[$p_dir])) {
$scandir_lookup_arr[$p_dir] = array(array(), array());
}
$scandir_lookup_arr[$p_dir][!$isdir][] = $a_name;
}
$this->scandir_alias_lu_arr = $scandir_lookup_arr;
}
}
示例2: assert
/**
* Constructor.
* Create a manager for handling issue files.
* @param $issueId int
*/
function __construct($issueId)
{
$issueDao = DAORegistry::getDAO('IssueDAO');
$issue = $issueDao->getById($issueId);
assert(isset($issue));
$this->setIssueId($issueId);
$this->setFilesDir(Config::getVar('files', 'files_dir') . '/journals/' . $issue->getJournalId() . '/issues/' . $issueId . '/');
parent::__construct();
}
示例3: __construct
/**
* Builds a new UploadManager storing files in the directory $dir, and
* using the prefix $prefix for filenames.
* @param string $dir
* @param string $prefix
*/
public function __construct($dir, $prefix)
{
parent::__construct($dir, $prefix, true, false);
}
示例4:
/**
* Constructor
*/
function __construct()
{
parent::__construct();
$this->filesDir = $this->getBasePath();
}
示例5: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
}