Re: Is there a mapping between "access level" from output ini_get_all() and constants HP_INI_USER, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_ALL in
official docs?

From: Date: Wed, 08 Oct 2014 15:16:44 +0000
Subject: Re: Is there a mapping between "access level" from output ini_get_all() and constants HP_INI_USER, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_ALL in
official docs?
References: 1 2 3  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969385216@lists.php.net to get a copy of this message
On 8 October 2014 16:14, Rowan Collins <rowan.collins@gmail.com> wrote: > Chris Wright wrote (on 08/10/2014): > > Hi Костя > > On 8 October 2014 14:57, Костя Третяк <ktretyak.in.ua@gmail.com> > <ktretyak.in.ua@gmail.com> wrote: > > Hi all. > On page http://php.net/manual/en/function.ini-get-all.php > mentioned about > "access level", and is given a link to the > pagehttp://php.net/manual/en/configuration.changes.modes.php (for > more > information). But on this page now "access level" called as "modes", and is > not mentioned on the mapping between the numeric value of "access level" > from output ini_get_all() and constants (PHP_INI_USER, PHP_INI_ALL, > PHP_INI_PERDIR, PHP_INI_SYSTEM). > > I tried to find this mapping but not found it (searched keyword 'constant > "PHP_INI_PERDIR" have value 2 site:php.net') in the official documentation, > only in the comments of users on the page function ini_get_all(). This > mapping is also on an outside website > (http://docstore.mik.ua/orelly/webprog/pcook/ch08_23.htm#phpckbk-CHP-8-TABLE-3). > But why it's not in the official documentation? > Apologies if I badly looking for information. > > I'm not entirely clear on what you are looking for here that is not > explained in the manual. It seems pretty clear from the link to the > "modes" that this is what access levels refer to. > > If you are looking for documentation of the *values* of these > constants, there is a good reason this is not present (as with most > constants), which is that the values should not be relied upon as they > may change in the future - when comparing against these, it is > expected that the user would use the constants and treat the returned > value as the bitmasks that they are in order to determine where a > value my be changed. > > If any information is missing from the manual, it is probably an > explanation of why the values should not be used directly, roughly as > above. > > > This *should* be the right answer ... but oddly these "constants" don't > actually exist as constants at runtime, as far as I can see. > > See http://3v4l.org/39FJI > > $ini = ini_get_all("pcre"); if ( > $ini['pcre.backtrack_limit']['access'] == > PHP_INI_ALL ) { ... } > > Gives a notice of "Use of undefined constant PHP_INI_ALL - assumed > 'PHP_INI_ALL'", and therefore fails the test. > Those PHP_INI_* "modes" are made available to PHP scripts via INI_* constants: INI_USER, INI_PERDIR, INI_SYSTEM, INI_ALL. They have been available "forever"... see http://3v4l.org/a1JeF > > Regards, > -- > Rowan Collins > [IMSoP] >

« previous php.doc (#969385216) next »