Actions

API15

Difference between revisions of "JArchive/getAdapter"

From Joomla! Documentation

< API15:JArchive
(New page: <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Description:JArchive/getAdapter}...)
 
m (removing red link to edit, no existant pages)
 
Line 1: Line 1:
 
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JArchive/getAdapter|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JArchive/getAdapter}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 57: Line 56:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JArchive/getAdapter|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JArchive/getAdapter}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 72: Line 71:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API15]]

Latest revision as of 08:42, 12 May 2013

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Contents

Syntax

& getAdapter($type)
Parameter Name Default Value Description
$type

Defined in

libraries/joomla/filesystem/archive.php

Importing

jimport( 'joomla.filesystem.archive' );

Source Body

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 edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />