JArchive/getAdapter
From Joomla! Documentation
< API15:JArchive
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.
<! removed transcluded page call, red link never existed >
Syntax[edit]
& getAdapter($type)
Parameter Name | Default Value | Description |
---|---|---|
$type |
Defined in[edit]
libraries/joomla/filesystem/archive.php
Importing[edit]
jimport( 'joomla.filesystem.archive' );
Source Body[edit]
function &getAdapter($type)
{
static $adapters;
if (!isset($adapters)) {
$adapters = array();
}
if (!isset($adapters[$type]))
{
// Try to load the adapter object
$class = 'JArchive'.ucfirst($type);
if (!class_exists($class))
{
$path = dirname(__FILE__).DS.'archive'.DS.strtolower($type).'.php';
if (file_exists($path)) {
require_once($path);
} else {
JError::raiseError(500,JText::_('Unable to load archive'));
}
}
$adapters[$type] = new $class();
}
return $adapters[$type];
}
<! removed transcluded page call, red link never existed >
Examples[edit]
Code Examples[edit]