Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource 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 19th April 2024 14:35 Europe/London time based on the source file dated 28th March 2024 13:54 Europe/London time.