Lines Matching +full:ini +full:- +full:file

82      * What is the largest file a user may upload?
86 $sizePostMax = $this->parseIniFileSize((string) ini_get('post_max_size'));
87 $sizeUploadMax = $this->parseIniFileSize((string) ini_get('upload_max_filesize'));
96 * Returns the given size from an ini value in bytes.
115 $number *= $units[substr($size, -1)] ?? 1;
118 // Probably a 32bit version of PHP, with an INI setting >= 2GB
135 ->where('m_file', '=', $tree->id())
136 ->where('multimedia_file_refn', 'NOT LIKE', 'http://%')
137 ->where('multimedia_file_refn', 'NOT LIKE', 'https://%')
138 ->pluck('multimedia_file_refn')
139 ->all();
141 $media_filesystem = $tree->mediaFilesystem();
142 …$disk_files = $this->allFilesOnDisk($media_filesystem, '', FilesystemReader::LIST_DEEP)->all…
151 * Store an uploaded file (or URL), either to be added to a media object
156 * @return string The value to be stored in the 'FILE' field of the media object.
161 $tree = Validator::attributes($request)->tree();
162 $file_location = Validator::parsedBody($request)->string('file_location');
166 $remote = Validator::parsedBody($request)->string('remote');
175 $unused = Validator::parsedBody($request)->string('unused');
177 if ($tree->mediaFilesystem()->fileExists($unused)) {
184 $folder = Validator::parsedBody($request)->string('folder');
185 $auto = Validator::parsedBody($request)->string('auto');
186 $new_file = Validator::parsedBody($request)->string('new_file');
188 $uploaded_file = $request->getUploadedFiles()['file'] ?? null;
190 if ($uploaded_file === null || $uploaded_file->getError() !== UPLOAD_ERR_OK) {
197 $file = $new_file;
199 $file = $uploaded_file->getClientFilename();
209 // Generate a unique name for the file?
210 if ($auto === '1' || $tree->mediaFilesystem()->fileExists($folder . $file)) {
212 $extension = pathinfo($uploaded_file->getClientFilename(), PATHINFO_EXTENSION);
213 $file = sha1((string) $uploaded_file->getStream()) . '.' . $extension;
217 … $tree->mediaFilesystem()->writeStream($folder . $file, $uploaded_file->getStream()->detach());
219 return $folder . $file;
221 … FlashMessages::addMessage(I18N::translate('There was an error uploading your file.'));
231 * Convert the media file attributes into GEDCOM format.
233 * @param string $file
240 …public function createMediaFileGedcom(string $file, string $type, string $title, string $note): st… argument
242 $gedcom = '1 FILE ' . $file;
244 if (str_contains($file, '://')) {
247 $format = strtoupper(pathinfo($file, PATHINFO_EXTENSION));
248 $format = Registry::elementFactory()->make('OBJE:FILE:FORM')->canonical($format);
286 ->listContents($folder, $subfolders)
287 ->filter(fn (StorageAttributes $attributes): bool => $attributes->isFile())
288->filter(fn (StorageAttributes $attributes): bool => !$this->ignorePath($attributes->path()))
289 ->map(fn (StorageAttributes $attributes): string => $attributes->path())
290 ->toArray();
309 ->join('gedcom_setting', 'gedcom_id', '=', 'm_file')
310 ->where('setting_name', '=', 'MEDIA_DIRECTORY')
311 //->where('multimedia_file_refn', 'LIKE', '%/%')
312 ->where('multimedia_file_refn', 'NOT LIKE', 'http://%')
313 ->where('multimedia_file_refn', 'NOT LIKE', 'https://%')
314->where(new Expression('setting_value || multimedia_file_refn'), 'LIKE', $media_folder . '%');
317 …$query->where(new Expression('setting_value || multimedia_file_refn'), 'NOT LIKE', $media_folder .…
321 ->orderBy(new Expression('setting_value || multimedia_file_refn'))
322 ->pluck(new Expression('setting_value || multimedia_file_refn AS path'));
335 $folders = $tree->mediaFilesystem()
336 ->listContents('', FilesystemReader::LIST_DEEP)
337 ->filter(fn (StorageAttributes $attributes): bool => $attributes->isDir())
338->filter(fn (StorageAttributes $attributes): bool => !$this->ignorePath($attributes->path()))
339 ->map(fn (StorageAttributes $attributes): string => $attributes->path())
340 ->toArray();
350 * @return Collection<array-key,string>
356 ->leftJoin('gedcom_setting', static function (JoinClause $join): void {
358 ->on('gedcom_id', '=', 'm_file')
359 ->where('setting_name', '=', 'MEDIA_DIRECTORY');
361 ->where('multimedia_file_refn', 'NOT LIKE', 'http://%')
362 ->where('multimedia_file_refn', 'NOT LIKE', 'https://%')
363->pluck(new Expression("COALESCE(setting_value, 'media/') || multimedia_file_refn AS path"))
364 ->map(static fn (string $path): string => dirname($path) . '/');
367 ->leftJoin('gedcom_setting', static function (JoinClause $join): void {
369 ->on('gedcom.gedcom_id', '=', 'gedcom_setting.gedcom_id')
370 ->where('setting_name', '=', 'MEDIA_DIRECTORY');
372 ->where('gedcom.gedcom_id', '>', '0')
373 ->pluck(new Expression("COALESCE(setting_value, 'media/') AS path"))
374 ->uniqueStrict();
380 ->listContents($media_folder, FilesystemReader::LIST_DEEP)
381 ->filter(fn (StorageAttributes $attributes): bool => $attributes->isDir())
382->filter(fn (StorageAttributes $attributes): bool => !$this->ignorePath($attributes->path()))
383 ->map(fn (StorageAttributes $attributes): string => $attributes->path() . '/')
384 ->toArray();
386 $disk_folders = $disk_folders->concat($tmp);
389 return $disk_folders->concat($db_folders)
390 ->uniqueStrict()
391 ->sort(I18N::comparator())
392 ->mapWithKeys(static fn (string $folder): array => [$folder => $folder]);