All Notable changes to Csv
will be documented in this file
Next - TBD
- Adding the
TabularDataReader::map
method.
- None
- None
- None
9.20.1 - 2024-12-18
- None
- None
- None
9.20.0 - 2024-12-13
XMLConverter::formatter
HTMLConverter::formatter
Writer::encloseNone
Writer::encloseNecessary
Writer::noEnclosure
- None
JsonConverter::formatter
now accepts callable before onlyClosure
where accepted.- The protected property
Writer::$enclose_all
is no longer a boolean but an integer
- None
9.19.0 - 2024-12-08
JsonConverter::withPrettyPrint
now accepts an optional$identSize
parameter as its unique parameter.Statement::when
to enable conditionable query building.- Using PHP8.4
Deprecated
attribute to signal deprecated public API methods and constants.
JsonConverter::indentSize
- Adding forgotten support for
callable
in theQuery\Constraint
namespace. - Fix
HttpHeaders::forFileDownload
to be inline with RFC2183 and HTTP field name and value best practices.
- None
9.18.0 - 2024-10-18
League\Csv\JsonConverter::chunkSize
League\Csv\AbstractCsv::download
League\Csv\AbstractCsv::output
useLeague\Csv\AbstractCsv::download
insteadLeague\Csv\FragmentFinder
and derived methods are marked as experimental as their results will be changed in the next major version.
League\Csv\JsonConverter::download
the filename is now nullableLeague\Csv\XMLConverter::download
the filename is now nullableLeague\Csv\JsonConverter::save
throws aTypeError
exception if the$destination
type is not supported.
- None
9.17.0 - 2024-10-10
League\Csv\SwapDelimiter::apppendTo
League\Csv\SwapDelimiter::prependTo
League\Csv\CharsetConverter::apppendTo
League\Csv\CharsetConverter::prependTo
League\Csv\XMLConverter::download
League\Csv\JsonConverter
League\Csv\Constraint\Criteria::andNot
League\Csv\Constraint\Criteria::orNot
League\Csv\Constraint\Criteria::xorNot
League\Csv\Serializer\MapRecord
attribute- adding the
convertEmptyStringToNull
options toMapCell
and toMapRecord
to improve string andnull
conversion - adding the
trimFieldValueBeforeCasting
options toMapCell
and toMapRecord
to improve string conversion - adding the
trimElementValueBeforeCasting
option toCasToArray
to improve conversion during denormalization - adding the
headerOffset
option toCasToArray
to improve conversion during denormalization. The optoon is only used with the CSV shape.
- None
Cast*
methods accept more input type to improve Denormalization usage whenReader::addFormatter
is used or when the collection contains data other than string andnull
.Stream::getSize
is added to the internalStream
classStream::getContents
is added to the internalStream
classMapIterator::toIterator
is added to the internal classMapIterator
class to convert anyiterable
into anIterator
.- Casting a CSV to an
array
it now will be a collection of array instead of a simplearray
. - Added the internal class
HttpHeaders
to improve file download throughout the codebase.
leage\csv-doctrine
is no longer a sub-split of the mainleague/csv
package.
9.16.0 - 2024-05-24
Bom
enumStream::ftell
Statement::orderByAsc
Statement::orderByDesc
Statement::andWhere
Statement::whereNot
Statement::orWhere
Statement::xorWhere
Statement::andWhereColumn
Statement::whereNotColumn
Statement::orWhereColumn
Statement::xorWhereColumn
Statement::andWhereOffset
Statement::whereNotOffset
Statement::orWhereOffset
Statement::xorWhereOffset
Query
feature to allow easier filtering, ordering and querying tabular data
ByteSequence
Interface use theBom
enum insteadInfo::fetchBOMSequence
useBom::tryFromSequence
insteadLeague\Csv\Doctrine
use the newLeague\Csv\Constraint
feature insteadLeague\Csv\Statement::create
arguments; The method should be used without any argument at all. All arguments will be removed in the next major version.
Reader
andResultSet
docblocks- internal code uses
Bom
enum instead ofInfo::fetchBOMSequence
- the
AbstractCsv
BOM related properties are moved to beingBom
instances instead of nullable string. setOutpuBOM
will only accept valid BOM sequences all other values except the empty string will throw aValueError
exception;- The package no longer requires the
ext-mbstring
extension to work. But you should have it install in your system in order to use thembstring
related stream filters. - Issue #524 fix issue with
ResultSet::chunkBy
not working as documented.
- None
9.15.0 - 2023-02-20
Statement::select
TabularDataReader::getRecordsAsObject
TabularDataReader::chunkBy
TabularDataReader::mapHeader
TabularDataReader::getObjects
useTabularDataReader::getRecordsAsObject
instead
Reader::select
andResultSet::select
now internally useStatement::select
Statement
should not throw whenLimitIterator
is used in combinaison withArrayIterator
.Statement
internal codebase improvement.- Using the
$header
argument onStatement::process
is no longer deprecated.E_USER_DEPRECATED
is no longer triggered. - BOM stripping no longer depends on the
mbstring
extension TabularDataReader::fetchColumn
is no longer deprecated
- None
9.14.0 - 2023-12-29
League\Csv\TabularDataReader::nthAsObject
equivalent tonth
but returns an object ornull
League\Csv\TabularDataReader::firstAsObject
equivalent tofirst
but returns an object or nullLeague\Csv\Serializer\Denormalizer::types
list all the registered types
- None
- None
- None
9.13.0 - 2023-12-16
League\Csv\SwapDelimiter
stream filter to allow working with multibyte CSV delimiterLeague\Csv\Serializer\AfterMapping
to work around the limitation of not using the class constructor during denormalization.League\Csv\Serializer\Denormalizer
to allow registering type alias to improve callback usage.League\Csv\Serializer\MapCell
has a new propertyignore
to allow ignoring a property or a method during denormalization.
- None
- None
- None
9.12.0 - 2023-12-02
TabulatDataReader::value
TabulatDataReader::select
TabulatDataReader::getObjects
TabulatDataReader::matching
TabulatDataReader::matchingFirst
TabulatDataReader::matchingFirstOrFail
ResultSet::fromRecords
Stream::setMaxLineLen
Stream::getMaxLineLen
League\Csv\Serializer\Denormalizer
to allow denormalizing records into objects #508League\Csv\FragmentFinder
to implement RFC7111
- Using the
$header
argument onStatement::process
is deprecated and will be removed in the next version. UseTabularDataReader::getRecords
on the returned value instead. It's usage will trigger aE_USER_DEPRECATED
call.
- The optional
$header
argument forTabularDataReader::getRecords
becomes a full mapper between the records column offset and the column names #498 ResultSet
constructor now allows the records to be anarray
.- The internal
Stream
object will throw aRuntimeException
if the rewind action fails - if calls to
fseek
fails (returns-1
) aRuntimeException
will be thrown. Stream
can iterate and return the full line respectingSplFielObject
flags. Previously it only returned the CSV records.MapIterator::fromIterable
to instantiate aMapIterator
object from any iterable structure.
- None
9.11.0 - 2023-09-23
EscapeFormula::unescapeRecord
does the opposite ofEscapeFormula::escapeRecord
TabularReader::each
(implemented on theReader
and theResultSet
object)TabularReader::exists
(implemented on theReader
and theResultSet
object)TabularReader::reduce
(implemented on theReader
and theResultSet
object)TabularReader::filter
(implemented on theReader
and theResultSet
object)TabularReader::slice
(implemented on theReader
and theResultSet
object)TabularReader::sorted
(implemented on theReader
and theResultSet
object)Reader::addFormatter
(implemented on theReader
and theResultSet
object)
EscapeFormula::__invoke
useEscapeFormula::escapeRecord
instead
- None
- None
9.10.0 - 2023-08-04
Writer::forceEnclosure
andWriter::relaxEnclosure
to control the presence of enclosure in the generated CSVWriter::getEndOfLine
andWriter::setEndOfLine
EncloseField
stream filter in favor of the newWriter::forceEnclosure
method.Writer::getNewline
andWriter::setNewline
in favor ofWriter::getEndOfLine
andWriter::setEndOfLine
Stream::fwrite
to allow writing to a file in a normalized way. Internal use.- Documentation Fixed removing unreleased documented feature by @nclavaud
- None
9.9.0 - 2023-03-11
TabularDataWriter
interface to represent how to write to a tabular data document.TabularDataReader::first
to replaceTabularDataReader::fetchOne
TabularDataReader::nth
to replaceTabularDataReader::fetchOne
CharsetConverter::addBOMSkippingTo
to improve BOM skipping see bug #483
TabularDataReader::fetchOne
-
Stream::createFromResource
-
Stream::__construct
is made private. The class is already marked as internal so BC break does not apply on it. -
Using PHP8 feature to rewrite internal codebase
-
Replaced simple comparisons with strict comparison operator where types are obvious in internal codebase by @astepin
-
Marked class constants explicitly as public by @astepin
-
Minimal support version PHP8.1.2
-
Fix Docblock and method signature using PHP8 feature (Union Type)
-
Fix Internal codebase around
seek
usage and `#75917 requires PHP8.1.2 -
Remove internal usage of deprecated methods
Stream::fwrite
The class is already marked as internal so BC break does not apply on it.Stream::fgets
The class is already marked as internal so BC break does not apply on it.- Drop support for PHP7 and PHP8.0
- Polyfill to enable using fputcsv
$eol
argument
9.8.0 - 2022-01-04
- Added PHP7.4 typed properties where applicable
TabularDataReader::fetchColumnByName
to replaceTabularDataReader::fetchColumn
TabularDataReader::fetchColumnByOffset
to replaceTabularDataReader::fetchColumn
TabularDataReader::fetchColumn
useTabularDataReader::fetchColumnByOffset
orTabularDataReader::fetchColumnByName
instead
AbstractCsv
constructor is marked final via docblock.
The method should never be extended or changed in child classes to avoid unexpected behaviour
- PHP7.3 support
- Remove internal
EmptyEscapeParser
Polyfill used inReader
class - Remove PHP7.4 polyfill features in
Writer
class
9.7.4 - 2021-11-30
- None
- None
- Bug fix
EscapeFormula
to follow OWASP latest recommendation PR #452
thanks to @robertfausk and @Lehmub
- None
9.7.3 - 2021-11-21
- None
- None
- Update PHPStan requirement for development
- Improve Documentation generation thanks to pdelre
- PHP8.1 compliance: using
ReturnTypeWillChange
to avoid emitting a unnecessary deprecation notice. thanks to cedric-anne
- None
9.7.2 - 2021-10-05
- None
- None
- Update dependencies requirement for development
- PHP8.1 compliance: replace
FILTER_SANITIZE_STRING
byFILTER_UNSAFE_RAW
- PHP8.1 compliance: remove duplicated public properties declaration
- PHP8.1 compliance: add support for fputcsv
$eol
argument
- None
9.7.1 - 2021-04-17
- None
- None
- fix writer filter #421 by LosingBattle
- None
9.7.0 - 2021-03-26
League\Csv\SyntaxError::duplicateColumnNames
to expose column name duplicates during header usageLeague\Csv\UnableToProcessCsv
as the new Exception Marker InterfaceLeague\Csv\UnavailableStream
as the new ExceptionLeague\Csv\Info::getDelimiterStats
to replace the namespace functiondelimiter_detect
League\Csv\Info::fetchBOMSequence
to replace the namespace functionbom_match
League\Csv\AbstractCsv::toString
to replaceLeague\Csv\AbstractCsv::getContent
andLeague\Csv\AbstractCsv::__toString
League\Csv\XMLConverter::create
to replaceLeague\Csv\XMLConverter::__construct
League\Csv\HTMLConverter::create
to replaceLeague\Csv\HTMLConverter::__construct
League\Csv\AbstractCsv::supportsStreamFilterOnRead
andLeague\Csv\AbstractCsv::supportsStreamFilterOnWrite
to replaceLeague\Csv\AbstractCsv::supportsStreamFilter
andLeague\Csv\AbstractCsv::getStreamFilterMode
League\Csv\delimiter_detect
useLeague\Csv\Info::getDelimiterStats
League\Csv\bom_match
useLeague\Csv\Info::fetchBOMSequence
League\Csv\AbstractCsv::getContent
useLeague\Csv\AbstractCsv::toString
League\Csv\AbstractCsv::getStreamFilterMode
useLeague\Csv\AbstractCsv::supportsStreamFilterOnRead
orLeague\Csv\AbstractCsv::supportsStreamFilterOnWrite
League\Csv\AbstractCsv::supportsStreamFilter
useLeague\Csv\AbstractCsv::supportsStreamFilterOnRead
orLeague\Csv\AbstractCsv::supportsStreamFilterOnWrite
- Calling exceptions constructor, use named constructors instead.
League\Csv\XMLConverter::__construct
useLeague\Csv\XMLConverter::create
League\Csv\HTMLConverter::__construct
useLeague\Csv\HTMLConverter::create
- Move tests into the
src
directory - Fixed encoder method resolver implementation
- all classes marked as
@internal
are now final League\Csv\AbstractCsv::STREAM_FILTER_MODE
constant replacesLeague\Csv\AbstractCsv::$stream_filter_mode
- PHP7.2 support
League\Csv\AbstractCsv::$stream_filter_mode
9.6.2 - 2020-12-10
- Using Github actions as development tools.
- None
- Removing Travis and Scrutinizr as development tools
9.6.1 - 2020-09-05
- None
- None
- BOM sequence processing fix #394
- None
9.6.0 - 2020-03-17
- More return types and type parameters as supported in PHP7.2+
League\Csv\Statement::create
named constructor to ease constraint builder instantiationLeague\Csv\Statement
can now also processLeague\Csv\ResultSet
instances.League\Csv\TabularDataReader
interface to represent how to read tabular dataLeague\Csv\ResultSet::getRecords
has an optional$header
second argument to make the method works likeLeague\Csv\Reader::getRecords
League\Csv\ResultSet::createFromTabularDataReader
create a new instance fromLeague\Csv\TabularDataReader
implementing class.
- Nothing
League\Csv\Reader
no longer uses__call
to implementfetchOne
,fetchPairs
andfetchColumn
methods.
- Internal polyfill for
is_iterable
- Internal polyfill for
is_nullable_int
- Support for PHP7.0 and PHP7.1
9.5.0 - 2019-12-15
- Improve package exception throwing by adding new exceptions classes that extends
the
League\Csv\Exception
exception marker class #360, #361 feature proposed and developed by Darren MillerLeague\Csv\UnavailableFeature
League\Csv\InvalidArgument
League\Csv\SyntaxError
- Nothing
- bug fix
bom_match
function see issue #363 resolved based on PR from Jerry Martinez - bug fix
delemiter_detect
function see issue #366
- Nothing
9.4.1 - 2019-10-17
- Nothing
- Nothing
- Nothing
9.4.0 - 2019-10-02
-
Adding support for controlling empty record presence in
Reader::getRecords
return value.Reader::includeEmptyRecords
Reader::skipEmptyRecords
Reader::isEmptyRecordsIncluded
-
Adding support for controlling Input BOM usage in the library:
AbstractCsv::skipInputBOM
AbstractCsv::includeInputBOM
AbstractCsv::isInputBOMIncluded
- Nothing
EmptyEscapeParser::parse
no longer auto skip empty records
- Nothing
9.3.0 - 2019-07-30
XMLConverter::import
see #348 thanks @kusabi- Support for
thead
,tfoot
andtbody
inHTMLConverter::convert
via the addition of protected methodsHTMLConverter::addHTMLAttributes
andHTMLConverter::appendHeaderSection
#348 thanks @kusabi
- Nothing
- Internal improvement in
Reader
dockblock thanks @ghobaty. - Improve strict comparison when using
preg_match
. - Improve CSV control in
Stream
.
- Nothing
9.2.1 - 2019-06-08
- Nothing
- Nothing
AbstractCSV::chunk
see #325 remove CSV flags from the Stream class to avoid infinite loop.- Internal improve
HTMLConverter
.
- Nothing
9.2.0 - 2019-03-08
- Supports for PHP7.4 empty string for the escape character
- Supports for empty string for the escape character with a polyfill for PHP7.4- versions.
AbstractCSV::getPathname
see #321 thanks @tomkyle
League\Csv\RFC4180Field
useAbstractCSV::setEscape
method with an empty string instead.
-
AbstractCSV::__construct
correctly initializes properties -
AbstractCSV::createFromString
named constructor default argument is now an empty string -
AbstractCSV::setEscape
now accepts an empty string likefputcsv
andfgetcsv
-
Writer::insertOne
fixes throwing exception when record can not be inserted -
XMLConverter
convert to string the record value to avoid PHP warning onnull
value -
Internal
Stream::createFromString
named constructor default argument is now an empty string -
Internal
Stream::fwrite
improved -
Internal
Stream::__destruct
no longer emit warning on invalid stream filter removal. -
Internal
Stream::seek
returns0
if the seeked position0
is valid see #321 thanks @HaozhouChen -
Reader:getHeader
when the record is an empty line.
- Nothing
9.1.4 - 2018-05-01
- Nothing
- Nothing
Writer::setFlushThreshold
should accept 1 as an argument #289CharsetConverter::convert
should not try to convert numeric value #287
- Nothing
9.1.3 - 2018-03-12
- Nothing
- Nothing
Writer::insertOne
allow empty array to be added to the CSV (allow inserting empty row)- Removed all return type from named constructor see #285
- Added PHPStan for static code analysis
- Nothing
- None
- None
Reader::fetchAssoc
no longer throws exception because of a bug in PHP7.2+ issue #279
- None
9.1.2 - 2018-02-05
- Nothing
- Nothing
is_iterable
polyfill for PHP7.0Reader::getHeader
no longer throws exception because of a bug in PHP7.2+ issue #279
- Nothing
9.1.1 - 2017-11-28
- Nothing
- Nothing
-
issue with
error_get_last
usage when using a modified PHP error handler see #254 - fixed by @csiszarattila -
Removed seekable word from Stream exception messages.
- Nothing
9.1.0 - 2017-10-20
- Support for non-seekable stream. When seekable feature are required an exceptions will be thrown.
League\Csv\EncloseField
to force enclosure insertion on every field. #269League\Csv\EscapeFormula
a League CSV formatter to prevent CSV Formula Injection in Spreadsheet programs.League\Csv\RFC4180Field::addTo
accept an option$replace_whitespace
argument to improve RFC4180 compliance.League\Csv\Abstract::getContent
to replaceLeague\Csv\Abstract::__toString
. The__toString
method may trigger a Fatal Error with non-seekable stream, instead you are recommended to used the newgetContent
method which will trigger an exception instead.
League\Csv\Abstract::__toString
useLeague\Csv\Abstract::getContent
instead. the__toString
triggers a Fatal Error when used on a non-seekable CSV document. use thegetContent
method instead which will trigger an exception instead.
- Bug fixes headers from AbstractCsv::output according to RFC6266 #250
- Make sure the internal source still exists before closing it #251
- Make sure the
Reader::createFromPath
default open mode isr
see #258 and #266
- Nothing
9.0.1 - 2017-08-21
- Nothing
- Nothing
- CSV controls not applied when calling Writer::insertOne
- Nothing
9.0.0 - 2017-08-18
- Improved CSV Records selection
League\Csv\Reader::getRecords
to access all CSV recordsLeague\Csv\Statement
provides a constraint builder to select CSV records.League\Csv\ResultSet
represents the result set of the selected CSV records.League\Csv\delimiter_detect
function to detect CSV delimiter character
- Improved CSV document header selection.
League\Csv\Reader::getHeader
League\Csv\Reader::getHeaderOffset
League\Csv\Reader::setHeaderOffset
- Improved CSV Records conversion
League\Csv\CharsetConverter
converts CSV records charset.League\Csv\XMLConverter
converts CSV records into DOMDocumentLeague\Csv\HTMLConverter
converts CSV records into HTML table.
- Improved Exception handling
League\Csv\Exception
the default exceptionLeague\Csv\CannotInsertRecord
- Improved CSV document output
League\Csv\AbstractCsv::chunk
method to output the CSV document in chunkLeague\Csv\bom_match
function to detect BOM sequence in a given stringLeague\Csv\ByteSequence
interface to decoupled BOM sequence from CSV documents
- Improved CSV records column count consistency on insertion
League\Csv\ColumnConsistency
- Improved CSV document flush mechanism on insertion
League\Csv\Writer::setFlushThreshold
League\Csv\Writer::getFlushThreshold
- Improve RFC4180 compliance
League\Csv\RFC4180Field
to format field according to RFC4180 rules
- Nothing
-
Improved CSV record insertion
League\Csv\Writer::insertOne
only accepts an array and returns a integerLeague\Csv\Writer::insertAll
only accepts an iterable of array and returns an integer
-
Normalized CSV offset returned value
League\Csv\Reader::fetchColumn
always returns the CSV document original offset.
examples
directoryPHP5
support- The following method is removed because The BOM API is simplified:
League\Csv\AbstractCsv::stripBOM
- All conversion methods are removed in favor of the conversion classes:
League\Csv\Writer::jsonSerialize
League\Csv\AbstractCsv::toHTML
League\Csv\AbstractCsv::toXML
League\Csv\AbstractCsv::setInputEncoding
League\Csv\AbstractCsv::getInputEncoding
- The following methods are removed because the PHP stream filter API is simplified:
League\Csv\AbstractCsv::isActiveStreamFilter
League\Csv\AbstractCsv::setStreamFilterMode
League\Csv\AbstractCsv::appendStreamFilter
League\Csv\AbstractCsv::prependStreamFilter
League\Csv\AbstractCsv::removeStreamFilter
League\Csv\AbstractCsv::clearStreamFilters
- The following methods are removed because switching between connections is no longer possible:
League\Csv\AbstractCsv::newReader
League\Csv\AbstractCsv::newWriter
League\Csv\Reader::getNewline
League\Csv\Reader::setNewline
- The Exception mechanism is improved thus the following class is removed:
League\Csv\Exception\InvalidRowException
;
- The CSV records filtering methods are removed in favor of the
League\Csv\Statement
class:League\Csv\AbstractCsv::addFilter
,League\Csv\AbstractCsv::addSortBy
,League\Csv\AbstractCsv::setOffset
,League\Csv\AbstractCsv::setLimit
;
- CSV records selecting API methods is simplified:
League\Csv\Reader::each
League\Csv\Reader::fetch
League\Csv\Reader::fetchAll
League\Csv\Reader::fetchAssoc
League\Csv\Reader::fetchPairsWithoutDuplicates
- Formatting and validating CSV records on insertion is simplified, the following methods are removed:
League\Csv\Writer::hasFormatter
League\Csv\Writer::removeFormatter
League\Csv\Writer::clearFormatters
League\Csv\Writer::hasValidator
League\Csv\Writer::removeValidator
League\Csv\Writer::clearValidators
League\Csv\Writer::getIterator
- The following Formatters and Validators classes are removed from the package:
League\Csv\Plugin\SkipNullValuesFormatter
League\Csv\Plugin\ForbiddenNullValuesValidator
League\Csv\Plugin\ColumnConsistencyValidator
replace byLeague\Csv\ColumnConsistency
League\Csv\Writer
no longers implements theIteratorAggregate
interfaceLeague\Csv\AbstractCsv::fetchDelimitersOccurrence
is removed replace byLeague\Csv\delimiter_detect
function
- None
- None
Writer::insertOne
was silently failing when inserting record in a CSV document in non-writing mode.- bug fix docblock
- None
- Nothing
- Nothing
- internal
Reader::getRow
when using aStreamIterator
issue #213 - Removed
@deprecated
from selected methods issue #208
- Nothing
AbstractCsv::createFromStream
to enable working with resource stream issue #202
League\Csv\AbstractCsv::stripBom
League\Csv\Reader::getOffset
League\Csv\Reader::getLimit
League\Csv\Reader::getSortBy
League\Csv\Reader::getFilter
League\Csv\Reader::setOffset
League\Csv\Reader::setLimit
League\Csv\Reader::addSortBy
League\Csv\Reader::addFilter
League\Csv\Reader::fetch
League\Csv\Reader::each
League\Csv\Reader::fetchPairsWithoutDuplicates
League\Csv\Reader::fetchAssoc
League\Csv\Writer::removeFormatter
League\Csv\Writer::hasFormatter
League\Csv\Writer::clearFormatters
League\Csv\Writer::removeValidator
League\Csv\Writer::hasValidator
League\Csv\Writer::clearValidators
League\Csv\Writer::jsonSerialize
League\Csv\Writer::toHTML
League\Csv\Writer::toXML
- Nothing
- Nothing
- Nothing
- Nothing
- BOM filtering fix issue #184
AbstractCsv::BOM_UTF32_LE
value fixed
- Nothing
- Nothing
- Nothing
getInputBOM
method name is now consistent everywhere in the API PR #171- preserve fileObject CSV controls commit #8a20c56
- Change
output
method header content-type value totext/csv
PR #175
- Nothing
- The package now includes its own autoloader.
Ouput::getInputEncoding
Ouput::setInputEncoding
Ouput::getEncodingFrom
replaced byOuput::getInputEncoding
Ouput::setEncodingFrom
replaced byOuput::setInputEncoding
- Stream Filters are now url encoded before usage issue #72
- All internal parameters are now using the snake case format
- Nothing
Reader::fetchPairs
Reader::fetchPairsWithoutDuplicates
- Nothing
Reader::fetchColumn
andReader::fetchAssoc
now returnIterator
Reader::fetchAssoc
callable argument expects an indexed row using the submitted keys as its first argumentReader::fetchColumn
callable argument expects the selected column value as its first argument- Default value on
setOutputBOM
is removed AbstractCsv::getOutputBOM
always return a stringAbstractCsv::getInputBOM
always return a string
Controls::setFlags
Controls::getFlags
Controls::detectDelimiterList
QueryFilter::removeFilter
QueryFilter::removeSortBy
QueryFilter::hasFilter
QueryFilter::hasSortBy
QueryFilter::clearFilter
QueryFilter::clearSortBy
Reader::query
- The
$newline
argument fromAbstractCsv::createFromString
Reader::fetch
replacesLeague\Csv\Reader::query
for naming consistencyControls::fetchDelimitersOccurrence
to replaceControls::detectDelimiterList
the latter gives erronous results
Controls::detectDelimiterList
Reader::query
- The
$newline
argument fromAbstractCsv::createFromString
- Streamming feature no longer trim filter name argument issue #122
- Fix default
SplFileObject
flags usage PR #130 AbstractCsv::createFromString
no longer trim the submitted string issue #132
- Nothing
- Nothing
- Nothing
- Enclosures should be removed when a BOM sequence is stripped issue #102
- Nothing
- Nothing
- Nothing
SplFileObject
flags were not always applied using query filter issue #99
- Nothing
stripBOM
query filtering method to ease removing the BOM sequence when querying the CSV document.- All query filters are now accessible in the
Writer
class for conversion methods.
- Nothing
- Internal code has been updated to take into account issue #68479
setFlags
on conversion methods SplFileObject default flags areSplFileObject::READ_AHEAD|SplFileObject::SKIP_EMPTY
insertOne
now takes into account the escape character when modified after the first insert.
- Nothing
- Nothing
- Nothing
setFlags
:SplFileObject::DROP_NEW_LINE
can be remove usingsetFlags
method.
- Nothing
- A new flexible mechanism to format and validate a row before its insertion by adding
Writer::addFormatter
to add a formatter to theWriter
objectWriter::removeFormatter
to remove an already registered formatterWriter::hasFormatter
to detect the presence of a formatterWriter::clearFormatters
to clear all registered formatterWriter::addValidator
to add a validator to theWriter
objectWriter::removeValidator
to remove an already registered validatorWriter::hasValidator
to detect the presence of a validatorWriter::clearValidators
to clear all registered validatorLeague\Csv\Exception\InvalidRowException
exception thrown when row validation failed
- Classes to maintain removed features from the
Writer
classLeague\Csv\Plugin\ColumnConsistencyValidator
to validate column consistency on insertionLeague\Csv\Plugin\ForbiddenNullValuesValidator
to validatenull
value on insertionLeague\Csv\Plugin\SkipNullValuesFormatter
to formatnull
value on insertion
- Nothing
jsonSerialize
,toXML
andtoHTML
output can be modified usingReader
query options methods.AbstractCSV::detectDelimiterList
index keys now represents the occurrence of the found delimiter.getNewline
andsetNewline
are accessible on theReader
class too.- the named constructor
createFromString
now accepts the$newline
sequence as a second argument to specify the last added new line character to better work with interoperability. - Default value on CSV controls setter methods
setDelimiter
,setEnclosure
andsetEscape
are removed - Default
SplFileObject
flags value is nowSplFileObject::READ_CSV|SplFileObject::DROP_NEW_LINE
- All CSV properties are now copied when using
newReader
andnewWriter
methods - BOM addition on output improved by removing if found the existing BOM character
- the
AbstractCSV::output
method now returns the number of bytes send to the output buffer Reader::fetchColumn
will automatically filter out non existing values from the return array
- Setting
ini_set("auto_detect_line_endings", true);
is no longer set in the class constructor. Mac OS X users must explicitly set this ini options in their script. Writer
andReader
default constructor are removed from public API in favor of the named constructors.- All
Writer
methods and constant related to CSV data validation and formatting before insertionWriter::getNullHandlingMode
Writer::setNullHandlingMode
Writer::setColumnsCount
Writer::getColumnsCount
Writer::autodetectColumnsCount
Writer::NULL_AS_EXCEPTION
Writer::NULL_AS_EMPTY
Writer::NULL_AS_SKIP_CELL
AbstractCSV::setOutputBOM
AbstractCSV::getOutputBOM
AbstractCSV::getInputBOM
to manage BOM character with CSV.
- Nothing
- Nothing
- Nothing
Writer::setNewline
,Writer::getNewline
to control the newline sequence character added at the end of each CSV row.
- Nothing
- Nothing
- Nothing
Reader::fetchAssoc
now also accepts an integer as first argument representing a row index.
- Nothing
- Nothing
- Nothing
- Nothing
- Nothing
- Bug Fixed
detectDelimiterList
- Nothing
- Stream Filter API in
League\Csv\AbstractCsv
- named constructors
createFromPath
andcreateFromFileObject
inLeague\Csv\AbstractCsv
to ease CSV object instantiation detectDelimiterList
inLeague\Csv\AbstractCsv
to replace and remove the use ofRuntimeException
indetectDelimiter
setEncodingFrom
andsetDecodingFrom
inLeague\Csv\AbstractCsv
to replacesetEncoding
andgetEncoding
for naming consistencynewWriter
andnewReader
methods inLeague\Csv\AbstractCsv
to replaceWriter::getReader
andReader::getWriter
- Nothing
League\Csv\Reader::each
more strict$callable
MUST returnstrue
League\Csv\AbstractCsv::detectDelimiter
League\Csv\AbstractCsv::setEncoding
andLeague\Csv\AbstractCsv::getEncoding
League\Csv\Reader::setSortBy
League\Csv\Reader::setFilter
League\Csv\Reader::getWriter
League\Csv\Writer::getReader
League\Csv\Reader::fetchCol
League\Csv\Writer::setColumnsCount
,League\Csv\Writer::getColumnsCount
,League\Csv\Writer::autodetectColumnsCount
to enable column consistency in writer modeLeague\Csv\Reader::fetchColumn
replacesLeague\Csv\Reader::fetchCol
for naming consistency
League\Csv\Reader::fetchCol
- Nothing
- Nothing
- Nothing
- Nothing
$open_mode
defaults tor+
inLeague\Csv\AbstractCsv
constructors
- Nothing
League\Csv\Writer::setNullHandlingMode
andLeague\Csv\Writer::getNullHandlingMode
to handlenull
value
- Nothing
setting ini_set("auto_detect_line_endings", true);
no longer needed for Mac OS
- Nothing
League\Csv\Reader::addSortBy
,League\Csv\Reader::removeSortBy
,League\Csv\Reader::hasSortBy
,League\Csv\Reader::clearSortBy
to improve sortingLeague\Csv\Reader::clearFilter
to align extract filter capabilities to sorting capabilities
League\Csv\Reader::setSortBy
replaced by a better implementation
League\Csv\Reader::setOffset
now defaults to 0;League\Csv\Reader::setLimit
now defaults to -1;detectDelimiter
bug fixes
- Nothing
League\Csv\Reader::each
to ease CSV import dataLeague\Csv\Reader::addFilter
,League\Csv\Reader::removeFilter
,League\Csv\Reader::hasFilter
to improve extract filter capabilitiesdetectDelimiter
method toLeague\Csv\AbstractCsv
to sniff CSV delimiter character.
League\Csv\Reader::setFilter
replaced by a better implementation
- Nothing
- Nothing
- Change namespace from
Bakame\Csv
toLeague\Csv
- Nothing
- Nothing
- Nothing
$open_mode
validation is done by PHP internals directly
- Nothing
toXML
method to transcode the CSV into a XML inBakame\Csv\AbstractCsv
toHTML
method bug inBakame\Csv\AbstractCsv
output
method accepts an optional$filename
argumentBakame\Csv\Reader::fetchCol
defaults to$columnIndex = 0
Bakame\Csv\Reader::fetchOne
defaults to$offset = 0
- Move from
PSR-0
toPSR-4
to autoload the library
Bakame\Csv\Reader
methods fixedjsonSerialize
bug fixed
getEncoding
andsetEncoding
methods toBakame\Csv\AbstractCsv
Bakame\Csv\Writer::insertOne
takes into account CSV controlstoHTML
method takes into account encoding
Bakame\Csv\Writer
Bakame\Csv\Writer
andBakame\Csv\Reader
extendBakame\Csv\AbstractCsv
- Nothing
Bakame\Csv\Reader::fetchOne
is no longer deprecatedBakame\Csv\Reader::fetchCol
no longer accepts a third parameter$strict
Bakame\Csv\Codec
now the library is composer of 2 main classesBakame\Csv\Reader::getFile
Bakame\Csv\Reader::fetchValue
Bakame\Csv\Reader
no longer implements theArrayAccess
interface
Bakame\Csv\Reader
implementsIteratorAggregate
InterfaceBakame\Csv\Reader::createFromString
to create a CSV object from a raw stringBakame\Csv\Reader::query
accept an optional$callable
parameter
Bakame\Csv\Reader::getFile
in favor ofBakame\Csv\Reader::getIterator
Bakame\Csv\ReaderInterface
useless interface
Bakame\Csv\Reader::fetch*
$callable
parameter is normalized to accept an arrayBakame\Csv\Reader::fetchCol
accepts a third parameter$strict
Bakame\Csv\Reader
implements the following interfacesJsonSerializable
andArrayAccess
Bakame\Csv\Reader::toHTML
to output the CSV as a HTML tableBakame\Csv\Reader::setFilter
,Bakame\Csv\Reader::setSortBy
,Bakame\Csv\Reader::setOffset
,Bakame\Csv\Reader::setLimit
,Bakame\Csv\Reader::query
to perform SQL like queries on the CSV content.Bakame\Csv\Codec::setFlags
,Bakame\Csv\Codec::getFlags
, Bakame\Csv\Codec::__construct : add an optional$flags
parameter to enable the use ofSplFileObject
constants flags
Bakame\Csv\Reader::fetchOne
replaced byBakame\Csv\Reader::offsetGet
Bakame\Csv\Reader::fetchValue
useless method
Bakame\Csv\Reader::output
output the CSV data directly in the output bufferBakame\Csv\Reader::__toString
can be use to echo the raw CSV
Bakame\Csv\Reader::fetchAssoc
when users keys and CSV row data don't have the same length
Bakame\Csv\ReaderInterface
Bakame\Csv\Reader
class
Bakame\Csv\Codec::loadString
returns aBakame\Csv\Reader
objectBakame\Csv\Codec::loadFile
returns aBakame\Csv\Reader
objectBakame\Csv\Codec::save
returns aBakame\Csv\Reader
object
Bakame\Csv\CsvCodec
class renamedBakame\Csv\Codec
- Nothing
- Nothing
Bakame\Csv\Codec::create
from public API
Initial Release of Bakame\Csv