API15:JInstallerHelper/cleanupInstall
From Joomla! Documentation
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
Code Examples