slimphp / Slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
http://slimframework.com
MIT License
11.94k stars 1.95k forks source link

Undocumented "slim.files" option #1890

Closed llvdl closed 7 years ago

llvdl commented 8 years ago

In the function Slim\Http\UploadedFile::createFromEnvironment I found the following lines:

        if (is_array($env['slim.files']) && $env->has('slim.files')) {
            return $env['slim.files'];
        } // else ...

The "slim.files" option doesn't seem to be documented and isn't covered by any tests. Is there a reason for keeping it in? And if so, what is to the use case?

Raistlfiren commented 8 years ago

slim.files is used for testing purposes. You can view the comment here - https://github.com/slimphp/Slim/issues/1099#issuecomment-83735868

llvdl commented 8 years ago

Is this for testing an application that uses Slim?

slim.files is not used by Slims internal tests. If I remove the slim.files part, the tests still succeed.

akrabat commented 7 years ago

Now used in the unit test testCreateFromEnvironmentFromUserData.