Review main Merged

19952[TASK] Cleanup __DIR__ and require/require_once

Stefan Neufeind CR +2 V +2 Easy +10 −10 updated 01/15/14, 12:56

Commit message

* Use __DIR__ instead of dirname(__FILE__) (since PHP 5.3.0)
* Use require_once for loading classes ("just once")

Review

  • Code review CR +2
    • Markus Klein +2
    • Alexander Opitz +1
    • Pascal Dürsteler +1
    • Xavier Perseguers +1
    • Stefan Froemken +1
    • Oliver Klee +1
  • Verified V +2
    • Markus Klein +2
    • Alexander Opitz +1
    • Stefan Froemken +1

Issues 1

Files 5

Review log 31

Show 6 earlier messages
  1. Dmitry Dulepov commented on patch set 1 05/27/13, 17:19

  2. Stefan Neufeind commented on patch set 1 05/27/13, 17:19

    others that I talked to argued different because it's a special language-construct and not a function. Imho the docs at that part you mention also don't mean to highlight how require_once is to be written. This and several other parts make me wonder if we have any common understanding of "CGL" or "how it should be" among the community :-(
  3. Mr. Jenkins commented on patch set 1 05/27/13, 17:19

  4. Stefan Neufeind uploaded patch set 2 08/19/13, 21:45

  5. Mr. Jenkins commented on patch set 2 08/19/13, 21:46

  6. Pascal Dürsteler commented on patch set 2 11/12/13, 14:52

    I always teach that control structures http://php.net/manual/en/language.control-structures.php should not be called like functions, as it is intended by php (as even the docs and example do it this way) and I am just wondering why TYPO3 has contradicting guidelines. Anyone knows about this in particular?
  1. Pascal Dürsteler commented on patch set 2 11/12/13, 14:53

    Correction: language constructs, not control structures. If, Case et al obviously have parentheses...
  2. Markus Klein voted on patch set 2 V +1 CR +1 11/12/13, 15:38

  3. Philipp Gampe commented on patch set 2 CR -1 11/13/13, 18:47

    bootstrap files should use require, not require once PHP evaluates "include('file.php')" to "include 'file.php".

    index.php:36

    I think the requite is intentional here. This file cannot be included twice. Keeping track of the includes here makes no sense and just wastes time. Same for the other bootstrap files.
  4. Stefan Neufeind commented on patch set 2 11/13/13, 19:07

    index.php:36 Reply

    Yes and no. My thought was that it might make sense to use _once on classes consistently whereas including sourcecode to be directly executed would have no _once. And since Bootstrap is actually "just a class" that is executed below then, that's why I added _once also here.
  5. Philipp Gampe voted on patch set 2 CR 0 11/13/13, 19:39

  6. Christian Kuhn commented on patch set 2 CR -1 11/13/13, 21:02

    index.php:36 Reply

    Require is here by intention: This is not about Bootstrap being "just a class", but more about index.php being an entry script that must be called only and exactly once. With require, the entry script can not be called twice. Any good reason to change that?
  7. Stefan Neufeind uploaded patch set 3 11/14/13, 17:09

  8. Stefan Neufeind commented on patch set 3 11/14/13, 17:11

    skipped require_once for bootstrapping; rebased since meanwhile some codeparts use __DIR__ already
  9. Mr. Jenkins commented on patch set 3 11/14/13, 17:28

  10. Alexander Opitz voted on patch set 3 CR +1 11/18/13, 09:55

  11. Stefan Neufeind commented on patch set 3 11/24/13, 20:04

    Please review/test. The patch is not that big anymore. @Christian: You raised some concerns in the past. Fine now?
  12. Stefan Neufeind commented on patch set 3 12/18/13, 11:54

    Looking forward to your reviews. Not such a big changeset anymore after all (since we removed quite some bits along the road).
  13. Pascal Dürsteler voted on patch set 3 CR +1 12/18/13, 12:01

  14. Georg Ringer updated the commit message in patch set 3 12/18/13, 12:23

  15. Markus Klein voted on patch set 4 CR +1 12/18/13, 12:25

  16. Mr. Jenkins commented on patch set 4 12/18/13, 12:36

  17. Xavier Perseguers voted on patch set 4 CR +1 12/18/13, 12:39

  18. Markus Klein commented on patch set 4 V +1 12/18/13, 13:11

    Functional tests are working fine as well.
  19. Oliver Klee voted on patch set 4 CR +1 12/18/13, 14:11

  20. Stefan Neufeind commented on patch set 4 01/14/14, 08:10

    ping?
  21. Alexander Opitz voted on patch set 4 V +1 CR +1 01/14/14, 08:11

  22. Pascal Dürsteler voted on patch set 4 CR +1 01/14/14, 08:12

  23. Stefan Froemken voted on patch set 4 V +1 CR +1 01/15/14, 12:48

  24. Markus Klein voted on patch set 4 V +2 CR +2 01/15/14, 12:56

  25. Markus Klein merged patch set 5 01/15/14, 12:56