Is it possible to set php.ini values from within PHP? Optimally with a limited scope?
Background: I want to force-allow short_open_tag for the duration of an include command to facilitate content writers’ jobs. The actual PHP web application uses long tags throughout (well, one at the beginning and one at the end, really) but for the content files I’d like to enable the more convenient shortcuts.
The content files are then rendered by a combination of output buffering and require, and the result of this is used to fill out a view-specific template. (I know about template engines such as Smarty but I don’t want to use them here.)
The php.ini documentation unfortunately doesn’t tell how to query/set the configuration values.
short_open_tagspecifically can not be changed at runtime anymore.perl -e "s/<\?\s/<\?php /g;" -pi.save $(find DirectoryName -type f))<?when it occurs in a string?), I want to use short tags here, to help the content writers. Short tags are in general a good thing (apart from the fact that PHP, as usual, botched it up by using something that is ambiguous when used together with XML).