Review main Abandoned

73110[TASK] Convert Environment class to an injectable object.

crell CR 0 V 0 Normal +113 −115 updated 08/01/22, 18:07

Commit message

This is step one in unwinding the Environment class.  It moves to
an object stored in a static variable, and everything is built
off of that.  I included one example of how the new-style will
be used.  Converting the zillion other uses will be follow-up
issues.  The static methods should also get marked deprecated
to point people toward the object properties.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 11

Review log 79

  1. crell uploaded patch set 1 01/20/22, 23:33

  2. core-ci voted on patch set 1 V -1 01/20/22, 23:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22326

  3. Benjamin Franzke wrote 01/21/22, 05:24

    Topic set to di
  4. Helmut Hummel commented on patch set 1 CR -1 01/21/22, 09:46

    Hey. I still think these details matter: https://forge.typo3.org/issues/94995#note-3
  5. Helmut Hummel commented on patch set 1 01/21/22, 12:16

    StandardPreviewRendererResolverTest.php:36

    We worked hard to get rid of such static instance getters and we should not take the shortcut and re-introduce them in other places again
  6. crell commented on patch set 1 01/21/22, 16:28

    StandardPreviewRendererResolverTest.php:36 Reply Unresolved

    I hate it too, but for tests that were recreating the environment anyway off of itself, I'm not sure what a better alternative is. I am open to suggestions. Many other tests are doing something like this: ``` Environment::initialize( new ApplicationContext('Production/Staging/Server2'), true, false, Environment::getProjectPath(), Environment::getPublicPath(), Environment::getVarPath(), Environment::getConfigPath(), Environment::getBackendPath() . '/index.php', Environment::isWindows() ? 'WINDOWS' : 'UNIX' ); ``` That needs to go away, too. I'm just not sure what to replace it with. (I suppose just calling the constructor normally is an option, but I'm not sure what the current net result is of calling all of those static methods, as I'm not clear on what their current values would be.)
  7. crell uploaded patch set 2 01/21/22, 16:57

  8. core-ci voted on patch set 2 V -1 01/21/22, 17:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22362

  9. crell abandoned the change 08/01/22, 18:07

    Lack of interest.