Actions

API16

JInstallerHelper/cleanupInstall

From Joomla! Documentation

< API16:JInstallerHelper
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

Clean up temporary uploaded package and unpacked extension

[<! removed edit link to red link >]

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

Syntax

cleanupInstall($package, $resultdir)
Parameter Name Default Value Description
$package $package Path to the uploaded package file
$resultdir $resultdir Path to the unpacked extension

Returns

boolean True on success

Defined in

libraries/joomla/installer/helper.php

Importing

jimport( 'joomla.installer.helper' );

Source Body

function cleanupInstall($package, $resultdir)
{
        $config = &JFactory::getConfig();
 
        // Does the unpacked extension directory exist?
        if (is_dir($resultdir)) {
                JFolder::delete($resultdir);
        }
 
        // Is the package file a valid file?
        if (is_file($package)) {
                JFile::delete($package);
        }
        elseif (is_file(JPath::clean($config->getValue('config.tmp_path').DS.$package)))
        {
                // It might also be just a base filename
                JFile::delete(JPath::clean($config->getValue('config.tmp_path').DS.$package));
        }
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />