From 006c2c20b9b8358849ea3f87249262b5fd0b3ee8 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 30 Nov 2012 15:10:59 +0000 Subject: [PATCH] No longer needed --- admin/includes/class-wc-csv-exporter.php | 131 ----------------------- 1 file changed, 131 deletions(-) delete mode 100644 admin/includes/class-wc-csv-exporter.php diff --git a/admin/includes/class-wc-csv-exporter.php b/admin/includes/class-wc-csv-exporter.php deleted file mode 100644 index 8a974c0b1a1..00000000000 --- a/admin/includes/class-wc-csv-exporter.php +++ /dev/null @@ -1,131 +0,0 @@ -_csv = ''; - $this->_filename = $filename ? $filename : 'export.csv'; - - if ( $this->_output = $output ) - $this->start(); - - if ( $columns ) - $this->set_columns( $columns ); - } - - function set_filename( $filename ) { - $this->_filename = $filename ? $filename : 'export.csv'; - } - - /** - * set_columns function. - * - * @access public - * @return void - */ - function set_columns( $columns = array() ) { - $this->add_row( $columns ); - unset( $columns ); - } - - /** - * add_row function. - * - * @access public - * @return void - */ - function add_row( $row ) { - - $row = implode( ',', array_map( array( &$this, 'wrap_column' ), $row ) ) . "\n"; - - if ( $this->_output ) - fwrite( $this->_csv, $row ); - else - $this->_csv += $row; - - unset( $row ); - } - - /** - * start function. - * - * @access public - * @return void - */ - function start() { - if ( headers_sent() ) - wp_die( 'Headers already sent' ); - - @set_time_limit(0); - @ob_clean(); - - header( "Content-Type: text/csv; charset=UTF-8" ); - header( "Content-Disposition: attachment; filename={$this->_filename}" ); - header( "Pragma: no-cache" ); - header( "Expires: 0" ); - - $this->_csv = fopen( 'php://output', 'w') ; - } - - /** - * end function. - * - * @access public - * @return void - */ - function end() { - fclose( $this->_csv ); - exit; - } - - /** - * wrap_column function. - * - * @access public - * @param mixed $data - * @return void - */ - function wrap_column( $data ) { - return '"' . str_replace( '"', '""', $data ) . '"'; - } - -} \ No newline at end of file