По аналогии с
этой темой решил сделать сборник исправлений vBulletin 4.2.3 для работы на PHP 7.x.x
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Database has a deprecated constructor in ....\includes\class_core.php on line 83
В файле
.\includes\class_core.php ищем:
PHP Code:
function vB_Database(&$registry)
Заменяем:
PHP Code:
function __construct(&$registry)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Datastore has a deprecated constructor in ....\includes\class_core.php on line 1479
В файле
.\includes\class_core.php ищем:
PHP Code:
function vB_Datastore(&$registry, &$dbobject)
Заменяем:
PHP Code:
function __construct(&$registry, &$dbobject)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Input_Cleaner has a deprecated constructor in ....\includes\class_core.php on line 1820
В файле
.\includes\class_core.php ищем:
PHP Code:
function vB_Input_Cleaner(&$registry)
Заменяем:
PHP Code:
function __construct(&$registry)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Registry has a deprecated constructor in ....\includes\class_core.php on line 3139
В файле
.\includes\class_core.php ищем:
PHP Code:
function vB_Registry()
Заменяем:
PHP Code:
function __construct()
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Session has a deprecated constructor in ....\includes\class_core.php on line 3541
В файле
.\includes\class_core.php ищем:
PHP Code:
function vB_Session(&$registry, $sessionhash = '', $userid = 0, $password = '', $styleid = 0, $languageid = 0)
Заменяем:
PHP Code:
function __construct(&$registry, $sessionhash = '', $userid = 0, $password = '', $styleid = 0, $languageid = 0)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_XML_Parser has a deprecated constructor in ....\includes\class_xml.php on line 52
В файле
.\includes\class_xml.php ищем:
PHP Code:
function vB_XML_Parser($xml, $path = '', $readencoding = false)
Заменяем:
PHP Code:
function __construct($xml, $path = '', $readencoding = false)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_XML_Builder has a deprecated constructor in ....\includes\class_xml.php on line 689
В файле
.\includes\class_xml.php ищем:
PHP Code:
function vB_XML_Builder(&$registry, $content_type = null, $charset = null)
Заменяем:
PHP Code:
function __construct(&$registry, $content_type = null, $charset = null)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vBulletinHook has a deprecated constructor in ....\includes\class_hook.php on line 27
В файле
.\includes\class_hook.php ищем:
PHP Code:
function vBulletinHook()
Заменяем:
PHP Code:
function __construct()
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Database_Alter has a deprecated constructor in ....\includes\class_dbalter.php on line 35
В файле
.\includes\class_dbalter.php ищем:
PHP Code:
function vB_Database_Alter(&$db)
Заменяем:
PHP Code:
function __construct(&$db)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_DataManager has a deprecated constructor in ....\includes\class_dm.php on line 20
В файле
.\includes\class_dm.php ищем:
PHP Code:
function vB_DataManager(&$registry, $errtype = ERRTYPE_STANDARD)
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_DataManager_Multiple has a deprecated constructor in ....\includes\class_dm.php on line 1628
В файле
.\includes\class_dm.php ищем:
PHP Code:
function vB_DataManager_Multiple(&$registry, $errtype = ERRTYPE_STANDARD)
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_DataManager_User has a deprecated constructor in ....\includes\class_dm_user.php on line 31
В файле
.\includes\class_dm_user.php ищем:
PHP Code:
function vB_DataManager_User(&$registry, $errtype = ERRTYPE_STANDARD)
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_DataManager_Forum has a deprecated constructor in ....\includes\class_dm_forum.php on line 37
В файле
.\includes\class_dm_forum.php ищем:
PHP Code:
function vB_DataManager_Forum(&$registry, $errtype = ERRTYPE_STANDARD)
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Upload_Abstract has a deprecated constructor in ....\includes\class_upload.php on line 25
В файле
.\includes\class_upload.php ищем:
PHP Code:
function vB_Upload_Abstract(&$registry)
Заменяем:
PHP Code:
function __construct(&$registry)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Upload_SocialGroupIcon has a deprecated constructor in ....\includes\class_upload.php on line 1241
В файле
.\includes\class_upload.php ищем:
PHP Code:
function vB_Upload_SocialGroupIcon(&$registry)
{
parent::vB_Upload_Abstract($registry);
}
Заменяем:
PHP Code:
function __construct(&$registry)
{
parent::__construct($registry);
}
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Image has a deprecated constructor in ....\includes\class_image.php on line 76
В файле
.\includes\class_image.php ищем:
PHP Code:
function vB_Image() {}
Заменяем:
PHP Code:
function __construct() {}
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Image_Abstract has a deprecated constructor in ....\includes\class_image.php on line 123
В файле
.\includes\class_image.php ищем:
PHP Code:
function vB_Image_Abstract(&$registry)
Заменяем:
PHP Code:
function __construct(&$registry)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Text_Diff has a deprecated constructor in ....\includes\class_diff.php on line 21
В файле
.\includes\class_diff.php ищем:
PHP Code:
function vB_Text_Diff($data_old, $data_new, $output_progress = false)
Заменяем:
PHP Code:
function __construct($data_old, $data_new, $output_progress = false)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Text_Diff_Entry has a deprecated constructor in ....\includes\class_diff.php on line 462
В файле
.\includes\class_diff.php ищем:
PHP Code:
function vB_Text_Diff_Entry($data_old, $data_new)
Заменяем:
PHP Code:
function __construct($data_old, $data_new)
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Image_Magick has a deprecated constructor in ....\includes\class_image.php on line 419
В файле
.\includes\class_image.php ищем:
PHP Code:
function vB_Image_Magick(&$registry)
{
parent::vB_Image_Abstract($registry);
$path = preg_replace('#[/\\\]+$#', '', $this->registry->options['magickpath']);
Заменяем:
PHP Code:
function __construct(&$registry)
{
parent::__construct($registry);
$path = preg_replace('#[/\\\]+$#', '', $this->registry->options['magickpath']);
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; vB_Image_GD has a deprecated constructor in ....\includes\class_image.php on line 1268
В файле
.\includes\class_image.php ищем:
PHP Code:
function vB_Image_GD(&$registry)
{
parent::vB_Image_Abstract($registry);
Заменяем:
PHP Code:
function __construct(&$registry)
{
parent::__construct($registry);
Fatal error: Call to undefined method vB_DataManager::vB_DataManager() on line 121 in ....\includes\class_dm_forum.php
В файле
.\includes\class_dm_forum.php ищем:
PHP Code:
parent::vB_DataManager($registry, $errtype);
Заменяем:
PHP Code:
parent::__construct($registry, $errtype);
Fatal error: Call to undefined method vB_DataManager::vB_DataManager() on line 222 in ....\includes\class_dm_user.php
В файле
.\includes\class_dm_user.php ищем:
PHP Code:
parent::vB_DataManager($registry, $errtype);
Заменяем:
PHP Code:
parent::__construct($registry, $errtype);
Fatal error: Call to undefined method vB_DataManager_Thread::vB_DataManager() on line 1666 in ....\includes\class_dm_threadpost.php
В файле
.\includes\class_dm_threadpost.php ищем:
PHP Code:
function vB_DataManager_Thread_FirstPost(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
($hook = vBulletinHook::fetch_hook('threadfpdata_start')) ? eval($hook) : false;
}
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::__construct($registry, $errtype);
($hook = vBulletinHook::fetch_hook('threadfpdata_start')) ? eval($hook) : false;
}
Fatal error: Call to undefined method vB_DataManager::vB_DataManager() on line 57 in ....\includes\class_dm_threadpost.php
В файле
.\includes\class_dm_threadpost.php ищем:
PHP Code:
function vB_DataManager_ThreadPost(&$registry, $errtype = ERRTYPE_STANDARD)
{
if (!is_subclass_of($this, 'vB_DataManager_ThreadPost'))
{
trigger_error("Direct Instantiation of vB_DataManager_ThreadPost class prohibited.", E_USER_ERROR);
}
parent::vB_DataManager($registry, $errtype);
}
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
{
if (!is_subclass_of($this, 'vB_DataManager_ThreadPost'))
{
trigger_error("Direct Instantiation of vB_DataManager_ThreadPost class prohibited.", E_USER_ERROR);
}
parent::__construct($registry, $errtype);
}
Fatal error: Call to undefined method vB_DataManager_ThreadPost::vB_DataManager_ThreadPost() on line 1114 in ....\includes\class_dm_threadpost.php
В файле
.\includes\class_dm_threadpost.php ищем:
PHP Code:
function vB_DataManager_Thread(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager_ThreadPost($registry, $errtype);
($hook = vBulletinHook::fetch_hook('threaddata_start')) ? eval($hook) : false;
}
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::__construct($registry, $errtype);
($hook = vBulletinHook::fetch_hook('threaddata_start')) ? eval($hook) : false;
}
Fatal error: Call to undefined method vB_DataManager::vB_DataManager() on line 59 in ....\includes\class_dm_attachment.php
В файле
.\includes\class_dm_attachment.php ищем:
PHP Code:
parent::vB_DataManager($registry, $errtype);
Заменяем:
PHP Code:
parent::__construct($registry, $errtype);
Fatal error: Call to undefined method vB_DataManager::vB_DataManager() on line 75 in ....\includes\class_dm_ip_data.php
В файле
.\includes\class_dm_ip_data.php ищем:
PHP Code:
function vB_DataManager_IP_Data(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::__construct($registry, $errtype);
Fatal error: Call to undefined method vB_DataManager::vB_DataManager() on line 74 in ....\includes\class_dm_content_read.php
В файле
.\includes\class_dm_content_read.php ищем:
PHP Code:
function vB_DataManager_Content_Read(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::__construct($registry, $errtype);
Fatal error: Call to undefined method vB_DataManager::vB_DataManager() on line 91 in ....\includes\class_dm_pm.php
В файле
.\includes\class_dm_pm.php ищем:
PHP Code:
function vB_DataManager_PM(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::__construct($registry, $errtype);
Fatal error: Call to undefined method vB_DataManager::vB_DataManager() on line 111 in ....\includes\class_dm_poll.php
В файле
.\includes\class_dm_poll.php ищем:
PHP Code:
function vB_DataManager_Poll(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::__construct($registry, $errtype);
Fatal error: Call to undefined method vB_DataManager::vB_DataManager() on line 70 in ....\includes\class_dm_pollvote.php
В файле
.\includes\class_dm_pollvote.php ищем:
PHP Code:
function vB_DataManager_PollVote(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::__construct($registry, $errtype);
Fatal error: Call to undefined method vB_DataManager::vB_DataManager() on line 113 in ....\includes\class_dm_visitormessage.php
В файле
.\includes\class_dm_visitormessage.php ищем:
PHP Code:
function vB_DataManager_VisitorMessage(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::__construct($registry, $errtype);
Fatal error: Call to undefined method vB_DataManager::vB_DataManager() on line 136 in ....\includes\class_dm_userpic.php
В файле
.\includes\class_dm_userpic.php ищем:
PHP Code:
function vB_DataManager_Userpic(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
Заменяем:
PHP Code:
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::__construct($registry, $errtype);
Fatal error: Call to undefined method vB_DataManager_Userpic::vB_DataManager_Userpic() on line 288 in ....\includes\class_dm_userpic.php
В файле
.\includes\class_dm_userpic.php ищем:
PHP Code:
class vB_DataManager_Userpic_Avatar extends vB_DataManager_Userpic
{
function vB_DataManager_Userpic_Avatar(&$registry, $errtype = ERRTYPE_STANDARD)
{
$this->table = 'customavatar';
$this->revision = 'avatarrevision';
$this->filepath =& $registry->options['avatarpath'];
parent::vB_DataManager_Userpic($registry, $errtype);
}
}
Заменяем:
PHP Code:
class vB_DataManager_Userpic_Avatar extends vB_DataManager_Userpic
{
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
{
$this->table = 'customavatar';
$this->revision = 'avatarrevision';
$this->filepath =& $registry->options['avatarpath'];
parent::__construct($registry, $errtype);
}
}
Fatal error: Call to undefined method vB_DataManager_Userpic::vB_DataManager_Userpic() on line 300 in ....\includes\class_dm_userpic.php
В файле
.\includes\class_dm_userpic.php ищем:
PHP Code:
class vB_DataManager_Userpic_Profilepic extends vB_DataManager_Userpic
{
function vB_DataManager_Userpic_Profilepic(&$registry, $errtype = ERRTYPE_STANDARD)
{
$this->table = 'customprofilepic';
$this->revision = 'profilepicrevision';
$this->filepath =& $registry->options['profilepicpath'];
parent::vB_DataManager_Userpic($registry, $errtype);
}
}
Заменяем:
PHP Code:
class vB_DataManager_Userpic_Profilepic extends vB_DataManager_Userpic
{
function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
{
$this->table = 'customprofilepic';
$this->revision = 'profilepicrevision';
$this->filepath =& $registry->options['profilepicpath'];
parent::__construct($registry, $errtype);
}
}
Fatal error: Redefinition of parameter $line in ....\vb\exception\parser.php on line 25
В файле
.\vb\exception\parser.php ищем:
PHP Code:
class vB_Exception_Parser extends vB_Exception
{
public function __construct($message, $line = false, $code = false, $file = false, $line = false)
{
$message = $message ? $message : 'Parser Error';
if (!empty($line))
{
$message .= "::$line";
}
parent::__construct($message, $code, $file, $line);
}
}
Заменяем:
PHP Code:
class vB_Exception_Parser extends vB_Exception
{
public function __construct($message, $line = false, $code = false, $file = false, $line2 = false)
{
$message = $message ? $message : 'Parser Error';
if(empty($line))
{
$line = $line2;
}
if (!empty($line))
{
$message .= "::$line";
}
parent::__construct($message, $code, $file, $line);
}
}
Fatal error: Function name must be a string on line 1566 in ....\includes\class_bbcode.php
В файле
.\includes\class_bbcode.php ищем:
PHP Code:
$pending_text = $this->$tag_info['callback']($open['data'], $open['option']);
Заменяем:
PHP Code:
$pending_text = $this->{$tag_info['callback']}($open['data'], $open['option']);
Сборник будет пополнятся.
P.S. бывают же совпадения,
предыдущую тему я создал почти ровно два года назад