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; } }
/** * 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(); }
/** * 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); }
/** * Constructor */ function __construct() { parent::__construct(); $this->filesDir = $this->getBasePath(); }
/** * Constructor */ public function __construct() { parent::__construct(); }