diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2014-08-10 15:24:43 +0200 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2014-08-10 15:24:43 +0200 |
| commit | d998efcf54f3a7ec202a98555c70094aede7ec42 (patch) | |
| tree | a69aa6fd09f7d8a8f386bb7f3520c6a3dbde213b /phpBB/phpbb/user.php | |
| parent | 58a863dbadbb316076647cfa235c69951d66df77 (diff) | |
| parent | 54b0ebc4106b985053e0c1827283e77fcfb596af (diff) | |
| download | forums-d998efcf54f3a7ec202a98555c70094aede7ec42.tar forums-d998efcf54f3a7ec202a98555c70094aede7ec42.tar.gz forums-d998efcf54f3a7ec202a98555c70094aede7ec42.tar.bz2 forums-d998efcf54f3a7ec202a98555c70094aede7ec42.tar.xz forums-d998efcf54f3a7ec202a98555c70094aede7ec42.zip | |
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
Diffstat (limited to 'phpBB/phpbb/user.php')
| -rw-r--r-- | phpBB/phpbb/user.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index 4e90044395..ea98034434 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -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); } /** |
