Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

remove_empty_temp_directory()

Description

Remove empty folder from path to file. Helpful to remove a temp directory once the file it was created to hold no longer exists.
This function should be called only once the directory to be removed is empty.

Parameters

ColumnTypeDefaultDescription
$path_to_file string "" Full path to file in filestore.

Return

void

Location

include/file_functions.php lines 270 to 278

Definition

 
function remove_empty_temp_directory(string $path_to_file "")
    {
    if (
$path_to_file != "" && !file_exists($path_to_file))
        {
        
$tmp_path_parts pathinfo($path_to_file);
        
$path_to_folder str_replace(DIRECTORY_SEPARATOR $tmp_path_parts['basename'], ''$path_to_file);
        
rmdir($path_to_folder);
        }
    }

This article was last updated 9th May 2024 10:05 Europe/London time based on the source file dated 8th May 2024 11:40 Europe/London time.