WP_CLI\Iterators

CSV::__construct()publicWP-CLI 1.0

Method of the class: CSV{}

No Hooks.

Return

null. Nothing.

Usage

$CSV = new CSV();
$CSV->__construct( $filename, $delimiter );
$filename (required)
-
$delimiter **
-
Default: ','

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;
}