Actions

API16

JInstallerHelper/cleanupInstall

From Joomla! Documentation

< API16:JInstallerHelper
Revision as of 17:36, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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

[Edit Descripton]

Description:JInstallerHelper/cleanupInstall

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));
        }
}

[Edit See Also] SeeAlso:JInstallerHelper/cleanupInstall

Examples

<CodeExamplesForm />