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

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 13th December 2024 20:35 Europe/London time based on the source file dated 6th March 2024 14:45 Europe/London time.