1

I am developer of imi-conrun and have a problem: We use the psySh package we would like not to drop and defines the global scope function "dump" and have to initialize the Contao core which defines the global scope function "dump" as well without checking if the function is registered and then crashes.

Is there any possibility to only remove the dump function from psySh without making a fork?

Alex
  • 32,506
  • 16
  • 106
  • 171
  • 1
    Why not make a feature request to both packages to remove such generic and badly named methods from the global namespace? – Nico Haase Jan 26 '18 at 11:08

1 Answers1

0

I think there is no real solution for this.

In the end it turn's out I do not need PsySH - so I removed it - problem solved.

  • Might make the suggestion to Contao to not blindly defined the dump function without a function_exists() call
  • On the other hand I could ensure that Contao is loaded first, then PsySH and thus would not define the dump() function again which would mean to run the composer autoload before the Contao init.

TL;DR: global name space functions are bad.

Alex
  • 32,506
  • 16
  • 106
  • 171
  • 1
    The `dump` function has been removed in Contao 4 and all other Contao functions in the global namespace have been deprecated. They will be removed in Contao 5. – fritzmg Jan 30 '18 at 09:05