API16

JInstaller/loadMD5Sum

From Joomla! Documentation

< API16:JInstaller

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Loads an MD5SUMS file into an associative array


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

Syntax[edit]

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

Returns[edit]

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

Defined in[edit]

libraries/joomla/installer/installer.php

Importing[edit]

jimport( 'joomla.installer.installer' );

Source Body[edit]

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[edit]

Code Examples[edit]