当前位置: 首页>>代码示例>>PHP>>正文


PHP JLoader::getDeprecatedAliases方法代码示例

本文整理汇总了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');
     }
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:57,代码来源:debug.php


注:本文中的JLoader::getDeprecatedAliases方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。