API16

JInstallerHelper/cleanupInstall: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Clean up temporary uploaded package and unpacked extension <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JInstallerHelper/cleanup...
 
m removing red link to edit, no existant pages
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JInstallerHelper/cleanupInstall|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JInstallerHelper/cleanupInstall}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 58: Line 58:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JInstallerHelper/cleanupInstall|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JInstallerHelper/cleanupInstall}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
Line 73: Line 73:
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API16]]

Revision as of 03:01, 14 May 2013

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 />