Actions

API16

JInstallerLibrary/discover

From Joomla! Documentation

< API16:JInstallerLibrary
Revision as of 17:53, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Contents

Description

Custom discover method

[Edit Descripton]

Description:JInstallerLibrary/discover

Syntax

discover()


Returns

array(JExtension) list of extensions available

Defined in

libraries/joomla/installer/adapters/library.php

Importing

jimport( 'joomla.installer.adapters.library' );

Source Body

function discover()
{
        $results = Array();
        $file_list = JFolder::files(JPATH_MANIFESTS.DS.'libraries','\.xml$');
        foreach ($file_list as $file)
        {
                $file = JFile::stripExt($file);
                $extension = &JTable::getInstance('extension');
                $extension->set('type', 'library');
                $extension->set('client_id', 0);
                $extension->set('element', $file);
                $extension->set('name', $file);
                $extension->set('state', -1);
                $results[] = $extension;
        }
        return $results;
}

[Edit See Also] SeeAlso:JInstallerLibrary/discover

Examples

<CodeExamplesForm />