本文整理汇总了PHP中JApplicationCms::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP JApplicationCms::getConfig方法的具体用法?PHP JApplicationCms::getConfig怎么用?PHP JApplicationCms::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JApplicationCms
的用法示例。
在下文中一共展示了JApplicationCms::getConfig方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConfig
/**
* Get a configuration object
*
* Returns the global {@link JConfig} object, only creating it if it doesn't already exist.
*
* @param string $file The path to the configuration file
* @param string $type The type of the configuration file
* @param string $namespace The namespace of the configuration file
*
* @return Registry
*
* @see Registry
* @since 11.1
* @deprecated 5.0 Use the configuration object within the application.
*/
public static function getConfig($file = null, $type = 'PHP', $namespace = '')
{
JLog::add(sprintf('%s() is deprecated. The configuration object should be read from the application.', __METHOD__), JLog::WARNING, 'deprecated');
// If there is an application object, fetch the configuration from there
if (self::$application) {
return self::$application->getConfig();
}
if (!self::$config) {
if ($file === null) {
$file = JPATH_CONFIGURATION . '/configuration.php';
}
self::$config = self::createConfig($file, $type, $namespace);
}
return self::$config;
}