GithubHelp home page GithubHelp logo

Deprecates + Notices fixen about redaxo4 HOT 16 CLOSED

 avatar commented on June 12, 2024
Deprecates + Notices fixen

from redaxo4.

Comments (16)

gharlan avatar gharlan commented on June 12, 2024

Ich sag es mal so: Wenn alles eindeutig kompatibel bleibt, und dafür keine zu großen Verrenkungen notwendig sind, dann können wir das schon noch aufnehmen.
Also vielleicht besser vorher mal andeuten, was das jeweils für Änderungen wären, bevor du alles machst.

from redaxo4.

 avatar commented on June 12, 2024

Ja hat ich eh vor :D

from redaxo4.

 avatar commented on June 12, 2024

Mein Ansatz wäre der hier (Beispiel rex_sql Konstruktor)

    // this is the new style constructor used by newer php versions.
    // important: if you change the signatur of this method, change also the signature of rex_sql()
    function __construct($DBID = 1) { 
        $this->rex_sql($DBID);
    }

    // this is the deprecated old style constructor kept for compat reasons. 
    // important: if you change the signatur of this method, change also the signature of __construct()
    /*private*/ function rex_sql($DBID = 1)
    {
        global $REX;

        $this->debugsql = false;
        $this->selectDB($DBID);

        $this->flush();
    }

from redaxo4.

gharlan avatar gharlan commented on June 12, 2024

Ich denke, das passt.
Am besten den /*private*/-Kommentar beim neuen Konstruktor auch davor setzen, aber auch nur als Kommentar.

from redaxo4.

 avatar commented on June 12, 2024

Ja stimmt der fehlt der vollständigkeitd halber.
Mit der Lösung sollt alles kompatibel leiben und gleichzeitig sollten die meisten Meldungen verschwinden. Extra Notices würd ich aber euch überlassen und diese dann nur melden.

from redaxo4.

gharlan avatar gharlan commented on June 12, 2024

Ok, alles klar. Ich warte dann noch den PR ab, und werde dann die 4.7.2 fertig machen (wegen des Datenbank-Namen-Problems).

Kannst gerne Notices melden, von uns wird aber keiner welche entfernen.

from redaxo4.

 avatar commented on June 12, 2024

Ich kann sie auch fixen aber schaut dann bitte gut drüber weil ich steck im code ja nicht so drin wie ihr :)
PR kommt die Tage...

from redaxo4.

 avatar commented on June 12, 2024

Ok 3 PR's für Konstruktor Fixes gesendet.

Mir ist jetzt noch was aufgefallen:

Habe ich dass hier in der master.inc.php:
error_reporting(error_reporting() & ~E_STRICT & ~E_DEPRECATED);

...bekomme ich trotzdem bei einer frischen Install ein: Notice: Only variables should be passed by reference in /home/dude/Projekte/Web/Redaxo4/htdocs/redaxo/include/classes/class.rex_form.inc.php on line 435 ..und zwar wenn ich einfach das art_online_from Meta Info öffne zum editieren.

Habe ich dass hier in der master.inc.php:
error_reporting(0);

...kommt an genannter Stelle die notice nicht mehr.
Komisch irgendwie oder?

PHP 7.0.8 unter Linux Mint.

from redaxo4.

gharlan avatar gharlan commented on June 12, 2024

Es werden ja nur E_STRICT und E_DEPRECATED deaktiviert, aber keine E_NOTICE.
Muss ich mal schauen, ob ich die Notice auch bekomme.

from redaxo4.

 avatar commented on June 12, 2024

So wärs richtiger denk ich:
error_reporting(error_reporting() & ~E_NOTICE & ~E_DEPRECATED);

oder so:
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED | E_STRICT);

from redaxo4.

 avatar commented on June 12, 2024

php.ini beispiele:

; Common Values:
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.)
;   E_ALL & ~E_NOTICE | E_STRICT  (Show all errors, except for notices)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)

from redaxo4.

gharlan avatar gharlan commented on June 12, 2024

Wichtig ist, mit error_reporting() zu arbeiten, nicht E_ALL. Falls jemand schon in der php.ini mehr deaktiviert hat, sollte R4 die nicht wieder aktivieren.

Wenn dann also eher:
error_reporting(error_reporting() & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);

Falls wir denn die Notices wirklich deaktivieren müssen. Muss ich mal schauen.

from redaxo4.

 avatar commented on June 12, 2024

achso. ich dachte dass auch die notices hier weg sollen. ja dann erfüllts so natürlich seinen zweck. aber man könnte ja drüber nachdenken die evtl. auch auszublenden....oder halt fixen ;)

from redaxo4.

 avatar commented on June 12, 2024

auf nem live server sollten sie ja eh aus sein...dann ists vielleicht egal.

from redaxo4.

gharlan avatar gharlan commented on June 12, 2024

Nochmal drüber nachgedacht. Seit PHP 7 gibt es ja eigentlich E_STRICT nicht mehr, und manche der Meldungen sind nun zu E_NOTICEs geworden, andere zu E_DEPRECATED.
Daher füge ich E_NOTICE noch hinzu, also dass die auch immer unterdrückt werden.

from redaxo4.

 avatar commented on June 12, 2024

ok klingt gut.

from redaxo4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.