WP_CLI\Iterators
CSV::__construct()
Method of the class: CSV{}
No Hooks.
Return
null
. Nothing (null).
Usage
$CSV = new CSV(); $CSV->__construct( $filename, $delimiter );
- $filename (required)
- -
- $delimiter **
- -
Default: ','
CSV::__construct() CSV:: construct code WP-CLI 2.8.0-alpha
public function __construct( $filename, $delimiter = ',' ) { $this->filename = $filename; $this->file_pointer = fopen( $filename, 'rb' ); if ( ! $this->file_pointer ) { WP_CLI::error( sprintf( 'Could not open file: %s', $filename ) ); } $this->delimiter = $delimiter; }