Ok, I try again to submit the patch and a test script for it :-)
Prototype:
int file_put_contents(string filename, mixed data [, string mode])
It takes a filename (URL wrappers supported), the data to be written and
a mode for the file. The data can be either a string or an array (which
is
Derick Rethans wrote:
Please write a new test for this without piggy backing on the old one.
We're trying to get one function tested per tests so that differenc
functions in the same test can not be the cause of 'screw-ups'.
Ok, I attached a file
Hi Folks,
after seeing the new function file_get_contents() I figured a
corresponding file_put() function should be added too.
Prototype:
int file_put(string filename, mixed data [, string mode])
It takes a filename (URL wrappers supported), the data to be written and
a mode for the file. The
Mike Robinson wrote:
On a side note: I think the file_get_contents() function should be
renamed to file_get() as it is useful enough to deserve a
shorter name.
Conversely, your new function should be named file_put_contents()
for consistency. :)
That's what I called the function initially
Wez Furlong wrote:
It's just that there was a thread about this recently on php-dev,
and it's something to get right for new functions - we can fix the
old ones as we go :-)
The README, the Zend API doc on zend.com and the implementation in
zend_API.c all assume an int * for string length in