52 $directory = Paths::sanitize($directory);
53 if (!file_exists($directory)) {
57 if (!is_dir($directory)) {
61 $dh = new \DirectoryIterator($directory);
63 foreach ($dh as $file_info) {
64 if ($file_info->isDot()) {
68 if ($file_info->isDir()) {
73 }
elseif ($file_info->isFile()) {
74 unlink($file_info->getPathname());
78 if ($leave_base_directory) {
83 return rmdir($directory);
132 'guid' => $entity->guid,
157 return _elgg_services()->uploads->getFile($input_name, $check_for_validity);
elgg_get_embed_url(\ElggEntity $entity, string $size)
Returns a URL suitable for embedding entity's icon in a text editor.
$params
Saves global plugin settings.
This class represents a physical file (by default in the system temp directory).
elgg_get_uploaded_file(string $input_name, bool $check_for_validity=true)
Returns a single valid uploaded file object.
getInlineURL(bool $use_cookie=false, string $expires= '')
Returns file's URL for inline display Suitable for displaying cacheable resources, such as user avatars.
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof\ElggRelationship) elseif(is_callable([$item, 'getType']))
elgg_get_inline_url(\ElggFile $file, bool $use_cookie=false, string $expires= '')
Returns file's URL for inline display Suitable for displaying cacheable resources, such as user avatars.
elgg_get_temp_file()
Returns a ElggTempFile which can handle writing/reading of data to a temporary file location...
elgg_save_resized_image(string $source, string $destination=null, array $params=[])
Crops and resizes an image.
getDownloadURL(bool $use_cookie=true, string $expires= '+2 hours')
Returns file's download URL.
elgg_delete_directory(string $directory, bool $leave_base_directory=false)
Delete a directory and all its contents.
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
_elgg_services()
Get the global service provider.
elgg_get_download_url(\ElggFile $file, bool $use_cookie=true, string $expires= '+2 hours')
Returns file's download URL.
elgg_get_uploaded_files(string $input_name)
Returns an array of uploaded file objects regardless of upload status/errors.