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.
Would ini_set do the job ?
There’s also ini_get for querying the configuration.