Re: svn: /phpdoc/en/trunk/reference/filesystem/functions/ file-get-contents.xml

From: Date: Tue, 27 Apr 2010 15:59:29 +0000
Subject: Re: svn: /phpdoc/en/trunk/reference/filesystem/functions/ file-get-contents.xml
References: 1 2 3 4 5 6  Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-6496@lists.php.net to get a copy of this message
On 27 April 2010 16:52, Richard Quadling <rquadling@googlemail.com> wrote: > On 27 April 2010 16:05, Hannes Magnusson <hannes.magnusson@gmail.com> wrote: >>>>> When was that argument renamed again? >>>>> Its called flags in 5.3 atleast.. >>>>> >>>> >>>> >>>> http://svn.php.net/viewvc/php/php-src/trunk/ext/standard/file.c?view=annotate#l520 >>>> >>>> http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/ext/standard/file.c?view=annotate#l521 >> >> What the proto or zpp() uses is irrelevant. >> >> bjori@jessica:~$ php --rf file_get_contents >> Function [ <internal:standard> function file_get_contents ] { >> >>  - Parameters [5] { >>    Parameter #0 [ <required> $filename ] >>    Parameter #1 [ <optional> $flags ] >>    Parameter #2 [ <optional> $context ] >>    Parameter #3 [ <optional> $offset ] >>    Parameter #4 [ <optional> $maxlen ] >>  } >> } > >>>> Both show the param as bool use_include_path and retrieve it as a 'b' >>> >>> This is why I changed the type in this commit. With these changes, the >>> description to use FILE_USE_INCLUDE_PATH conflicts somewhat if we are >>> asking people to use a boolean.  Any suggestions for the description; >>> the constant will still work since its value is 1 but should we ignore >>> that fact? What about people who might already be using >>> FILE_USE_INCLUDE_PATH? >> >> I think we should pretend that the parameter is int, called flags, and >> mention that FILE_USE_INCLUDE_PATH is defined as 1 so passing boolean >> is fine. > > > > The zpp code requires a boolean. > > > The only use of use_include_path in PHP_FUNCTION(file_get_contents) is in ... > >        stream = php_stream_open_wrapper_ex(filename, "rb", >                                (use_include_path ? USE_PATH : 0) | > ENFORCE_SAFE_MODE | REPORT_ERRORS, >                                NULL, context); > > which acts as a boolean. > > > So, maybe ... > > ZEND_BEGIN_ARG_INFO_EX(arginfo_file_get_contents, 0, 0, 1) >        ZEND_ARG_INFO(0, filename) >        ZEND_ARG_INFO(0, flags) >        ZEND_ARG_INFO(0, context) >        ZEND_ARG_INFO(0, offset) >        ZEND_ARG_INFO(0, maxlen) > ZEND_END_ARG_INFO() > > > should be ... > > ZEND_BEGIN_ARG_INFO_EX(arginfo_file_get_contents, 0, 0, 1) >        ZEND_ARG_INFO(0, filename) >        ZEND_ARG_INFO(0, use_include_path) >        ZEND_ARG_INFO(0, context) >        ZEND_ARG_INFO(0, offset) >        ZEND_ARG_INFO(0, maxlen) > ZEND_END_ARG_INFO() > > > > > -- > ----- > Richard Quadling > "Standing on the shoulders of some very clever giants!" > EE : http://www.experts-exchange.com/M_248814.html > EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp > Zend Certified Engineer : > http://zend.com/zce.php?c=ZEND002498&r=213474731 > ZOPA : http://uk.zopa.com/member/RQuadling > Patch attached for 5.3 and trunk -- ----- Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling

Index: branches/PHP_5_3/ext/standard/basic_functions.c =================================================================== --- branches/PHP_5_3/ext/standard/basic_functions.c (revision 296669) +++ branches/PHP_5_3/ext/standard/basic_functions.c (working copy) @@ -1068,7 +1068,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_file_get_contents, 0, 0, 1) ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, flags) + ZEND_ARG_INFO(0, use_include_path) ZEND_ARG_INFO(0, context) ZEND_ARG_INFO(0, offset) ZEND_ARG_INFO(0, maxlen) Index: trunk/ext/standard/basic_functions.c =================================================================== --- trunk/ext/standard/basic_functions.c (revision 297904) +++ trunk/ext/standard/basic_functions.c (working copy) @@ -1068,7 +1068,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_file_get_contents, 0, 0, 1) ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, flags) + ZEND_ARG_INFO(0, use_include_path) ZEND_ARG_INFO(0, context) ZEND_ARG_INFO(0, offset) ZEND_ARG_INFO(0, maxlen)
« previous php.doc.cvs (#6496) next »