Joomla CMS  3.8.5 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.8.5 et du framework Joomla Platform intégré
Référence de la classe JLoader

Fonctions membres publiques statiques

static discover ($classPrefix, $parentPath, $force=true, $recurse=false)
 
static getClassList ()
 
static getDeprecatedAliases ()
 
static getNamespaces ($type='psr0')
 
static import ($key, $base=null)
 
static load ($class)
 
static register ($class, $path, $force=true)
 
static registerPrefix ($prefix, $path, $reset=false, $prepend=false)
 
static registerAlias ($alias, $original, $version=false)
 
static registerNamespace ($namespace, $path, $reset=false, $prepend=false, $type='psr0')
 
static setup ($enablePsr=true, $enablePrefixes=true, $enableClasses=true)
 
static loadByPsr4 ($class)
 
static loadByPsr0 ($class)
 
static loadByAlias ($class)
 
static applyAliasFor ($class)
 
static _autoload ($class)
 

Attributs protégés statiques

static $classes = array()
 
static $imported = array()
 
static $prefixes = array()
 
static $classAliases = array()
 
static $classAliasesInverse = array()
 
static $namespaces = array('psr0' => array(), 'psr4' => array())
 
static $deprecatedAliases = array()
 

Fonctions membres privées statiques

static _load ($class, $lookup)
 
static loadAliasFor ($class)
 
static stripFirstBackslash ($class)
 

Documentation des fonctions membres

◆ _autoload()

static _autoload (   $class)
static

Autoload a class based on name.

Paramètres
string$classThe class to be loaded.
Renvoie
boolean True if the class was loaded, false otherwise.
Depuis
11.3

Références $class, et $prefix.

◆ _load()

static _load (   $class,
  $lookup 
)
staticprivate

Load a class based on name and lookup array.

Paramètres
string$classThe class to be loaded (without prefix).
array$lookupThe array of base paths to use for finding the class file.
Renvoie
boolean True if the class was loaded, false otherwise.
Depuis
12.1

Références $base, $class, $parts, et $path.

◆ applyAliasFor()

static applyAliasFor (   $class)
static

Applies a class alias for an already loaded class, if a class alias was created for it.

Paramètres
string$classWe'll look for and register aliases for this (real) class name
Renvoie
void
Depuis
3.4

Références $class.

Référencé par JClassLoader\loadClass().

◆ discover()

static discover (   $classPrefix,
  $parentPath,
  $force = true,
  $recurse = false 
)
static

Method to discover classes of a given type in a given path.

Paramètres
string$classPrefixThe class name prefix to use for discovery.
string$parentPathFull path to the parent folder for the classes to discover.
boolean$forceTrue to overwrite the autoload path value for the class if it already exists.
boolean$recurseRecurse through all child directories as well as the parent path.
Renvoie
void
Depuis
11.1

Références $class, $classes, et $file.

◆ getClassList()

static getClassList ( )
static

Method to get the list of registered classes and their respective file paths for the autoloader.

Renvoie
array The array of class => path values for the autoloader.
Depuis
11.1

Références $classes.

◆ getDeprecatedAliases()

static getDeprecatedAliases ( )
static

Method to get the list of deprecated class aliases.

Renvoie
array An associative array with deprecated class alias data.
Depuis
3.6.3

Référencé par PlgSystemDebug\__construct(), et JObserverUpdater\attachObserver().

◆ getNamespaces()

static getNamespaces (   $type = 'psr0')
static

Method to get the list of registered namespaces.

Paramètres
string$typeDefines the type of namespace, can be prs0 or psr4.
Renvoie
array The array of namespace => path values for the autoloader.
Depuis
12.3

Références $type.

◆ import()

◆ load()

static load (   $class)
static

Load the file for a class.

Paramètres
string$classThe class to be loaded.
Renvoie
boolean True on success
Depuis
11.1

Références $class, $classes, et $key.

◆ loadAliasFor()

static loadAliasFor (   $class)
staticprivate

Loads the aliases for the given class.

Paramètres
string$classThe class.
Renvoie
void
Depuis
3.8.0

Références $class.

◆ loadByAlias()

static loadByAlias (   $class)
static

Method to autoload classes that have been aliased using the registerAlias method.

Paramètres
string$classThe fully qualified class name to autoload.
Renvoie
boolean True on success, false otherwise.
Depuis
3.2

Références $class.

◆ loadByPsr0()

static loadByPsr0 (   $class)
static

Method to autoload classes that are namespaced to the PSR-0 standard.

Paramètres
string$classThe fully qualified class name to autoload.
Renvoie
boolean True on success, false otherwise.
Depuis
13.1
Obsolète:
4.0 this method will be removed

Références $class, $className, $path, DIRECTORY_SEPARATOR, et null.

◆ loadByPsr4()

static loadByPsr4 (   $class)
static

Method to autoload classes that are namespaced to the PSR-4 standard.

Paramètres
string$classThe fully qualified class name to autoload.
Renvoie
boolean True on success, false otherwise.
Depuis
3.7.0

Références $class, $className, $path, DIRECTORY_SEPARATOR, et null.

◆ register()

static register (   $class,
  $path,
  $force = true 
)
static

Directly register a class to the autoload list.

Paramètres
string$classThe class name to register.
string$pathFull path to the file that holds the class to register.
boolean$forceTrue to overwrite the autoload path value for the class if it already exists.
Renvoie
void
Depuis
11.1

Références $class, $classes, et $path.

Référencé par HTMLHelper\_(), UsersRouter\__construct(), ContactRouter\__construct(), ContentRouter\__construct(), NewsfeedsRouter\__construct(), UsersModelProfile\__construct(), JApplication\_createConfiguration(), CategoriesHelper\addSubmenu(), TagsHelper\addSubmenu(), LanguagesViewLanguage\addToolbar(), BannersViewBanners\addToolbar(), CategoriesViewCategory\addToolbar(), CategoriesViewCategories\addToolbar(), TagsModelTags\countItems(), CategoriesModelCategories\countItems(), LanguagesModelOverrides\delete(), LanguagesViewMultilangstatus\display(), PluginsController\display(), NewsfeedsController\display(), CacheController\display(), InstallerController\display(), MenusController\display(), MessagesController\display(), ModulesController\display(), SearchViewSearch\display(), RedirectController\display(), SearchController\display(), LanguagesController\display(), ContactController\display(), FinderController\display(), CategoriesController\display(), DeletefilesCli\doExecute(), JHtmlIcon\email(), ConfigControllerTemplatesDisplay\execute(), ConfigControllerTemplatesSave\execute(), ConfigControllerModulesDisplay\execute(), ConfigControllerModulesSave\execute(), ConfigControllerModulesCancel\execute(), FieldsHelper\extract(), CliApplication\fetchConfigurationData(), WebApplication\fetchConfigurationData(), JoomlaupdateModelDefault\finaliseUpgrade(), Installer\getAdapters(), CategoriesModelCategories\getAssoc(), CategoriesModelCategory\getAssoc(), FinderIndexerParser\getInstance(), FinderIndexerStemmer\getInstance(), Pathway\getInstance(), CacheController\getInstance(), AbstractMenu\getInstance(), Categories\getInstance(), FinderIndexer\getInstance(), Router\getInstance(), Document\getInstance(), LanguagesModelOverride\getItem(), TagsHelperRoute\getItemRoute(), SearchModelSearches\getItems(), JFormFieldTos\getLabel(), ModLanguagesHelper\getList(), JFormFieldFieldcontexts\getOptions(), FinderCli\index(), PlgFinderCategories\index(), Installer\loadAdapter(), Document\loadRenderer(), PlgSystemLanguageFilter\onAfterDispatch(), PlgSampledataBlog\onAjaxSampledataApplyStep2(), PlgContentFields\onContentPrepare(), PlgContentContact\onContentPrepare(), PlgSearchContent\onContentSearch(), PlgSearchTags\onContentSearch(), PlgSearchContacts\onContentSearch(), PlgButtonFields\onDisplay(), JHtmlModules\positions(), CategoriesModelCategory\preprocessForm(), LanguagesModelStrings\refresh(), LanguagesControllerOverride\save(), LanguagesModelOverride\save(), NewsfeedsModelNewsfeed\save(), ContactModelContact\save(), ContentModelArticle\save(), LanguageHelper\saveToIniFile(), InstallationControllerRemovefolder\sendJsonResponse(), JAdapter\setAdapter(), PlgFinderTags\setup(), PlgFinderNewsfeeds\setup(), PlgFinderContent\setup(), PlgFinderCategories\setup(), PlgFinderContacts\setup(), InstallerAdapter\setupScriptfile(), FileAdapter\uninstall(), PluginAdapter\uninstall(), PackageAdapter\uninstall(), TemplatesModelTemplate\uploadFile(), et ModulesModelModule\validate().

◆ registerAlias()

static registerAlias (   $alias,
  $original,
  $version = false 
)
static

Offers the ability for "just in time" usage of class_alias(). You cannot overwrite an existing alias.

Paramètres
string$aliasThe alias name to register.
string$originalThe original class to alias.
string | boolean$versionThe version in which the alias will no longer be present.
Renvoie
boolean True if registration was successful. False if the alias already exists.
Depuis
3.2

Références $version.

◆ registerNamespace()

static registerNamespace (   $namespace,
  $path,
  $reset = false,
  $prepend = false,
  $type = 'psr0' 
)
static

Register a namespace to the autoloader. When loaded, namespace paths are searched in a "last in, first out" order.

Paramètres
string$namespaceA case sensitive Namespace to register.
string$pathA case sensitive absolute file path to the library root where classes of the given namespace can be found.
boolean$resetTrue to reset the namespace with only the given lookup path.
boolean$prependIf true, push the path to the beginning of the namespace lookup paths array.
string$typeDefines the type of namespace, can be prs0 or psr4.
Renvoie
void
Exceptions
RuntimeException
Note
The default argument of $type will be changed in J4 to be 'psr4'
Depuis
12.3

Références $path, $type, et JPATH_ROOT.

◆ registerPrefix()

static registerPrefix (   $prefix,
  $path,
  $reset = false,
  $prepend = false 
)
static

Register a class prefix with lookup path. This will allow developers to register library packages with different class prefixes to the system autoloader. More than one lookup path may be registered for the same class prefix, but if this method is called with the reset flag set to true then any registered lookups for the given prefix will be overwritten with the current lookup path. When loaded, prefix paths are searched in a "last in, first out" order.

Paramètres
string$prefixThe class prefix to register.
string$pathAbsolute file path to the library root where classes with the given prefix can be found.
boolean$resetTrue to reset the prefix with only the given lookup path.
boolean$prependIf true, push the path to the beginning of the prefix lookup paths array.
Renvoie
void
Exceptions
RuntimeException
Depuis
12.1

Références $path, $prefix, et JPATH_ROOT.

Référencé par InstallationModelLanguages\addMenuGroup(), ConfigControllerConfigDisplay\execute(), ConfigControllerConfigSave\execute(), et InstallationControllerSetdefaultlanguage\execute().

◆ setup()

static setup (   $enablePsr = true,
  $enablePrefixes = true,
  $enableClasses = true 
)
static

Method to setup the autoloaders for the Joomla Platform. Since the SPL autoloaders are called in a queue we will add our explicit class-registration based loader first, then fall back on the autoloader based on conventions. This will allow people to register a class in a specific location and override platform libraries as was previously possible.

Paramètres
boolean$enablePsrTrue to enable autoloading based on PSR-0.
boolean$enablePrefixesTrue to enable prefix based class loading (needed to auto load the Joomla core).
boolean$enableClassesTrue to enable class map based class loading (needed to auto load the Joomla core).
Renvoie
void
Depuis
12.3

◆ stripFirstBackslash()

static stripFirstBackslash (   $class)
staticprivate

Strips the first backslash from the given class if present.

Paramètres
string$classThe class to strip the first prefix from.
Renvoie
string The striped class name.
Depuis
3.8.0

Références $class.

Documentation des champs

◆ $classAliases

$classAliases = array()
staticprotected

◆ $classAliasesInverse

$classAliasesInverse = array()
staticprotected

◆ $classes

$classes = array()
staticprotected

◆ $deprecatedAliases

$deprecatedAliases = array()
staticprotected

◆ $imported

$imported = array()
staticprotected

◆ $namespaces

$namespaces = array('psr0' => array(), 'psr4' => array())
staticprotected

◆ $prefixes

$prefixes = array()
staticprotected

La documentation de cette classe a été générée à partir du fichier suivant :