API16

API16:JInstaller/loadMD5Sum

From Joomla! Documentation

Description

Loads an MD5SUMS file into an associative array


<! removed transcluded page call, red link never existed >

Syntax

loadMD5Sum($filename)
Parameter Name Default Value Description
$filename Filename to load

Returns

Array Associative array with filenames as the index and the MD5 as the value

Defined in

libraries/joomla/installer/installer.php

Importing

jimport( 'joomla.installer.installer' );

Source Body

function loadMD5Sum($filename)
{
        if (!file_exists($filename)) return false; // bail if the file doesn't exist
        $data = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
        $retval = Array();
        foreach ($data as $row)
        {
                $results = explode('  ', $row); // split up the data
                $results[1] = str_replace('./','', $results[1]); // cull any potential prefix
                $retval[$results[1]] = $results[0]; // throw into the array
        }
        return $retval;
}


<! removed transcluded page call, red link never existed >

Examples

Code Examples