diff options
author | Nils Adermann <naderman@naderman.de> | 2013-09-10 14:01:09 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2013-09-16 00:25:27 +0200 |
commit | b95fdacdd378877d277e261465da73deb06e50da (patch) | |
tree | 01d55340b37f412cecd2d898c302e101b8a0ed19 /phpBB/phpbb/user.php | |
parent | 196e1813cd37c47965eb6f254ce6a55210a1b751 (diff) | |
download | forums-b95fdacdd378877d277e261465da73deb06e50da.tar forums-b95fdacdd378877d277e261465da73deb06e50da.tar.gz forums-b95fdacdd378877d277e261465da73deb06e50da.tar.bz2 forums-b95fdacdd378877d277e261465da73deb06e50da.tar.xz forums-b95fdacdd378877d277e261465da73deb06e50da.zip |
[ticket/11700] Move all recent code to namespaces
PHPBB3-11700
Diffstat (limited to 'phpBB/phpbb/user.php')
-rw-r--r-- | phpBB/phpbb/user.php | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index 5530fe3f03..5a9aa21e8a 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -7,6 +7,8 @@ * */ +namespace phpbb; + /** * @ignore */ @@ -23,7 +25,7 @@ if (!defined('IN_PHPBB')) * * @package phpBB3 */ -class phpbb_user extends phpbb_session +class user extends \phpbb\session { var $lang = array(); var $help = array(); @@ -41,7 +43,7 @@ class phpbb_user extends phpbb_session var $img_lang; var $img_array = array(); - // Able to add new options (up to id 31) + // Able to add new \options (up to id 31) var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17); /** @@ -151,12 +153,12 @@ class phpbb_user extends phpbb_session try { - $this->timezone = new DateTimeZone($user_timezone); + $this->timezone = new \DateTimeZone($user_timezone); } - catch (Exception $e) + catch (\Exception $e) { // If the timezone the user has selected is invalid, we fall back to UTC. - $this->timezone = new DateTimeZone('UTC'); + $this->timezone = new \DateTimeZone('UTC'); } // We include common language file here to not load it every time a custom language file is included @@ -649,27 +651,27 @@ class phpbb_user extends phpbb_session if (!isset($utc)) { - $utc = new DateTimeZone('UTC'); + $utc = new \DateTimeZone('UTC'); } - $time = new phpbb_datetime($this, "@$gmepoch", $utc); + $time = new \phpbb\datetime($this, "@$gmepoch", $utc); $time->setTimezone($this->timezone); return $time->format($format, $forcedate); } /** - * Create a phpbb_datetime object in the context of the current user + * Create a \phpbb\datetime object in the context of the current user * * @since 3.1 * @param string $time String in a format accepted by strtotime(). * @param DateTimeZone $timezone Time zone of the time. - * @return phpbb_datetime Date time object linked to the current users locale + * @return \phpbb\datetime Date time object linked to the current users locale */ - public function create_datetime($time = 'now', DateTimeZone $timezone = null) + public function create_datetime($time = 'now', \DateTimeZone $timezone = null) { $timezone = $timezone ?: $this->timezone; - return new phpbb_datetime($this, $time, $timezone); + return new \phpbb\datetime($this, $time, $timezone); } /** @@ -680,10 +682,10 @@ class phpbb_user extends phpbb_session * @param DateTimeZone $timezone Timezone of the date/time, falls back to timezone of current user * @return int Returns the unix timestamp */ - public function get_timestamp_from_format($format, $time, DateTimeZone $timezone = null) + public function get_timestamp_from_format($format, $time, \DateTimeZone $timezone = null) { $timezone = $timezone ?: $this->timezone; - $date = DateTime::createFromFormat($format, $time, $timezone); + $date = \DateTime::createFromFormat($format, $time, $timezone); return ($date !== false) ? $date->format('U') : false; } |