Back to Installer class

Method getInstance

public static \Joomla\CMS\Installer\Installer
getInstance
(mixed $basepath = __DIR__, mixed $classprefix = '\\Joomla\\CMS\\Installer\\Adapter', mixed $adapterfolder = 'Adapter')
Returns the global Installer object, only creating it if it doesn't already exist.
Parameters
  • string $basepath Base Path of the adapters
  • string $classprefix Class prefix of adapters
  • string $adapterfolder Name of folder to append to base path
Returns
  • \Joomla\CMS\Installer\Installer An installer object
Since
  • 3.1
Class: Installer
Project: Joomla

Method getInstance - Source code

/**
 * Returns the global Installer object, only creating it if it doesn't already exist.
 *
 * @param   string  $basepath       Base Path of the adapters
 * @param   string  $classprefix    Class prefix of adapters
 * @param   string  $adapterfolder  Name of folder to append to base path
 *
 * @return  Installer  An installer object
 *
 * @since   3.1
 */
public static function getInstance($basepath = __DIR__, $classprefix = '\\Joomla\\CMS\\Installer\\Adapter', $adapterfolder = 'Adapter')
{
    if (!isset(self::$instances[$basepath])) {
        self::$instances[$basepath] = new static($basepath, $classprefix, $adapterfolder);
    }
    return self::$instances[$basepath];
}