We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PHPCS 3.1, WPCS 0.13.1, PHP 5.6.30]
I'm using fopen() with a stream, and WPCS is now flagging this as filesystem usage:
fopen()
<?php Header( 'HTTP/1.1 200 OK' ); Header( 'Content-Type: text/csv' ); Header( "Content-Disposition: attachment; filename={$filename}" ); $output_stream = fopen( 'php://output', 'w' ); fputcsv( $output_stream, $output_columns ); foreach ( self::$metadata as $row ) { fputcsv( $output_stream, $row ); } fclose( $output_stream );
I get this error:
File operations should use WP_Filesystem methods instead of direct PHP filesystem calls. Found: fopen()
WP_Filesystem doesn't seem appropriate here.
Do you recommend a different way of writing the above code?
The text was updated successfully, but these errors were encountered:
This is related to #295, though that is for a different sniff.
Sorry, something went wrong.
Very relevant: #1265 (comment)
Closing as fixed by #1655 which was included in WPCS 2.1.0.
No branches or pull requests
[PHPCS 3.1, WPCS 0.13.1, PHP 5.6.30]
I'm using
fopen()
with a stream, and WPCS is now flagging this as filesystem usage:I get this error:
WP_Filesystem doesn't seem appropriate here.
Do you recommend a different way of writing the above code?
The text was updated successfully, but these errors were encountered: