cvs: pear /Structures_DataGrid/DataGrid/DataSource CSV.php

From: Date: Mon, 11 Apr 2005 20:53:01 +0000
Subject: cvs: pear /Structures_DataGrid/DataGrid/DataSource CSV.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-31107@lists.php.net to get a copy of this message
asnagy Mon Apr 11 16:53:01 2005 EDT Modified files: /pear/Structures_DataGrid/DataGrid/DataSource CSV.php Log: http://cvs.php.net/diff.php/pear/Structures_DataGrid/DataGrid/DataSource/CSV.php?r1=1.4&r2=1.5&ty=u Index: pear/Structures_DataGrid/DataGrid/DataSource/CSV.php diff -u pear/Structures_DataGrid/DataGrid/DataSource/CSV.php:1.4 pear/Structures_DataGrid/DataGrid/DataSource/CSV.php:1.5 --- pear/Structures_DataGrid/DataGrid/DataSource/CSV.php:1.4 Thu Mar 31 13:20:34 2005 +++ pear/Structures_DataGrid/DataGrid/DataSource/CSV.php Mon Apr 11 16:53:00 2005 @@ -16,7 +16,7 @@ // | Author: Andrew Nagy <asnagy@webitecture.org> | // +----------------------------------------------------------------------+ // -// $Id: CSV.php,v 1.4 2005/03/31 18:20:34 asnagy Exp $ +// $Id: CSV.php,v 1.5 2005/04/11 20:53:00 asnagy Exp $ require_once 'Structures/DataGrid/DataSource/Array.php'; @@ -26,7 +26,7 @@ * This class is a data source driver for a CSV File. It will also support any * other delimiter. * - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * @author Andrew Nagy <asnagy@webitecture.org> * @access public * @package Structures_DataGrid @@ -38,6 +38,7 @@ function Structures_DataGrid_DataSource_CSV() { parent::Structures_DataGrid_DataSource_Array(); + $this->_addDefaultOptions(array('delimiter' => ',')); } /** @@ -52,7 +53,7 @@ { if ($options) { $this->setOptions($options); - } + } if (is_file($csv)) { if (!$rowList = file($csv)) { @@ -63,7 +64,7 @@ } for($i=0; $i<count($rowList); $i++) { - $this->_ar[] = explode($options['delimiter'], $rowList[$i]); + $this->_ar[] = explode($this->_options['delimiter'], $rowList[$i]); } return true;

« previous php.pear.cvs (#31107) next »