1. Dashboard
  2. Forum
    1. Unerledigte Themen
  3. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team-Mitglieder
    4. Trophäen
    5. Mitgliedersuche
  4. Tutorial Bereich
  • Anmelden
  • Registrieren
  • Suche
Dieses Thema
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Seiten
  • Forum
  • Lexikon
  • Erweiterte Suche
  1. Informatik Forum
  2. Webmaster & Internet
  3. Entwicklung

problem mit PEAR bei php4 -> php5

  • maciek
  • 23. März 2005 um 13:06
  • Unerledigt
  • maciek
    16
    maciek
    Mitglied
    Punkte
    2.805
    Beiträge
    434
    • 23. März 2005 um 13:06
    • #1

    Ich hab jetzt mal im xampp auf php5 umgeschaltet und werde mit folgenden Problemen bei PEAR konfrontiert:

    Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /xxx/PEAR.php on line 252

    [2048] Assigning the return value of new by reference is deprecated
    file: /xxx/DB.php -> line: 470

    Gibt es eine Version von PEAR, die php5 kompatibel ist, oder muss man das alles per Hand umstellen? Irgendwo hab ich was mit error reporting gefunden, aber mit

    Code
    if (version_compare(phpversion(), "5.0.0") == -1)
        error_reporting(E_ALL);
    else
        error_reporting(E_ALL | E_STRICT);


    komm ich auch zu keinem besseren Ergebnis. Hat jemand Erfahrungen mit PEAR und php5?

    Thanx.

    P.S.: Kann es wirklich sein, dass das die einzig wahre Möglichkeit ist?!

    Zitat von http://www.issociate.de/board/post/184979/Pear_DB_class_not_PHP5_strict_compatible?.html


    PEAR uses a lot of (IMHO ugly) hacks to circumvent bugs in (very) early
    php versions. Back when PHP 4 was released there was a bug with
    assigning objects to variables, at a certain point people found out that
    by using $a &= new class; circumvented that bug, and didn't pose any
    real problem in later versions, so PEAR uses that still. As of PHP
    5.0.0, this is considered bad behaviour, but since PEAR should be usable
    for old versions of PHP aswell, it still keeps this syntax.

    I personally find most PEAR packages extremely bloated, and badly coded,
    but that's just a personal opinion. However, you can edit the package
    yourself and replace the &= new to = new :)

    Alles anzeigen

    P.P.S: Hab jetzt noch weiter gesucht ... und folgere daraus, dass es nur auf die richtigen Einstellungen des error reportings ankommt ... welches Level muss man aber optimalerweise wählen? Ideen?

    Zitat von http://www.sitepoint.com/blog-post-view.php?id=234249


    he switch from PHP4 to PHP5 required changing a total of 8 lines of code in some of the core components, plus adding a new compatibility function that detects the PHP version and will define a clone() function in case the server still runs PHP4 - so until we start using the exception handling, which is planned for the next versions, we can even switch between PHP4 and 5 seamlessly.

    Really, it ain't such a big deal.

    Here's a list of some of the PEAR packages we're using, if they're on your list as well, you know those can be safely used with PHP5 (unless in E_STRICT):

    - DB (with MySQL and MSSQL drivers) - DB_DataObject (if you use the old $obj->__clone() method to copy objects, you'll need to change this to use PHP5's new clone() function, and provide a user-defined one when running PHP4, in case you need that backwards-compatibility. This is *not much work* - trust me :-)) - DB_DataObject_FormBuilder - HTML_Template_Sigma - Payment_DTA - Spreadsheet_Excel_Writer - Cache_Lite - Date - HTML_QuickForm - HTML_TreeMenu - Image_Transform - LiveUser - Mail && Mail_Mime - Services_ExchangeRates - Validate

    *** Make it idiot proof, and someone will build a better idiot. ***

  • phlow
    12
    phlow
    Mag.rer.soc.oec
    Reaktionen
    3
    Punkte
    1.423
    Beiträge
    262
    • 23. März 2005 um 13:14
    • #2

    ich hab die Erfahrung, dass es viel Probleme gibt und hab daher wieder alles auf php4 umgestellt ... würd mich aber auch interessieren, wie andere das gelöst haben

    Florian Bauer

    Managing Director


    Impact Hub Vienna


    M: +43 664 4182106


    E: florian.bauer@impacthub.net 
    W: vienna.impacthub.net


    Lindengasse 56, 1070 Vienna, Austria



    visit us | facebook.com/impacthubvienna
    follow us | instagram.com/impacthubvienna

  • maciek
    16
    maciek
    Mitglied
    Punkte
    2.805
    Beiträge
    434
    • 23. März 2005 um 15:25
    • #3

    habe alles zum Laufen gebracht. Man darf mit dem error_reporting in der php.ini nicht höher als auf E_ALL gehen. Außerdem muss man aufpassen, wenn man set_error_handler verwendet, dass man den zweiten Parameter übergibt und dieser auch nicht höher als E_ALL ist. Das war nämlich bei mir ein Hacken. :winking_face:

    *** Make it idiot proof, and someone will build a better idiot. ***

  • Maximilian Rupp 27. Dezember 2024 um 12:06

    Hat das Thema aus dem Forum Programmieren nach Entwicklung verschoben.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!

Benutzerkonto erstellen Anmelden

Benutzer online in diesem Thema

  • 1 Besucher

Rechtliches

Impressum

Datenschutzerklärung