Ankündigung

Einklappen
Keine Ankündigung bisher.

Parse error: syntax error, unexpected 'new' (T_NEW) in analyse.php on line 124

Einklappen

Neue Werbung 2019

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

  • Parse error: syntax error, unexpected 'new' (T_NEW) in analyse.php on line 124

    Hallo Community,
    ich habe ein großes Problem. Seit kurzem funktioniert meine Homepage nicht mehr, da sie auf PHP 7.2 (vormals 5.6) umgestellt wurde. Anbei die betreffende Datei. Ich bin absoluter Laie mit PHP, hatte damals ein Content Management System in PHP heruntergeladen, das jedoch seit über 12 Jahren nicht mehr betrieben wird. Alle bisherigen PHP-Versionswechsel konnte ich lösen, da "deprecated"-Error-Meldungen angezeigt wurden, deren Neuerungen ich im PHP-Forum fand und dementsprechend ändern konnte.
    Aber jetzt ist mein Latein am Ende. Es ist auch anzunehmen, dass, wenn dieser Fehler behoben wird, andere auftauchen werden. Es könnte also eine "lang dauernde Geschichte" werden.
    Hier der Inhalt der Datei (die entsprechende Zeile habe ich "fett" markiert).
    Im Voraus besten Dank

    PHP-Code:
    <?php
    /* $Id: parser.php,v 1.6.2.43 2006/06/18 18:06:10 ignatius0815 Exp $ */
    /*
    +----------------------------------------------------------------------+
    | phpCMS Content Management System - Version 1.2
    +----------------------------------------------------------------------+
    | phpCMS is Copyright (c) 2001-2006 by the phpCMS Team
    +----------------------------------------------------------------------+
    | This program is free software; you can redistribute it and/or modify
    | it under the terms of the GNU General Public License as published by
    | the Free Software Foundation; either version 2 of the License, or
    | (at your option) any later version.
    |
    | This program is distributed in the hope that it will be useful, but
    | WITHOUT ANY WARRANTY; without even the implied warranty of
    | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    | General Public License for more details.
    |
    | You should have received a copy of the GNU General Public License
    | along with this program; if not, write to the Free Software
    | Foundation, Inc., 59 Temple Place - Suite 330, Boston,
    | MA 02111-1307, USA.
    +----------------------------------------------------------------------+
    | Contributors:
    | Michael Brauchl (mcyra)
    | Tobias Dönz (tobiasd)
    | Beate Paland (beate76)
    | Henning Poerschke (hpoe)
    | Markus Richert (e157m369)
    | Thilo Wagner (ignatius0815)
    +----------------------------------------------------------------------+
    */

    // protect include files from direct execution
    define('PHPCMS_RUNNING',1);

    // start parser time-measurement
    $PHPCMS_TIMER_START microtime();

    // check the PHP version
    $php_version explode('.'phpversion());
    if((
    $php_version[0] == AND $php_version[1] == AND $php_version[2] < 1) OR ($php_version[0] < 4)) {
    die(
    '<b>This is phpCMS 1.2.2.</b><br /><br />The parser is no more supporting PHP 4.0.1 or older!<br /><br />Please update to the latest version of PHP 4...');
    }

    // define the phpCMS-internal includepath
    // take care of a trailing slash
    define('PHPCMS_INCLUDEPATH'dirname(__FILE__).'/include/');

    // include the base class to create a clean, PHP-version-independent scope
    include(PHPCMS_INCLUDEPATH.'class.phpcms.php');
    $PHPCMS = new PHPCMS;
    // now cleanup the scope
    $PHPCMS->prepare_environment_vars();

    // decode and split up the $QUERY_STRING (params the parser.php is called with) into the array $PHPCMS->_QUERY_STRING
    $PHPCMS->set_environment_var('ENV''QUERY_STRING'urldecode($QUERY_STRING));
    $PHPCMS->set_environment_var('SERVER''QUERY_STRING'urldecode($QUERY_STRING));
    $PHPCMS->extract_special_separated($PHPCMS->_QUERY_STRING'''?'.$QUERY_STRING'''');
    // set the lowercase $PHPCMS->_query_string-array used for case-save comparisons
    $PHPCMS->set_case_insensitive_keys($PHPCMS->_QUERY_STRING'$this->_query_string''''');

    // prepare, decode and split up the $REQUEST_URI (the users submission) into the array $PHPCMS->_REQUEST_URI
    if(!isset($REQUEST_URI) || $REQUEST_URI == '') {
    $REQUEST_URI $PHP_SELF.'?'.$_SERVER['QUERY_STRING'];
    }
    $PHPCMS->set_environment_var('ENV''REQUEST_URI'urldecode($REQUEST_URI));
    $PHPCMS->set_environment_var('SERVER''REQUEST_URI'urldecode($REQUEST_URI));
    $PHPCMS->extract_special_separated($PHPCMS->_REQUEST_URI'''?_URI_='.$REQUEST_URI'''');
    // set the lowercase $PHPCMS->_request_uri-array used for case-save comparisons
    $PHPCMS->set_case_insensitive_keys($PHPCMS->_REQUEST_URI'$this->_request_uri''''');

    // set $PHPCMS->TIMER and unset the helper
    $PHPCMS->TIMER['START'] = $PHPCMS->get_time($PHPCMS_TIMER_START);
    unset(
    $PHPCMS_TIMER_START);


    // load helper-library
    include(PHPCMS_INCLUDEPATH.'class.lib_error_phpcms .php');
    include(
    PHPCMS_INCLUDEPATH.'class.lib_data_file_ph pcms.php');
    include(
    PHPCMS_INCLUDEPATH.'class.lib_phpcms.php') ;
    $PHP = new LibphpCMS;

    // load configuration
    include(PHPCMS_INCLUDEPATH.'default.php');
    $DEFAULTS = new defaults;

    // set PHP error-reporting
    if(isset($DEFAULTS->ERROR_ALL) && $DEFAULTS->ERROR_ALL == 'on') {
    error_reporting(E_ALL); // 2047
    ini_set('display_errors','1');
    }
    elseif(isset(
    $DEFAULTS->DEBUG) && $DEFAULTS->DEBUG == 'on') {
    error_reporting(E_ALL & ~E_NOTICE); // 2039
    }
    else {
    error_reporting(E_ALL & ~(E_NOTICE E_WARNING)); // 2037
    }

    // check for EDIT-mode
    if((isset($_COOKIE['phpCMSedit1']) OR isset($_COOKIE['phpCMSedit2']))
    AND !isset(
    $_REQUEST['phpcmsaction'])
    AND !
    in_array('debug'array_keys($PHPCMS->_query_string),TRUE)) {
    $PHPCMS->set_environment_var('POST''phpcmsaction''EDIT');
    $PHP->NoCache();
    }

    $plugindir $DEFAULTS->PLUGINDIR;

    // continue with parsing a given content-file...
    if (isset ($_GET ['file']) && !isset($HTTP_POST_VARS['phpcmsaction'] ) AND !isset ($HTTP_GET_VARS['phpcmsaction'])) {
    // write raw statistics entry
    if($DEFAULTS->STATS == 'on') {
    include(
    PHPCMS_INCLUDEPATH.'/lib.log_stats_phpcms.php');
    }
    // write referrer log
    // to be displayed with topref.php plug-in or alternative script
    if($DEFAULTS->REFERRER == 'on') {
    include(
    PHPCMS_INCLUDEPATH.'/lib.log_referrer_phpcms.php');
    }
    // Load the i18n Handler
    if (isset ($_GET ['file']) && isset($DEFAULTS->I18N) && 'on' == $DEFAULTS->I18N) {
    include(
    PHPCMS_INCLUDEPATH.'/class.lib_i18n_phpcms.php');
    $I18N = &new i18n;
    }
    $PHPCMS->check_secure_stealth();
    include(
    PHPCMS_INCLUDEPATH.'/class.cache_phpcms.php');
    exit;
    }

    // ... else load the GUI...
    switch(strtoupper($_REQUEST['phpcmsaction'])) {
    case 
    'FRAMESET':
    include(
    PHPCMS_INCLUDEPATH.'/class.layout_phpcms.php');
    DrawFrameset();
    break;

    case 
    'OPTIONS':
    $INIFILE PHPCMS_INCLUDEPATH.'/default.php';
    include(
    PHPCMS_INCLUDEPATH.'/class.layout_phpcms.php');
    include(
    PHPCMS_INCLUDEPATH.'/class.options_phpcms.php');
    break;

    case 
    'SPIDER':
    include(
    PHPCMS_INCLUDEPATH.'/class.layout_phpcms.php');
    include(
    PHPCMS_INCLUDEPATH.'/class.lib_spider_phpcms.php');
    include(
    PHPCMS_INCLUDEPATH.'/class.parser_phpcms.php');
    include(
    PHPCMS_INCLUDEPATH.'/class.spider_phpcms.php');
    break;

    case 
    'STAT':
    $INIFILE PHPCMS_INCLUDEPATH.'/default.php';
    include(
    PHPCMS_INCLUDEPATH.'/class.layout_phpcms.php');
    include(
    PHPCMS_INCLUDEPATH.'/class.stat_phpcms.php');
    break;

    case 
    'IMAGES':
    include(
    PHPCMS_INCLUDEPATH.'/class.images_phpcms.php');
    break;

    case 
    'FILEMANAGER':
    include(
    PHPCMS_INCLUDEPATH.'/class.layout_phpcms.php');
    include(
    PHPCMS_INCLUDEPATH.'/class.filemanager_phpcms.php');
    $FILEMANAGER = new FILEMANAGER;
    break;

    case 
    'EDIT':
    // Load the i18n Handler
    if (isset ($_GET ['file']) && isset($DEFAULTS->I18N) && 'on' == $DEFAULTS->I18N) {
    include(
    PHPCMS_INCLUDEPATH.'/class.lib_i18n_phpcms.php');
    $I18N = &new i18n;
    }
    include(
    PHPCMS_INCLUDEPATH.'/class.edit_phpcms.php');
    break;

    case 
    'NAV':
    include(
    PHPCMS_INCLUDEPATH.'/class.layout_phpcms.php');
    DrawNavi();
    break;

    case 
    'LOGOUT':
    include(
    PHPCMS_INCLUDEPATH.'/class.layout_phpcms.php');
    break;

    case 
    'UPDATE':
    include(
    PHPCMS_INCLUDEPATH.'/class.layout_phpcms.php');
    CheckUpdate();
    break;

    case 
    'SEARCH':
    include(
    PHPCMS_INCLUDEPATH.'/class.search_phpcms.php');
    break;

    case 
    'HTTPINDEX':
    include(
    PHPCMS_INCLUDEPATH.'/class.http_indexer_phpcms.php');
    break;

    default:
    // Load the i18n Handler
    if (isset ($_GET ['file']) && isset($DEFAULTS->I18N) && 'on' == $DEFAULTS->I18N) {
    include(
    PHPCMS_INCLUDEPATH.'/class.lib_i18n_phpcms.php');
    $I18N = &new i18n;
    }
    $PHPCMS->check_secure_stealth();
    include(
    PHPCMS_INCLUDEPATH.'/class.cache_phpcms.php');
    }

    ?>

  • #2
    Fremder Code -> Jobangebot erstellen oder beim Hersteller nachfragen.

    Kommentar


    • #3
      hallo,
      danke für die Antwort.
      Das heißt, da es nicht mein Code ist, kann/will mir keiner unentgeldlich helfen ?
      Ich weiß, dass es sich um folgenden Fehler handelt:
      The result of the new statement can no longer be assigned to a variable by reference:
      Aber ich kann dies nicht lösen.
      Es geht also "nur" um das "new-statement" und die Zordnung einer Variablen über einen Verweis. Keiner eine Lösung ?

      Kommentar


      • #4
        Das ist ein Forum für Hilfe zur Selbsthilfe. Wenn du nicht daran interessiert bist Programmieren zu lernen, musst du dir jemanden suchen, der es für dich macht. Ob es jemand gratis macht, ist wieder eine andere Frage. Du kannst ja ein Jobangebot ohne Bezahlung erstellen oder es im Unterforum Projekhilfe einstellen (dazu am besten einen Mod um Verschiebung bitten).

        Kommentar


        • #5
          Natürlich will ich lernen. Sollte daran zu erkennen sein, dass ich den/die Fehler/Fehlermeldung weiter eingegrenzt habe und das Problem erkannt habe, es aber selbst nicht lösen kann.

          Kommentar


          • #6
            & erzeugt eine Referenz. Sowas ist aber bei Objekten seit PHP 5 nicht mehr notwendig bzw. inzwischen sogar verboten. Dein Code sieht so aus, als wäre er für PHP 4 geschrieben.

            Kommentar


            • #7
              Danke für deine Antwort. Ja, ist höchstwahrscheinlich für PHP4 geschrieben, da ca. 15 Jahre alt oder älter. Wie gesagt, bisher konnte ich alles lösen (deprecated).
              Das heißt das "&" einfach weglassen ?
              Falls diese Frage dir missfällt: ich bin halt nur ein Anfänger und versuche mich weiterzubilden ... danke.

              Kommentar


              • #8
                Jein. Es kann sein, dass das Nebeneffekte hat, da sich wie gesagt die Objekte unter PHP 5/7 anders verhalten als in PHP 4. Aber ich würde es mal rausnehmen und testen ob noch alles geht.

                Kommentar


                • #9
                  danke, ja, das werde ich selbstverständlich machen ... "Nebeneffekte" sagt mir was, da ich momentan Python 3 lerne. "Versuch macht kluch !" Werden sicherlich auch weitere Dateien den Fehler haben, aber weiß ja nun, was ich mal probieren kann ... hoffe, daß ich evtl. auftretende Fehler (Nebeneffekte) durch Recherche und Ausprobieren selbst lösen kann ... vorerst vielen Dank für deine tolle Hilfe !

                  Kommentar


                  • #10
                    darf eine eckige Klammer eigentlich in einem String vorkommen ?
                    Code:
                    $text2 = '';
                    $text = 'blablub';
                    $text2 .= '[\''.$text.'\']';
                    Ausgabe (?): ['blablub']
                    zur Info: kann momentan XAMPP nicht installieren. Kann also PHP-Code nicht testen

                    Kommentar


                    • #11
                      Zitat von Perlchamp Beitrag anzeigen
                      darf eine eckige Klammer eigentlich in einem String vorkommen ?
                      Code:
                      $text2 = '';
                      $text = 'blablub';
                      $text2 .= '[\''.$text.'\']';
                      Ausgabe (?): ['blablub']
                      zur Info: kann momentan XAMPP nicht installieren. Kann also PHP-Code nicht testen
                      Ja darf sie.

                      Nachtrag: Für kleine Tests kannst du auch diesen Online Editor nutzen: http://www.writephponline.com/

                      Kommentar


                      • #12
                        um einzeiligen php code zu testen benötigt man keinen xamp, zudem hat php einen eingebauten server:
                        http://php.net/manual/de/features.co....webserver.php

                        dein code hat ein copyright von 2006, bei den download dateien steht 2003

                        https://sourceforge.net/p/phpcms/act...18460b2d914a0d
                        da dies ein flat file cms ist, scheint mir eine migration zu python (was du ja wohl lernst) theoretisch möglich, auch wenn das ganze mit django sicher schöner wird.

                        Kommentar


                        • #13
                          moinsen,
                          danke für eure Antworten ...
                          @CPCoder:
                          danke für den Tipp werde ich auch nutzen, damit ich euch nicht ständig "nerve". XAMPP werde ich aber dennoch später brauchen, aber für schnipsel nicht, da hast du Recht.

                          @tomBuilder:
                          ja, ist ein uraltes PHPcms. Tut gute Dienste, wenn ich es auf 7.3 (mit euirer Unterstützung/Hilfestellung) uppen kann ... war und bin immer noch sehr zufrieden damit
                          nein, ich will es nicht nach Python migrieren. Mit Python habe ich andere Dinge vor Aber danke für den Tipp (django)

                          Kommentar


                          • #14
                            moinsen,
                            ich mal wieder ....
                            bin bis jetzt sehr gut vorangekommen, habe viele Fehlermeldungen "weghauen" können, aber jetzt ist es mal wieder soweit - komme nicht weiter. Ich habe nun folgenden Fehler:
                            Warning: count(): Parameter must be an array or an object that implements Countable

                            vielleicht könnt ihr mir weiterhelfen ... als Anfänger ist das Debuggen schon eine äußerst undankbare Aufgabe !
                            mir würde es (hoffentlich) bereits genügen, wenn mir jemand sagen könnte, wonach ich (im weiteren Verlauf des Scripts) evtl. suchen soll.

                            Im Voraus besten Dank !

                            /*********************************************
                            replace all PAXTAGS with their values
                            *********************************************/
                            function setPAXTAGS(&$template) {
                            _getPAXMENU();
                            $template = _setPAXINC($template);
                            $template = _setPAXRTF($template);
                            $template = _setPAXHIGHLIGHT($template);
                            $template = _setPAXMENU($template);
                            $template = _setPAXCOMBO($template);
                            $template = _setPAXCOMBOALL($template);
                            $template = _setPAXLASTMOD($template);
                            $template = _change_phpCMS_TAGS($template);
                            return $template;
                            }

                            /*********************************************
                            scan php within files
                            *********************************************/
                            function _PAXparser($template) {
                            global $PAXCODE_ARRAY;

                            $countbrain = count($PAXCODE_ARRAY);
                            $counttemplate = count($template);

                            .
                            .
                            .

                            Kommentar


                            • #15
                              Ich hab's geschafft !
                              Die Website läuft wieder
                              Danke an alle !

                              Kommentar

                              Lädt...
                              X