mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [ticket/12932] Remove set_datetime_class method from user class [ticket/12932] Fix tests and calls to create_datetime [ticket/12932] Add method for getting the datetime class and allow overriding Conflicts: phpBB/config/services.yml
This commit is contained in:
@@ -121,7 +121,7 @@ class soft_delete_mod_convert extends \phpbb\db\migration\migration
|
||||
new \phpbb\auth\auth(),
|
||||
$this->config,
|
||||
$this->db,
|
||||
new \phpbb\user(),
|
||||
new \phpbb\user('\phpbb\datetime'),
|
||||
$this->phpbb_root_path,
|
||||
$this->php_ext,
|
||||
$this->table_prefix . 'forums',
|
||||
|
@@ -31,6 +31,11 @@ class user extends \phpbb\session
|
||||
*/
|
||||
public $timezone;
|
||||
|
||||
/**
|
||||
* @var string Class name of datetime object
|
||||
*/
|
||||
protected $datetime;
|
||||
|
||||
var $lang_name = false;
|
||||
var $lang_id = false;
|
||||
var $lang_path;
|
||||
@@ -42,12 +47,14 @@ class user extends \phpbb\session
|
||||
|
||||
/**
|
||||
* Constructor to set the lang path
|
||||
* @param string $datetime_class Class name of datetime class
|
||||
*/
|
||||
function __construct()
|
||||
function __construct($datetime_class)
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
$this->lang_path = $phpbb_root_path . 'language/';
|
||||
$this->datetime = $datetime_class;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -727,7 +734,7 @@ class user extends \phpbb\session
|
||||
public function create_datetime($time = 'now', \DateTimeZone $timezone = null)
|
||||
{
|
||||
$timezone = $timezone ?: $this->timezone;
|
||||
return new \phpbb\datetime($this, $time, $timezone);
|
||||
return new $this->datetime($this, $time, $timezone);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user