PHP不推荐使用的错误

时间:2018-04-22 16:54:45

标签: php joomla k2

[22-Apr-2018 17:36:22 Europe/London] PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; plgK2FbComments_K2 has a deprecated constructor in `/home/dailydealsblogco/public_html/plugins/k2/fbcomments_k2/fbcomments_k2.php on line 16`

这里的第16行:

class plgK2FbComments_K2 extends K2Plugin {
var $pluginName = 'fbcomments_k2';
var $pluginNameHumanReadable = 'DISQUS for K2 plugin';

public function plgK2FbComments_K2(& $subject, $params) {
    parent::__construct($subject, $params);
    // JPlugin::loadLanguage('plg_k2_fbcomments_k2');
}

有人可以帮我改变吗?谷歌搜索了几个小时,仍然没有更聪明。我想摆脱它的错误。

1 个答案:

答案 0 :(得分:0)

将构造函数重命名为__construct

public function __construct(& $subject, $params) {
    parent::__construct($subject, $params);
    // JPlugin::loadLanguage('plg_k2_fbcomments_k2');
}