brauche hilfe in init.php

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • brauche hilfe in init.php

    Folgender Fehler tritt auf:

    Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /mnt/web6/31/07/51555307/htdocs/toplist/init.php on line 67

    die init.php sieht folgendermaßen aus:
    Code:
    <?PHP
    
    define(INIT, "INIT");
    
    include('arphp.php');
    
    $DB = NULL;
    
    if( $_SERVER['REQUEST_METHOD'] == 'GET' )
    {
        if( !isInitialized() )
        {
            displayMain();
        }
        else
        {
            displayRemove();
        }
    }
    else
    {
        if( !isInitialized() )
        {
            runTests();
            setupTables();
            setupFiles();
            displayComplete();
        }
        else
        {
            displayRemove();
        }
    }
    
    
    
    function displayMain( $pass = true, $TPL = NULL )
    {
        include("{$GLOBALS['IDIR']}/_init_main.php");
    }
    
    
    
    function isInitialized()
    {
        if(
          !file_exists("{$GLOBALS['ADIR']}/.htaccess") ||
          !file_exists("{$GLOBALS['ADIR']}/.htpasswd") ||
          !$GLOBALS['USERNAME']                        ||
          !$GLOBALS['PASSWORD']
          )
          {
                return false;
          }
          else
          {
                return true;
          }
    }
    
    
    
    function runTests()
    {
        $TPL = array();
    
        mysqlTests(&$TPL);
    
        $TPL['DDIR_WRITE'] = is_writeable($GLOBALS['DDIR']);
        $TPL['ADIR_WRITE'] = is_writeable($GLOBALS['ADIR']);
        $TPL['IDIR_WRITE'] = is_writeable($GLOBALS['IDIR']);
        $TPL['CDIR_WRITE'] = is_writeable($GLOBALS['CDIR']);
    
        if( in_array(false, $TPL) )
        {
            displayMain(false, $TPL);
            exit;
        }
    }
    
    
    
    function mysqlTests(&$TPL)
    {
        $TPL['DB_CONNECT'] = true;
        $TPL['DB_SELECT']  = true;
    
        error_reporting(E_ALL);
        restore_error_handler();
    
        $dbh = @mysql_connect($_POST['Hostname'], $_POST['Username'], $_POST['Password']);
    
        if( !$dbh )
        {
            $TPL['DB_CONNECT']  = false;
            $TPL['DB_SELECT']   = false;
            $TPL['CONNECT_ERR'] = mysql_error();
    
            if( !$TPL['CONNECT_ERR'] )
            {
                $TPL['CONNECT_ERR'] = 'Could not connect to database with supplied values';
            }
        }
        else
        {
            if( !mysql_select_db($_POST['Database']) )
            {
                $TPL['DB_SELECT']  = false;
                $TPL['SELECT_ERR'] = mysql_error();
            }
    
            mysql_close($dbh);
        }
    
        error_reporting(E_ERROR|E_PARSE);
        set_error_handler('errorHandler');
    }
    
    
    
    function setupTables()
    {
        global $DB;
    
        include_once("{$GLOBALS['DDIR']}/tables.php");
    
        $DB = new DB($_POST['Hostname'], $_POST['Username'], $_POST['Password']);
    
        $DB->Connect();
        $DB->SelectDB($_POST['Database']);
    
        $existing = $DB->GetTables();
    
        foreach( $table as $name => $query )
        {
            if( !$existing[$name] )
            {
                $DB->Create($query);
            }
        }
    
        $DB->Disconnect();
    }
    
    
    
    function setupFiles()
    {
        $cwd = getcwd();
    
        $vardata .= "<?PHP\n";
        $vardata .= "\$USERNAME = '{$_POST['Username']}';\n";
        $vardata .= "\$PASSWORD = '{$_POST['Password']}';\n";
        $vardata .= "\$HOSTNAME = '{$_POST['Hostname']}';\n";
        $vardata .= "\$DATABASE = '{$_POST['Database']}';\n";
        $vardata .= "?".">";
    
        fileWrite("{$GLOBALS['DDIR']}/vars.php", $vardata);
    
        $block  .= "AuthName \"Restricted Area\"\n";
        $block  .= "AuthType Basic\n";
        $block  .= "AuthUserFile /dev/null\n";
        $block  .= "AuthGroupFile /dev/null\n\n";
        $block  .= "require valid-user";
    
        fileWrite("{$GLOBALS['DDIR']}/.htaccess", $block);
        fileWrite("{$GLOBALS['CDIR']}/.htaccess", $block);
        fileWrite("{$GLOBALS['IDIR']}/.htaccess", $block);
    
        $htdata .= "AuthName \"AutoRank PHP Administration\"\n";
        $htdata .= "AuthType Basic\n";
        $htdata .= "AuthUserFile $cwd/admin/.htpasswd\n";
        $htdata .= "AuthGroupFile /dev/null\n\n";
        $htdata .= "require valid-user\n\n";
    
        fileWrite("{$GLOBALS['ADIR']}/.htpasswd", "admin:" . crypt("admin"));
        fileWrite("{$GLOBALS['ADIR']}/.htaccess", $htdata);
    }
    
    
    
    function displayComplete()
    {
        include("{$GLOBALS['IDIR']}/_init_done.php");
    }
    
    
    
    function displayRemove()
    {
        include("{$GLOBALS['IDIR']}/_init_remove.php");
    }
    
    ?>
    was ist zu tun? bzw. wieso dieser fehler? liegts an der php-version?
    Zuletzt geändert von wahsaga; 09.06.2007, 11:05.

  • #2
    Re: brauche hilfe in init.php

    Original geschrieben von entfernen
    was ist zu tun?
    Neben dem Lesen unserer Regeln, was Überbreite und Nutzung von [php]-Tags angeht - das, was in der Meldung drinsteht:

    If you would like to pass it by reference, modify the declaration of [runtime function name]()

    oder

    If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer.
    I don't believe in rebirth. Actually, I never did in my whole lives.

    Kommentar


    • #3
      sorry, danke, aber damit kann ich auch nichts anfangen. ne lösung auf deutsch wär mir lieb. danke

      Kommentar


      • #4
        Entweder Deklaration der Funktion so anpassen, dass in dieser der Parameter gleich als per Referenz zu übergebender gekennzeichnet wird, oder
        genannte Einstellung in der Konfiguration machen, damit das derzeitige, nicht mehr aktuelle Vorgehen weiterhin toleriert wird (was aber in künftigen PHP-Versionen ggf. nicht mehr unterstützt werden könnte).
        I don't believe in rebirth. Actually, I never did in my whole lives.

        Kommentar


        • #5
          ok,danke

          Kommentar

          Lädt...
          X