Skip to content

Check ini_set - #2225

Closed
gregory-gueret wants to merge 1 commit into
slimphp:3.xfrom
gregory-gueret:ini_set
Closed

Check ini_set#2225
gregory-gueret wants to merge 1 commit into
slimphp:3.xfrom
gregory-gueret:ini_set

Conversation

@gregory-gueret

Copy link
Copy Markdown

If default_mimetype is already set to empty, ini_set is not executed.
Ini_set is not allowed on my shared server for security reasons.

If default_mimetype is already set to empty, ini_set is not executed.
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.003%) to 97.315% when pulling 47f038a on gregory-gueret:ini_set into d282722 on slimphp:3.x.

@geggleto
geggleto requested review from akrabat and geggleto May 12, 2017 14:26
@geggleto

Copy link
Copy Markdown
Member

This code change doesn't do anything....
The if reads as...

if not empty default_mime-type set to empty.

In your hosting environment you will have a default mime-type set.

http://php.net/manual/en/ini.core.php#ini.default-mimetype

@gregory-gueret

Copy link
Copy Markdown
Author

thank you for your reply,
But my need is do not run ini_set, but I can set a default default_mimetype in php.ini

@akrabat

akrabat commented May 12, 2017

Copy link
Copy Markdown
Member

What's your use-case?

@akrabat

akrabat commented May 13, 2017

Copy link
Copy Markdown
Member

Right, so the problem is that ini_set is disabled on your shared_host. Hmm.

@gregory-gueret

Copy link
Copy Markdown
Author

Yes ini_set is disabled for internal security reasons and this simple modification will make it possible for me to use Slim

@geggleto

Copy link
Copy Markdown
Member

I'm pretty torn on this.... while this feature might enable slim for you, it does impose a penalty on the rest of the community as if blocks do have a material cost.

@noogen

noogen commented May 22, 2017

Copy link
Copy Markdown

How about a compromise by using the @ symbol? @ini_set('default_mimetype', '');

@akrabat

akrabat commented May 22, 2017

Copy link
Copy Markdown
Member

The@ symbol is extremely slow.

@noogen

noogen commented May 22, 2017

Copy link
Copy Markdown

I did not know that. Saw it uses in other places for handle the same situation. Did some reading on it. Now I know. Thanks @akrabat

@geggleto

Copy link
Copy Markdown
Member

@noogen a good rule of thumb is to never use @ ;)

@akrabat

akrabat commented Aug 13, 2017

Copy link
Copy Markdown
Member

I don't think we should change this in Slim 3.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants