本文整理汇总了PHP中JLoader::getDeprecatedAliases方法的典型用法代码示例。如果您正苦于以下问题:PHP JLoader::getDeprecatedAliases方法的具体用法?PHP JLoader::getDeprecatedAliases怎么用?PHP JLoader::getDeprecatedAliases使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JLoader
的用法示例。
在下文中一共展示了JLoader::getDeprecatedAliases方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param object &$subject The object to observe.
* @param array $config An optional associative array of configuration settings.
*
* @since 1.5
*/
public function __construct(&$subject, $config)
{
parent::__construct($subject, $config);
// Log the deprecated API.
if ($this->params->get('log-deprecated')) {
JLog::addLogger(array('text_file' => 'deprecated.php'), JLog::ALL, array('deprecated'));
}
// Log everything (except deprecated APIs, these are logged separately with the option above).
if ($this->params->get('log-everything')) {
JLog::addLogger(array('text_file' => 'everything.php'), JLog::ALL, array('deprecated', 'databasequery'), true);
}
// Get the application if not done by JPlugin. This may happen during upgrades from Joomla 2.5.
if (!$this->app) {
$this->app = JFactory::getApplication();
}
$this->debugLang = $this->app->get('debug_lang');
// Skip the plugin if debug is off
if ($this->debugLang == '0' && $this->app->get('debug') == '0') {
return;
}
// Only if debugging or language debug is enabled.
if (JDEBUG || $this->debugLang) {
JFactory::getConfig()->set('gzip', 0);
ob_start();
ob_implicit_flush(false);
}
$this->linkFormat = ini_get('xdebug.file_link_format');
if ($this->params->get('logs', 1)) {
$priority = 0;
foreach ($this->params->get('log_priorities', array()) as $p) {
$const = 'JLog::' . strtoupper($p);
if (!defined($const)) {
continue;
}
$priority |= constant($const);
}
// Split into an array at any character other than alphabet, numbers, _, ., or -
$categories = array_filter(preg_split('/[^A-Z0-9_\\.-]/i', $this->params->get('log_categories', '')));
$mode = $this->params->get('log_category_mode', 0);
JLog::addLogger(array('logger' => 'callback', 'callback' => array($this, 'logger')), $priority, $categories, $mode);
}
// Prepare disconnect handler for SQL profiling.
$db = JFactory::getDbo();
$db->addDisconnectHandler(array($this, 'mysqlDisconnectHandler'));
// Log deprecated class aliases
foreach (JLoader::getDeprecatedAliases() as $deprecation) {
JLog::add(sprintf('%1$s has been aliased to %2$s and the former class name is deprecated. The alias will be removed in %3$s.', $deprecation['old'], $deprecation['new'], $deprecation['version']), JLog::WARNING, 'deprecated');
}
}