<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There is no need to use either of those functions ever.</blockquote><div><br></div><div>For example I have a need to read package data from bundled libraries in form of .json files. I am sure there are plenty more of use cases for something so basic as opening/writing a file around.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">if you have to read in a file, use the file() command </blockquote><div><br></div><div>Could you please elaborate how is this function different from other file read functions (PHP manual treats it like synonym to file_get_contents() with different output format) and why it seems to be exempt?</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If you absolutely have to write a file to the filesystem, wordpress<br>
has an API for that already, but temporary data is best stored in the<br>
database.
</blockquote><div><br></div><div>I am well aware of that API and approaches to storage of data. I'd like first clarified points (1) and (2) - if theme is allowed by repository rules to read and write files at all.</div>
<div><br></div><div class="gmail_quote">2013/1/10 Simon Prosser <span dir="ltr"><<a href="mailto:pross@pross.org.uk" target="_blank">pross@pross.org.uk</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There is no need to use either of those functions ever.<br>
<br>
if you have to read in a file, use the file() command:<br>
file( $filename, FILE_SKIP_EMPTY_LINES );<br>
<br>
If you absolutely have to write a file to the filesystem, wordpress<br>
has an API for that already, but temporary data is best stored in the<br>
database.<br>
<div><div class="h5"><br>
On 10 January 2013 18:14, Andrey "Rarst" Savchenko <<a href="mailto:contact@rarst.net">contact@rarst.net</a>> wrote:<br>
> Theme Check plugin lists presence of most of PHP file access functions as<br>
> warning. In code it's under MalwareCheck which suggest issue with how they<br>
> might be used rather than with their presence in general.<br>
><br>
> However I had found mentions on forum alike "Themes submitted to the Theme<br>
> Repository are not allowed to open or write to files - hence the warning in<br>
> the Theme Check plugin."<br>
> <a href="http://wordpress.org/support/topic/plugin-theme-check-theme-check-gives-warning-for-file_put_contents?replies=4" target="_blank">http://wordpress.org/support/topic/plugin-theme-check-theme-check-gives-warning-for-file_put_contents?replies=4</a><br>
> and no mention at all in Codex.<br>
><br>
> What are the repository rules on:<br>
><br>
> 1. Reading files in theme.<br>
> 2. Writing files in theme.<br>
> 3. [Not] using filesystem APIs to do either (if applicable).<br>
><br>
> TIA<br>
> --<br>
> <a href="http://www.Rarst.net/" target="_blank">http://www.Rarst.net/</a><br>
><br>
</div></div>> _______________________________________________<br>
> theme-reviewers mailing list<br>
> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
My Blog: <a href="http://pross.org.uk/" target="_blank">http://pross.org.uk/</a><br>
Plugins : <a href="http://pross.org.uk/plugins/" target="_blank">http://pross.org.uk/plugins/</a><br>
Themes: <a href="http://wordpress.org/extend/themes/profile/pross" target="_blank">http://wordpress.org/extend/themes/profile/pross</a><br>
_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.Rarst.net/" target="_blank">http://www.Rarst.net/</a><br>