API15:JInstaller/abort
From Joomla! Documentation
Description
Installation abort method
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
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
boolean True if successful
Defined in
libraries/joomla/installer/installer.php
Importing
jimport( 'joomla.installer.installer' );
Source Body
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;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples