Seite 1 von 1

Nach Update auf 2.0.13 sehr langsamer Admin-Index

Verfasst: 01.03.2005 10:32
von JG_SW
Hallo @All,

ich habe mein Forum erst vor kurzem eingerichtet und musste jetzt das erste mal patchen. Seitdem braucht mein Admin-Index seeehhhr lange bis er aufgebaut ist, zeigt dann aber die korrekten Daten an.

Verwendet habe ich aus "phpBB-2.0.13-patch.zip" zuerst:

update_to_latest.php -> ohne probleme durchgelaufen

dann:

patch -cl -d /usr/local/www/*****/phpBB2/ -p1 < phpBB-2.0.11_to_2.0.13.patch

Patching file includes/sessions.php using Plan A...
Hunk #1 succeeded at 6.
Hunk #2 failed at 79.

---> Das hatte ich kurz zuvor schon per Hand gemacht! Sollte also OK sein.

Patching file viewtopic.php using Plan A...
Hunk #1 succeeded at 6.
Hunk #2 succeeded at 495.
Hunk #3 failed at 1107.

---> Auch das hatte ich kurz zuvor schon per Hand gemacht! Sollte also ebenfalls OK sein.

Der Rest ist ohne Probleme durchgelaufen.


Ich habe gesehen, dass einige subSilver Dateien auch gepatched werden. Mein aktueller Style ist fiBlack. Damit scheint es aber nicht zusammen zu hängen da, wenn ich auf subSilver umstelle, der Admin-Index genau so lange zum laden braucht.

Alles andere im Forum wird gewohnt schnell angezeigt.

Wo könnte mein Problem liegen?

Grüße,

JG

Verfasst: 01.03.2005 10:34
von Dave

Code: Alles auswählen

################################################################# 
## MOD Title: Version Cache mod
## MOD Version: 0.02
## MOD Author: CyberAlien <no@public_email> (Vjacheslav Trushkin) http://www.phpbbstyles.com
## MOD Description: 
##		This mod caches phpBB version update information so phpBB checks
##		for update only once a day instead of checking it every time you
##		open admin control panel index.
##
## Installation Level:	Easy
## Installation Time:	1-2 Minutes
## Files To Edit (1): admin/index.php
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/index.php

#
#-----[ FIND ]---------------------------------------------
# around line 570
	if ($fsock = @fsockopen('www.phpbb.com', 80, $errno, $errstr))
	{

# 
#-----[ BEFORE, ADD ]---------------------------------------
# 
	// Version cache mod start
	// Change following two variables if you need to:
	$cache_update = 86400; // 24 hours cache timeout. change it to whatever you want
	$cache_file = '../cache/phpbb_update_' . $board_config['default_lang'] . $board_config['version'] . '.php'; // file where to store cache

	$do_update = true;
	if(@file_exists($cache_file))
	{
		$last_update = 0;
		$version_info = '';
		@include($cache_file);
		if($last_update && !empty($version_info) && $last_update > (time() - $cache_update))
		{
			$do_update = false;
		}
	}

	if($do_update)
	{
		// Version cache mod end

#
#-----[ FIND ]---------------------------------------------
# around line 641
	$version_info .= '<p>' . $lang['Mailing_list_subscribe_reminder'] . '</p>';

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
		// Version cache mod start
		if(@$f = fopen($cache_file, 'w'))
		{
			fwrite($f, '<' . '?php $last_update = ' . time() . '; $version_info = "' . addslashes($version_info) . '"; ?' . '>');
			fclose($f);
			@chmod($cache_file, 0777);
		}
	}
	// Version cache mod end

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
Damit sollte es schneller gehen :wink:
Beachte bitte das der Ordner Cache CHMOD777 braucht


MfG
Dave

Verfasst: 01.03.2005 10:57
von JG_SW
Das ist vermutlich mein Problem.

Code: Alles auswählen

if ($fsock = @fsockopen('www.phpbb.com', 80, $errno, $errstr)) 
Grundlegend dürfen meine Webserver nicht über den Port 80 surfen gehen. Die Funktion läuft damit in einen Timeout.

Leider wird mir dafür auch keine Fehlermeldung ausgegeben.

Grundlegend wird nichts über den Update Status meines phpBB auf dem Admin-Index angezeigt.

Ist das dann in meinem Fall OK?

Wie deaktiviere ich diese Funktion am einfachsten?

Grüße,

JG

Verfasst: 01.03.2005 11:04
von Dave

Code: Alles auswählen

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/index.php

#
#-----[ DELETE ]---------------------------------------------
# 

	// Check for new version
	$current_version = explode('.', '2' . $board_config['version']);
	$minor_revision = (int) $current_version[2];

	$errno = 0;
	$errstr = $version_info = '';

	if ($fsock = @fsockopen('www.phpbb.com', 80, $errno, $errstr))
	{
		@fputs($fsock, "GET /updatecheck/20x.txt HTTP/1.1\r\n");
		@fputs($fsock, "HOST: www.phpbb.com\r\n");
		@fputs($fsock, "Connection: close\r\n\r\n");

		$get_info = false;
		while (!@feof($fsock))
		{
			if ($get_info)
			{
				$version_info .= @fread($fsock, 1024);
			}
			else
			{
				if (@fgets($fsock, 1024) == "\r\n")
				{
					$get_info = true;
				}
			}
		}
		@fclose($fsock);

		$version_info = explode("\n", $version_info);
		$latest_head_revision = (int) $version_info[0];
		$latest_minor_revision = (int) $version_info[2];
		$latest_version = (int) $version_info[0] . '.' . (int) $version_info[1] . '.' . (int) $version_info[2];

		if ($latest_head_revision == 2 && $minor_revision == $latest_minor_revision)
		{
			$version_info = '<p style="color:green">' . $lang['Version_up_to_date'] . '</p>';
		}
		else
		{
			$version_info = '<p style="color:red">' . $lang['Version_not_up_to_date'];
			$version_info .= '<br />' . sprintf($lang['Latest_version_info'], $latest_version) . sprintf($lang['Current_version_info'], '2' . $board_config['version']) . '</p>';
		}
	}
	else
	{
		if ($errstr)
		{
			$version_info = '<p style="color:red">' . sprintf($lang['Connect_socket_error'], $errstr) . '</p>';
		}
		else
		{
			$version_info = '<p>' . $lang['Socket_functions_disabled'] . '</p>';
		}
	}
	
	$version_info .= '<p>' . $lang['Mailing_list_subscribe_reminder'] . '</p>';
	

	$template->assign_vars(array(
		'VERSION_INFO'	=> $version_info,
		'L_VERSION_INFORMATION'	=> $lang['Version_information'])
	);

# 
#-----[ OPEN ]--------------------------------------------- 
# 
templates/subSilver/admin/index_body.tpl

#
#-----[ DELETE ]---------------------------------------------
# 

<h1>{L_VERSION_INFORMATION}</h1>

{VERSION_INFO}

<br />
Dann hast du die funktion nicht mehr ;)

Verfasst: 01.03.2005 11:14
von JG_SW
Danke für die superschnelle Hilfe. Jetzt ist wieder alles so wie es sein soll!

Grüße,

JG

Verfasst: 07.03.2005 09:45
von ReneDD
Die Mod ist an sich sehr gut. Bei mir kommt allerdings nach einem Tag folgende nette Meldung.

Code: Alles auswählen

Your installation does not seem to be up to date. Updates are available for your version of phpBB, please visit http://www.phpbb.com/downloads.php to obtain the latest version.
The latest available version is phpBB 0.0.13.You are running phpBB 2.0.13.
Auszug des Codes.

Code: Alles auswählen

   // Check for new version
   $current_version = explode('.', '2' . $board_config['version']);
   $minor_revision = (int) $current_version[2];

   $errno = 0;
   $errstr = $version_info = '';
   // Version cache mod start
   // Change following two variables if you need to:
   $cache_update = 86400; // 24 hours cache timeout. change it to whatever you want
   $cache_file = '../cache/phpbb_update_' . $board_config['default_lang'] . $board_config['version'] . '.php'; // file where to store cache

   $do_update = true;
   if(@file_exists($cache_file))
   {
      $last_update = 0;
      $version_info = '';
      @include($cache_file);
      if($last_update && !empty($version_info) && $last_update > (time() - $cache_update))
      {
         $do_update = false;
      }
   }

   if($do_update)
   {
      // Version cache mod end 
   if ($fsock = @fsockopen('www.phpbb.com', 80, $errno, $errstr))
   {
      @fputs($fsock, "GET /updatecheck/20x.txt HTTP/1.1\r\n");
      @fputs($fsock, "HOST: www.phpbb.com\r\n");
      @fputs($fsock, "Connection: close\r\n\r\n");

      $get_info = false;
      while (!@feof($fsock))
      {
         if ($get_info)
         {
            $version_info .= @fread($fsock, 1024);
         }
         else
         {
            if (@fgets($fsock, 1024) == "\r\n")
            {
               $get_info = true;
            }
         }
      }
      @fclose($fsock);

      $version_info = explode("\n", $version_info);
      $latest_head_revision = (int) $version_info[0];
      $latest_minor_revision = (int) $version_info[2];
      $latest_version = (int) $version_info[0] . '.' . (int) $version_info[1] . '.' . (int) $version_info[2];

      if ($latest_head_revision == 2 && $minor_revision == $latest_minor_revision)
      {
         $version_info = '<p style="color:green">' . $lang['Version_up_to_date'] . '</p>';
      }
      else
      {
         $version_info = '<p style="color:red">' . $lang['Version_not_up_to_date'];
         $version_info .= '<br />' . sprintf($lang['Latest_version_info'], $latest_version) . sprintf($lang['Current_version_info'], '2' . $board_config['version']) . '</p>';
      }
   }
   else
   {
      if ($errstr)
      {
         $version_info = '<p style="color:red">' . sprintf($lang['Connect_socket_error'], $errstr) . '</p>';
      }
      else
      {
         $version_info = '<p>' . $lang['Socket_functions_disabled'] . '</p>';
      }
   }
   
   $version_info .= '<p>' . $lang['Mailing_list_subscribe_reminder'] . '</p>';
         // Version cache mod start
      if(@$f = fopen($cache_file, 'w'))
      {
         fwrite($f, '<' . '?php $last_update = ' . time() . '; $version_info = "' . addslashes($version_info) . '"; ?' . '>');
         fclose($f);
         @chmod($cache_file, 0777);
      }
   }
   // Version cache mod end 

   $template->assign_vars(array(
      'VERSION_INFO'   => $version_info,
      'L_VERSION_INFORMATION'   => $lang['Version_information'])
   );
	$template->pparse("body");

	include('./page_footer_admin.'.$phpEx);

}
Wenn ich die Cache Mod nicht einbaue geht alles einwandfrei. Der Ordner "cache" hat 777.

mfG
Rene

Verfasst: 07.03.2005 17:00
von PetraK
Hallo ReneDD,
das gleiche Problem hatte ich auch nach dem Update. Einfach den Ordner Cache auf dem FTP-Server leeren und die Meldung sollte nicht mehr kommen bzw. es sollte stattdessen diese Meldung im ACP erscheinen:

Deine Installation ist aktuell. Es sind keine Updates für deine phpBB-Version verfügbar.

Grüsse PetraK

Verfasst: 08.03.2005 18:13
von ReneDD
Ja das geht schon. Aber ich muss dann jeden Tag die Datei löschen. Für mich erfüllt diese Mod dann keinen sinn.

mfG
Rene