Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

runFitsForFile()

Description

Run FITS on a file and get the output back

Parameters

ColumnTypeDefaultDescription
$file_path string Physical path to the file

Return

bool | SimpleXMLElement

Location

include/metadata_functions.php lines 21 to 43

Definition

 
function runFitsForFile($file_path)
    {
    global 
$fits_path;

    
$fits              get_utility_path('fits');
    
$fits_path_escaped escapeshellarg($fits_path);
    
$file              escapeshellarg($file_path);

    if(
false === $fits)
        {
        
debug('ERROR: FITS library could not be located!');
        return 
false;
        }

    
putenv("LD_LIBRARY_PATH={$fits_path_escaped}/tools/mediainfo/linux");

    
$return run_command("{$fits} -i {$file} -xc");
    if(
trim($return) != "")
        {
        return new 
SimpleXMLElement($return);
        }
    return 
false;
    }

This article was last updated 19th March 2024 09:05 Europe/London time based on the source file dated 6th March 2024 14:45 Europe/London time.