Releases: thephpleague/csv
version 5.0.0
- Updated to reflect new GitHub username (changed from
nyamsprod
tothephpleague
). - Updated to reflect new namespace (changed from
Bakame
toLeague
).
version 4.2.1
Bug Fix
Remove $open_mode
validation. Now the validation is done by PHP Internals
New Traits
\Bakame\Csv\Iterator\IteratorFilter
to enable Iterator filtering
\Bakame\Csv\Iterator\IteratorSortBy
to enable Iterator sorting
\Bakame\Csv\Iterator\IteratorInterval
to enable setting Iterator intervals
Update Trait
\Bakame\Csv\Iterator\IteratorQuery
uses all the new Traits to enable CSV filtering
version 4.2.0
New Trait
\Bakame\Csv\ConverterTrait
to better deal with Csv conversion
New Method
\Bakame\Csv\AbstractCsv::toXML
which convert the Csv into aDomDocument
object
Method improved
\Bakame\Csv\AbstractCsv::toHTML
\Bakame\Csv\AbstractCsv::jsonSerialize
\Bakame\Csv\AbstractCsv::output
now can take a optional$filename
argument. When present the function will output all needed HTTP headers.\Bakame\Csv\AbstractCsv::getIterator
method improved\Bakame\Csv\Reader::fetchCol
method now default to$columnIndex
= 0\Bakame\Csv\Reader::fetchOne
method now default to$offset
= 0
version 4.1.2
- Adding PHP 5.6 test in travis.yml
- Dropping PSR-0 in favor of PSR-4
version 4.1.1
\Bakame\Csv\Reader
methods improved\Bakame\Csv\AbstractCsv::jsonSerialize
method improved
Documentation and Examples improved
version 4.1.0
New Methods:
\Bakame\Csv\AbstractCsv::setEncoding
set the CSV encoding type\Bakame\Csv\AbstractCsv::getEncoding
get the CSV encoding type
Update:
- The
\Bakame\Csv\AbstractCsv::createFromString
improved - The
\Bakame\Csv\AbstractCsv::insertOne
improved to take into account CSV controls - The
\Bakame\Csv\AbstractCsv::toHTML
improved to take into account the encoding type
The example directory is also rewritten with more explanations
version 4.0.0
New Class
\Bakame\Csv\Writer
to help creating and updating CSV file.
New Abstract
\Bakame\Csv\AbstractCsv
abstract class is the new parent for:
- the
\Bakame\Csv\Reader
- the
\Bakame\Csv\Writer
This class implements the IteratorAggregate
and the JsonSerializable
interfaces and has a __toString
method. (see the README file to have a complete list of methods shared between \Bakame\Csv\Reader
and \Bakame\Csv\Writer
).
New Trait
\Bakame\Csv\Traits\IteratorQuery
is used in \Bakame\Csv\Reader
to enable CSV filtering.
New Methods
- the
\Bakame\Csv\Writer::insertOne
to insert one line into a CSV. - the
\Bakame\Csv\Writer::insertAll
to insert many lines into a CSV.
Changed Methods:
\Bakame\Csv\Reader::fetchCol
no longer accept a third option$strict
\Bakame\Csv\Reader::fetchOne
to read a single line of the CSV.(this method was deprecated in version 3.2.0 . But it is no longer deprecated and comes with a better implementation)
Removed Interface
\Bakame\Csv\ReaderInterface
Remove Class
\Bakame\Csv\Codec
Remove Traits
\Bakame\Csv\Traits\CsvControls
(now this is done by\Bakame\Csv\AbstractCsv
)\Bakame\Csv\Traits\CsvOutput
(now this is done by\Bakame\Csv\AbstractCsv
)
Remove methods
\Bakame\Csv\Reader
no longer implements theArrayAccess
interface\Bakame\Csv\Reader::getFile
\Bakame\Csv\Reader::fetchValue
The library comes bundle with examples to help the developer see the classes in action.
version 3.3.0
New Traits
The Library is restructured and Traits are placed in their own subdirectory
\Bakame\Csv\Traits\CsvControls
to set/get Csv controls flags\Bakame\Csv\Traits\CsvOutput
to output in different forms the CSV
New Interfaces:
- The
\Bakame\Csv\Reader
implements theIteratorAggregate
Interface
New Methods:
\Bakame\Csv\Reader::createFromString
this static function returns a new\Bakame\Csv\Reader
object from a string- The
\Bakame\Csv\Reader::getIterator
is introduce and will replace\Bakame\Csv\Reader::getFile
Update:
- The
\Bakame\Csv\Reader::query
has a new optional parameter$callable
format the given iterator rows - The
\Bakame\Csv\Reader::fetch*
$callable
parameter is now normalized to accept an array - The
\Bakame\Csv\Reader::fetchCol
now accept a third option$strict
which is a boolean. By default$strict
is false and the method behaviour remained the same. If$strict
is true, the method will filter out the rows that do not contain the specified column index.
Deprecated
- The
\Bakame\Csv\Reader::getFile
is deprecated and is to be remove in the next major point release
Removed
- The
\Bakame\Csv\ReaderInterface
is removed as it was useless
version 3.2.0
New Interfaces:
- The
\Bakame\Csv\Reader
implements theJsonSerializable
Interface - The
\Bakame\Csv\Reader
implements theArrayAccess
Interface
New Methods:
\Bakame\Csv\Reader::toHTML
returns the CSV as a html table\Bakame\Csv\Reader::setFilter
adds filtering capabilities to\Bakame\Csv\Reader
\Bakame\Csv\Reader::setSortBy
adds sorting capabilities to\Bakame\Csv\Reader
\Bakame\Csv\Reader::setOffset
and\Bakame\Csv\Reader::setLimit
add limiting capabilities to\Bakame\Csv\Reader
\Bakame\Csv\Reader::query
adds manual filtering capabilities- The
\Bakame\Csv\Codec
adds setter and getter methods for the$flags
property.
Update:
- The
\Bakame\Csv\Codec
constructor has a new optional parameter$flags
to set thesplFileObject
flag property
Deprecated
- The
\Bakame\Csv\Reader::fetchOne
and\Bakame\Csv\Reader::fetchValue
are deprecated and are to be remove in the next major point release
version 3.1.0
New Methods:
- The
\Bakame\Csv\Reader::output
output the CSV data directly in the output buffer - The
\Bakame\Csv\Reader::__toString
can be use to echo the raw CSV
Update:
- The
\Bakame\Csv\Reader::fetch*
methods arguments are better validated