Actions

API16

JInstaller/loadMD5Sum

From Joomla! Documentation

< API16:JInstaller
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Loads an MD5SUMS file into an associative array

[<! removed edit link to red link >]

<! 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 edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />