本文整理匯總了PHP中JInstaller::instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP JInstaller::instance方法的具體用法?PHP JInstaller::instance怎麽用?PHP JInstaller::instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JInstaller
的用法示例。
在下文中一共展示了JInstaller::instance方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getInstance
/**
* 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 JInstaller An installer object
*
* @since 3.1
*/
public static function getInstance($basepath = __DIR__, $classprefix = 'JInstallerAdapter', $adapterfolder = 'adapter')
{
if (!isset(self::$instances[$basepath])) {
self::$instances[$basepath] = new JInstaller($basepath, $classprefix, $adapterfolder);
// For B/C, we load the first instance into the static $instance container, remove at 4.0
if (!isset(self::$instance)) {
self::$instance = self::$instances[$basepath];
}
}
return self::$instances[$basepath];
}
示例2: getInstance
/**
* Returns the global Installer object, only creating it
* if it doesn't already exist.
*
* @return JInstaller An installer object
*
* @since 11.1
*/
public static function getInstance()
{
if (!isset(self::$instance)) {
self::$instance = new JInstaller();
}
return self::$instance;
}