diff options
Diffstat (limited to 'phpBB/includes/functions.php')
| -rw-r--r-- | phpBB/includes/functions.php | 52 | 
1 files changed, 15 insertions, 37 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 97429a0be4..6a6ec9c84d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -376,8 +376,7 @@ function still_on_time($extra_time = 15)  {  	static $max_execution_time, $start_time; -	$time = explode(' ', microtime()); -	$current_time = $time[0] + $time[1]; +	$current_time = microtime(true);  	if (empty($max_execution_time))  	{ @@ -802,7 +801,7 @@ function phpbb_own_realpath($path)  	$max = sizeof($bits) - 1; -	// Check if we are able to resolve symlinks, Windows cannot. +	// Check if we are able to resolve symlinks, Windows (prior to Vista and Server 2008) cannot.  	$symlink_resolve = (function_exists('readlink')) ? true : false;  	foreach ($bits as $i => $bit) @@ -1159,7 +1158,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $  		if ($forum_id === false || !sizeof($forum_id))  		{  			// Mark all forums read (index page) - +			/* @var $phpbb_notifications \phpbb\notification\manager */  			$phpbb_notifications = $phpbb_container->get('notification_manager');  			// Mark all topic notifications read for this user @@ -1226,6 +1225,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $  			$forum_id = array($forum_id);  		} +		/* @var $phpbb_notifications \phpbb\notification\manager */  		$phpbb_notifications = $phpbb_container->get('notification_manager');  		$phpbb_notifications->mark_notifications_read_by_parent(array( @@ -1348,6 +1348,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $  			return;  		} +		/* @var $phpbb_notifications \phpbb\notification\manager */  		$phpbb_notifications = $phpbb_container->get('notification_manager');  		// Mark post notifications read for this user in this topic @@ -1799,6 +1800,7 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti  	// Handle update of unapproved topics info.  	// Only update for moderators having m_approve permission for the forum. +	/* @var $phpbb_content_visibility \phpbb\content_visibility */  	$phpbb_content_visibility = $phpbb_container->get('content.visibility');  	// Check the forum for any left unread topics. @@ -2935,6 +2937,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa  		$s_hidden_fields['credential'] = $credential;  	} +	/* @var $provider_collection \phpbb\auth\provider_collection */  	$provider_collection = $phpbb_container->get('auth.provider_collection');  	$auth_provider = $provider_collection->get_provider(); @@ -3038,6 +3041,7 @@ function login_forum_box($forum_data)  		}  		$db->sql_freeresult($result); +		/* @var $passwords_manager \phpbb\passwords\manager */  		$passwords_manager = $phpbb_container->get('passwords.manager');  		if ($passwords_manager->check($password, $forum_data['forum_password'])) @@ -3640,38 +3644,12 @@ function phpbb_checkdnsrr($host, $type = 'MX')  		return (@gethostbyname($host_fqdn) == $host_fqdn) ? false : true;  	} -	// checkdnsrr() is available on Windows since PHP 5.3, -	// but until 5.3.3 it only works for MX records -	// See: http://bugs.php.net/bug.php?id=51844 - -	// Call checkdnsrr() if -	// we're looking for an MX record or -	// we're not on Windows or -	// we're running a PHP version where #51844 has been fixed - -	// checkdnsrr() supports AAAA since 5.0.0 -	// checkdnsrr() supports TXT since 5.2.4 -	if ( -		($type == 'MX' || DIRECTORY_SEPARATOR != '\\' || version_compare(PHP_VERSION, '5.3.3', '>=')) && -		($type != 'AAAA' || version_compare(PHP_VERSION, '5.0.0', '>=')) && -		($type != 'TXT' || version_compare(PHP_VERSION, '5.2.4', '>=')) && -		function_exists('checkdnsrr') -	) +	if (function_exists('checkdnsrr'))  	{  		return checkdnsrr($host_fqdn, $type);  	} -	// dns_get_record() is available since PHP 5; since PHP 5.3 also on Windows, -	// but on Windows it does not work reliable for AAAA records before PHP 5.3.1 - -	// Call dns_get_record() if -	// we're not looking for an AAAA record or -	// we're not on Windows or -	// we're running a PHP version where AAAA lookups work reliable -	if ( -		($type != 'AAAA' || DIRECTORY_SEPARATOR != '\\' || version_compare(PHP_VERSION, '5.3.1', '>=')) && -		function_exists('dns_get_record') -	) +	if (function_exists('dns_get_record'))  	{  		// dns_get_record() expects an integer as second parameter  		// We have to convert the string $type to the corresponding integer constant. @@ -3818,11 +3796,6 @@ function msg_handler($errno, $msg_text, $errfile, $errline)  		$msg_text = $msg_long_text;  	} -	if (!defined('E_DEPRECATED')) -	{ -		define('E_DEPRECATED', 8192); -	} -  	switch ($errno)  	{  		case E_NOTICE: @@ -4727,6 +4700,7 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false)  		'height' => $row['avatar_height'],  	); +	/* @var $phpbb_avatar_manager \phpbb\avatar\manager */  	$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');  	$driver = $phpbb_avatar_manager->get_driver($row['avatar_type'], $ignore_config);  	$html = ''; @@ -4912,6 +4886,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =  	// This path is sent with the base template paths in the assign_vars()  	// call below. We need to correct it in case we are accessing from a  	// controller because the web paths will be incorrect otherwise. +	/* @var $phpbb_path_helper \phpbb\path_helper */  	$phpbb_path_helper = $phpbb_container->get('path_helper');  	$corrected_path = $phpbb_path_helper->get_web_root_path();  	$web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $corrected_path; @@ -4950,6 +4925,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =  	$notifications = false;  	if ($config['load_notifications'] && $user->data['user_id'] != ANONYMOUS && $user->data['user_type'] != USER_IGNORE)  	{ +		/* @var $phpbb_notifications \phpbb\notification\manager */  		$phpbb_notifications = $phpbb_container->get('notification_manager');  		$notifications = $phpbb_notifications->load_notifications(array( @@ -5280,6 +5256,8 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =  	if ($call_cron)  	{  		global $phpbb_container; + +		/* @var $cron \phpbb\cron\manager */  		$cron = $phpbb_container->get('cron.manager');  		$task = $cron->find_one_ready_task();  | 
