public function openFile($mode = 'r')
    {
        if (!$this->handle) {
            $this->handle = fopen($this->file, $mode);
            if ($this->handle === false) {
                throw new Exception(['Can not open CSV file.', 'file' => $this->file, 'mode' => $mode]);
            }
        }
    }
public function openFile($mode = 'r')
    {
        if (!$this->handle) {
            $this->handle = fopen($this->file, $mode);
            if ($this->handle === false) {
                throw new Exception(['Can not open CSV file.', 'file' => $this->file, 'mode' => $mode]);
            }
        }
    }
public function openFile ( $ mode = 'r' ) { if ( ! $ this -> handle ) { $ this -> handle = fopen ( $ this -> file , $ mode ) ; if ( $ this -> handle === false ) { throw new Exception ( [ 'Can not open CSV file.' , 'file' => $ this -> file , 'mode' => $ mode ] ) ; } } }
Open CSV file.

Override this method and open handle yourself if you want to
reposition or load some extra columns on the top.

@param string $mode 'r' or 'w'
Open CSV file .