Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HttpFoundation] Make dependency on Mime component optional #13074

Closed
fabpot opened this issue Feb 8, 2020 · 7 comments
Closed

[HttpFoundation] Make dependency on Mime component optional #13074

fabpot opened this issue Feb 8, 2020 · 7 comments
Milestone

Comments

@fabpot
Copy link
Member

fabpot commented Feb 8, 2020

Q A
Feature PR symfony/symfony#35642
PR author(s) @atailouloute
Merged in 5.1-dev
@OskarStark OskarStark added this to the 5.1 milestone Feb 8, 2020
@javiereguiluz
Copy link
Member

No need to document this because Symfony error messages are very helpful and explain how to solve the issue.

@GrahamCampbell
Copy link

It seems to not always provide good errors, actually?

@GrahamCampbell
Copy link

GrahamCampbell commented Feb 20, 2020

I just ran laravel/framework's test suite with the latest Symfony 5.1 http-foundation component:

1) Illuminate\Tests\Filesystem\FilesystemAdapterTest::testPutFile

LogicException: You cannot guess the extension as the Mime component is not installed. Try running "composer require symfony/mime".

/home/travis/build/laravel/framework/vendor/symfony/http-foundation/File/File.php:58

/home/travis/build/laravel/framework/src/Illuminate/Http/FileHelpers.php:50

/home/travis/build/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php:244

/home/travis/build/laravel/framework/tests/Filesystem/FilesystemAdapterTest.php:283

2) Illuminate\Tests\Filesystem\FilesystemAdapterTest::testPutFileWithAbsoluteFilePath

LogicException: You cannot guess the extension as the Mime component is not installed. Try running "composer require symfony/mime".

/home/travis/build/laravel/framework/vendor/symfony/http-foundation/File/File.php:58

/home/travis/build/laravel/framework/src/Illuminate/Http/FileHelpers.php:50

/home/travis/build/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php:244

/home/travis/build/laravel/framework/tests/Filesystem/FilesystemAdapterTest.php:298

3) Illuminate\Tests\Validation\ValidationValidatorTest::testNestedAttributesAreReplacedInDimensions

Error: Class 'Symfony\Component\Mime\MimeTypes' not found

/home/travis/build/laravel/framework/vendor/symfony/http-foundation/File/File.php:77

/home/travis/build/laravel/framework/src/Illuminate/Validation/Concerns/ValidatesAttributes.php:499

/home/travis/build/laravel/framework/src/Illuminate/Validation/Validator.php:476

/home/travis/build/laravel/framework/src/Illuminate/Validation/Validator.php:300

/home/travis/build/laravel/framework/src/Illuminate/Validation/Validator.php:804

/home/travis/build/laravel/framework/tests/Validation/ValidationValidatorTest.php:274

4) Illuminate\Tests\Validation\ValidationValidatorTest::testValidateImageDimensions

Error: Class 'Symfony\Component\Mime\MimeTypes' not found

/home/travis/build/laravel/framework/vendor/symfony/http-foundation/File/File.php:77

/home/travis/build/laravel/framework/src/Illuminate/Validation/Concerns/ValidatesAttributes.php:499

/home/travis/build/laravel/framework/src/Illuminate/Validation/Validator.php:476

/home/travis/build/laravel/framework/src/Illuminate/Validation/Validator.php:300

/home/travis/build/laravel/framework/tests/Validation/ValidationValidatorTest.php:2708

5) Illuminate\Tests\Validation\ValidationValidatorTest::testValidatePhpMimetypes

Error: Class 'Symfony\Component\Mime\MimeTypes' not found

/home/travis/build/laravel/framework/vendor/symfony/http-foundation/File/File.php:77

/home/travis/build/laravel/framework/src/Illuminate/Validation/Concerns/ValidatesAttributes.php:1211

/home/travis/build/laravel/framework/src/Illuminate/Validation/Validator.php:476

/home/travis/build/laravel/framework/src/Illuminate/Validation/Validator.php:300

/home/travis/build/laravel/framework/tests/Validation/ValidationValidatorTest.php:2812

@GrahamCampbell
Copy link

The first two cases were handled properly, but not tests 3 to 5.

@atailouloute
Copy link
Contributor

It seems to not always provide good errors, actually?

@GrahamCampbell

What do you mean by good errors? the exception thrown gives enough info IMO, it give also what it should be done

You cannot guess the extension as the Mime component is not installed. Try running "composer require symfony/mime"

@HeahDude
Copy link
Contributor

@GrahamCampbell
Copy link

GrahamCampbell commented Feb 20, 2020

What do you mean by good errors? the exception thrown gives enough info IMO, it give also what it should be done

Not on cases 3-5, like I said, and I included:

Error: Class 'Symfony\Component\Mime\MimeTypes' not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants