deprecated-packages / symplify

[DISCONTINUED] Check split packages in their own repositories :)
MIT License
621 stars 189 forks source link

[EasyCodingStandard] Symfony dump instead of Nette dump #362

Closed jindrapetrik closed 7 years ago

jindrapetrik commented 7 years ago

Easy coding standard package depends on some Nette components, but installing this will override Symfony dump function with Nette tracy dump. I'd like to use Symfony standard dump, which has better integration I think. Is there any way to switch it back? Can I disable tracy dump somehow?

Thanks in advance.

TomasVotruba commented 7 years ago

Hey @jindrapetrik, I'm not sure how to solve this. Could you share links on Github to Symfony and Nette files with dump() functions?

@enumag I think you might came accross similar issue while switching from Nette to Symfony. Got any idea?

jindrapetrik commented 7 years ago

Symfony: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/VarDumper/Resources/functions/dump.php

Tracy: https://github.com/nette/tracy/blob/master/src/shortcuts.php

Both contain "if function_exists", so the first registered wins. Is there a way I can prioritize which packages are loaded first(?).

enumag commented 7 years ago

I don't remember having such issue. Some trick in composer.json autoload-dev to force one to be loaded first should help though.

By the way why ECS requires Tracy?

TomasVotruba commented 7 years ago

@enumag Thanks for sharing.

By the way why ECS requires Tracy?

I think it is required by one nette/* dependency that fails without it.

TomasVotruba commented 7 years ago

@jindrapetrik Have tried that autoload Jáchym mentioned trick? How did that work?

jindrapetrik commented 7 years ago

I tried to add

"autoload-dev": {
        "files": ["vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"],
}

into my composer.json, but composer puts this file at the bottom of vendor/composer/autoload_files.php list, "/tracy/tracy/src/shortcuts.php" is first. It looks like it processes dependencies first.

I am thinking about my own dump function like "ddump" or something which will call the Symfony dumper.

TomasVotruba commented 7 years ago

Mm.

One last idea is to ask on Pehapkari Slack in #symfony room: https://pehapkari.slack.com/#symfony

You're probably not the only one who came across this

TomasVotruba commented 7 years ago

As this is not related to Symplify, I'm closing this issue now.

Please let me know how did you manage to solve this. It could be reference points to others in the future... and also I'm curious :)