Collections functions
Encryption functions
General functions
Theme permission 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

SimpleXMLElement

Location

include/metadata_functions.php lines 21 to 39

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)
        {
        
trigger_error('FITS library could not be located!');
        }

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

    
$return run_command("{$fits} -i {$file} -xc");

    return new 
SimpleXMLElement($return);
    }

This article was last updated 7th July 2020 09:05 Europe/London time based on the source file dated 5th June 2020 16:33 Europe/London time.