API15

JInstaller/abort

From Joomla! Documentation

< API15:JInstaller
Revision as of 17:23, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Installation abort method <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </s...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Installation abort method

[Edit Descripton]

Template:Description:JInstaller/abort

Syntax[edit]

abort($msg=null, $type=null)
Parameter Name Default Value Description
$msg null $msg Abort message from the installer
$type null $type Package type if defined

Returns[edit]

boolean True if successful

Defined in[edit]

libraries/joomla/installer/installer.php

Importing[edit]

jimport( 'joomla.installer.installer' );

Source Body[edit]

function abort($msg=null, $type=null)
{
        // Initialize variables
        $retval = true;
        $step = array_pop($this->_stepStack);

        // Raise abort warning
        if ($msg) {
                JError::raiseWarning(100, $msg);
        }

        while ($step != null)
        {
                switch ($step['type'])
                {
                        case 'file' :
                                // remove the file
                                $stepval = JFile::delete($step['path']);
                                break;

                        case 'folder' :
                                // remove the folder
                                $stepval = JFolder::delete($step['path']);
                                break;

                        case 'query' :
                                // placeholder in case this is necessary in the future
                                break;

                        default :
                                if ($type && is_object($this->_adapters[$type])) {
                                        // Build the name of the custom rollback method for the type
                                        $method = '_rollback_'.$step['type'];
                                        // Custom rollback method handler
                                        if (method_exists($this->_adapters[$type], $method)) {
                                                $stepval = $this->_adapters[$type]->$method($step);
                                        }
                                }
                                break;
                }

                // Only set the return value if it is false
                if ($stepval === false) {
                        $retval = false;
                }

                // Get the next step and continue
                $step = array_pop($this->_stepStack);
        }

        return $retval;
}

[Edit See Also] Template:SeeAlso:JInstaller/abort

Examples[edit]

<CodeExamplesForm />