All Notable changes to Csv will be documented in this file
Next - TBD
- Support for
Closurein constant expressions during Record Mapping. AbstractCsv::fromStreamto instantiate aReaderor aWriterinstance from a stream or aSplFileObjectobjectAbstractCsv::fromPathto instantiate aReaderor aWriterinstance from a path as a string or aSplFileInfoobject
- None
- None
- Support for PHP8.1
9.28.0 - 2025-12-27
EnumFormatterto format Enum for CSV serialization
- None
- None
- None
9.27.1 - 2025-10-25
- None
- None
AbstractCsv::downloadimproved implementation see #569
- None
9.27.0 - 2025-10-16
AbstractCsv::fromandAbstractCsv::fromStringto simplify instantiatingReaderandWriterinstance.Stream::fromandStream::fromStringto simplify internal instantiation ofStreaminstances.
AbstractCsv::createFromStringuseAbstractCsv::fromStringinsteadAbstractCsv::createFromStreamuseAbstractCsv::frominsteadAbstractCsv::createFromFileObjectuseAbstractCsv::frominsteadStream::createFromResourceuseStream::frominsteadStream::createFromStringuseStream::fromStringinstead
- `None
- None
9.26.0 - 2025-10-01
JsonFormat::NdJsonHeaderandJsonFormat::NdJsonHeaderLessJsonConverterconversion methods accept an optional$headerparameter to handle the new JSON formats.Writer::insertAlland converter classesconvertmethods now acceptTabularDataandTabularDataProviderimplementing classes
- None
- Adding an internal
Warningclass to fix warnings triggering in the codebase. - Fix
chunkSizeusage when NDJson is generated by theJsonConverterclass. - NdJson/Jsonlines content-type is fixed to
application/x-ndjson.
- None
9.25.0 - 2025-09-11
JsonFormatEnum to allow exporting to JsonLines with theJsonConverterobject.TabularDataProviderinterface to allow connecting to the package features without implementing all the methods.
- None
- Fix test around equality, PHPUnit and closures #568
- Added support for
PHP8.5in GitHub actions - Ensure
DOMDocument::createTextNode()[] receives a string #567 by serpentblade
- None
9.24.1 - 2025-06-25
- None
- None
- None
9.24.0 - 2025-06-24
TabularData::lastandTabularData::lastAsObject
- None
- Improved implementation for
AbstractCsv::downloadmethod
- None
9.23.0 - 2025-03-28
TypeCastingInfoto improve the error message when type casting fails during denormalization #561
fetchColumnByOffsetandfetchColumnByNameusefetchColumninstead.
- Test suite around header testing using Xdebug functions #559
- None
9.22.0 - 2025-02-28
Writer::necessaryEnclosureTabularDataReader::selectAllExceptStatement::selectAllExceptResultSet::fromandResultSet::tryFromRdbmsResultclass to ease importing RDBMS result into the package classesTabularDatainterfaceBufferclassXMLConverter::supportsHeaderXMLConverter::whenHTMLConverter::whenJsonConverter::whenCharsetConverter::appendOnReadTo,CharsetConverter::appendOnWriteTo,CharsetConverter::prependOnReadTo,CharsetConverter::prependOnWriteTo
Writer::relaxEnclosureuseWriter::necessaryEnclosureResultSet::createFromTabularDataReaderuseResultSet::fromResultSet::createFromRecordsuseResultSet::fromResultSet::__constructis marked as beinginternaland deprecated before being made private useResultSet::fromXMLConverter::convertuseXMLConverter::importinsteadXMLConverter::createuseXMLConverter::__constructinsteadHTMLConverter::createuseHTMLConverter::__constructinsteadStatement::createuseStatement::__constructinsteadFragmentFinder::createuseFragmentFinder::__constructinsteadCharsetConverter::appendTo,CharsetConverter::prependTouse the more strict methods added on the instance
Comparison::CONTAINSmust check the value is a string before callingstr_compare#548 by cage-is- Fix testing to improve Debian integration #549 by David Prévot and tenzap
Bom::tryFromSequenceandBom::fromSequencesupports theReaderandWriterclasses.XMLConverter::$formattershould not be public.XMLConverterinternal rewritten to take advantage of PHP8.4 new dom classesHTMLConverterinternal rewritten to take advantage of PHP8.4 new dom classesXMLConverter::fieldElementnow has anullablefield element to allow using headers names as cell names.
- None
9.21.0 - 2025-01-08
TabularDataReader::mapmethod.StreamFilterclassCallbackStreamFilterclassAbstractCsv::appendStreamFilterOnReadAbstractCsv::appendStreamFilterOnWriteAbstractCsv::prependStreamFilterOnReadAbstractCsv::prependStreamFilterOnWriteStream::getModereturns the underlying stream mode; internal codebase.
AbstractCsv::addStreamFilteruseAbstractCsv::appendStreamFilterOnReadorAbstractCsv::appendStreamFilterOnWriteinstead.
- Improve
CharsetConverterandSwapDelimiterinternal code. - Fix
supportStreamFilterOnReadandsupportStreamFilterOnWriteto expose the document real stream filter capabilities.
- None
9.20.1 - 2024-12-18
- None
- None
- None
9.20.0 - 2024-12-13
XMLConverter::formatterHTMLConverter::formatterWriter::encloseNoneWriter::encloseNecessaryWriter::noEnclosure
- None
JsonConverter::formatternow accepts callable before onlyClosurewhere accepted.- The protected property
Writer::$enclose_allis no longer a boolean but an integer
- None
9.19.0 - 2024-12-08
JsonConverter::withPrettyPrintnow accepts an optional$identSizeparameter as its unique parameter.Statement::whento enable conditionable query building.- Using PHP8.4
Deprecatedattribute to signal deprecated public API methods and constants.
JsonConverter::indentSize
- Adding forgotten support for
callablein theQuery\Constraintnamespace. - Fix
HttpHeaders::forFileDownloadto be inline with RFC2183 and HTTP field name and value best practices.
- None
9.18.0 - 2024-10-18
League\Csv\JsonConverter::chunkSizeLeague\Csv\AbstractCsv::download
League\Csv\AbstractCsv::outputuseLeague\Csv\AbstractCsv::downloadinsteadLeague\Csv\FragmentFinderand derived methods are marked as experimental as their results will be changed in the next major version.
League\Csv\JsonConverter::downloadthe filename is now nullableLeague\Csv\XMLConverter::downloadthe filename is now nullableLeague\Csv\JsonConverter::savethrows aTypeErrorexception if the$destinationtype is not supported.
- None
9.17.0 - 2024-10-10
League\Csv\SwapDelimiter::apppendToLeague\Csv\SwapDelimiter::prependToLeague\Csv\CharsetConverter::apppendToLeague\Csv\CharsetConverter::prependToLeague\Csv\XMLConverter::downloadLeague\Csv\JsonConverterLeague\Csv\Constraint\Criteria::andNotLeague\Csv\Constraint\Criteria::orNotLeague\Csv\Constraint\Criteria::xorNotLeague\Csv\Serializer\MapRecordattribute- adding the
convertEmptyStringToNulloptions toMapCelland toMapRecordto improve string andnullconversion - adding the
trimFieldValueBeforeCastingoptions toMapCelland toMapRecordto improve string conversion - adding the
trimElementValueBeforeCastingoption toCasToArrayto improve conversion during denormalization - adding the
headerOffsetoption toCasToArrayto 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::addFormatteris used or when the collection contains data other than string andnull.Stream::getSizeis added to the internalStreamclassStream::getContentsis added to the internalStreamclassMapIterator::toIteratoris added to the internal classMapIteratorclass to convert anyiterableinto anIterator.- Casting a CSV to an
arrayit now will be a collection of array instead of a simplearray. - Added the internal class
HttpHeadersto improve file download throughout the codebase.
leage\csv-doctrineis no longer a sub-split of the mainleague/csvpackage.
9.16.0 - 2024-05-24
BomenumStream::ftellStatement::orderByAscStatement::orderByDescStatement::andWhereStatement::whereNotStatement::orWhereStatement::xorWhereStatement::andWhereColumnStatement::whereNotColumnStatement::orWhereColumnStatement::xorWhereColumnStatement::andWhereOffsetStatement::whereNotOffsetStatement::orWhereOffsetStatement::xorWhereOffsetQueryfeature to allow easier filtering, ordering and querying tabular data
ByteSequenceInterface use theBomenum insteadInfo::fetchBOMSequenceuseBom::tryFromSequenceinsteadLeague\Csv\Doctrineuse the newLeague\Csv\Constraintfeature insteadLeague\Csv\Statement::createarguments; The method should be used without any argument at all. All arguments will be removed in the next major version.
ReaderandResultSetdocblocks- internal code uses
Bomenum instead ofInfo::fetchBOMSequence - the
AbstractCsvBOM related properties are moved to beingBominstances instead of nullable string. setOutpuBOMwill only accept valid BOM sequences all other values except the empty string will throw aValueErrorexception;- The package no longer requires the
ext-mbstringextension to work. But you should have it install in your system in order to use thembstringrelated stream filters. - Issue #524 fix issue with
ResultSet::chunkBynot working as documented.
- None
9.15.0 - 2023-02-20
Statement::selectTabularDataReader::getRecordsAsObjectTabularDataReader::chunkByTabularDataReader::mapHeader
TabularDataReader::getObjectsuseTabularDataReader::getRecordsAsObjectinstead
Reader::selectandResultSet::selectnow internally useStatement::selectStatementshould not throw whenLimitIteratoris used in combinaison withArrayIterator.Statementinternal codebase improvement.- Using the
$headerargument onStatement::processis no longer deprecated.E_USER_DEPRECATEDis no longer triggered. - BOM stripping no longer depends on the
mbstringextension TabularDataReader::fetchColumnis no longer deprecated
- None
9.14.0 - 2023-12-29
League\Csv\TabularDataReader::nthAsObjectequivalent tonthbut returns an object ornullLeague\Csv\TabularDataReader::firstAsObjectequivalent tofirstbut returns an object or nullLeague\Csv\Serializer\Denormalizer::typeslist all the registered types
- None
- None
- None
9.13.0 - 2023-12-16
League\Csv\SwapDelimiterstream filter to allow working with multibyte CSV delimiterLeague\Csv\Serializer\AfterMappingto work around the limitation of not using the class constructor during denormalization.League\Csv\Serializer\Denormalizerto allow registering type alias to improve callback usage.League\Csv\Serializer\MapCellhas a new propertyignoreto allow ignoring a property or a method during denormalization.
- None
- None
- None
9.12.0 - 2023-12-02
TabulatDataReader::valueTabulatDataReader::selectTabulatDataReader::getObjectsTabulatDataReader::matchingTabulatDataReader::matchingFirstTabulatDataReader::matchingFirstOrFailResultSet::fromRecordsStream::setMaxLineLenStream::getMaxLineLenLeague\Csv\Serializer\Denormalizerto allow denormalizing records into objects #508League\Csv\FragmentFinderto implement RFC7111
- Using the
$headerargument onStatement::processis deprecated and will be removed in the next version. UseTabularDataReader::getRecordson the returned value instead. It's usage will trigger aE_USER_DEPRECATEDcall.
- The optional
$headerargument forTabularDataReader::getRecordsbecomes a full mapper between the records column offset and the column names #498 ResultSetconstructor now allows the records to be anarray.- The internal
Streamobject will throw aRuntimeExceptionif the rewind action fails - if calls to
fseekfails (returns-1) aRuntimeExceptionwill be thrown. Streamcan iterate and return the full line respectingSplFielObjectflags. Previously it only returned the CSV records.MapIterator::fromIterableto instantiate aMapIteratorobject from any iterable structure.
- None
9.11.0 - 2023-09-23
EscapeFormula::unescapeRecorddoes the opposite ofEscapeFormula::escapeRecordTabularReader::each(implemented on theReaderand theResultSetobject)TabularReader::exists(implemented on theReaderand theResultSetobject)TabularReader::reduce(implemented on theReaderand theResultSetobject)TabularReader::filter(implemented on theReaderand theResultSetobject)TabularReader::slice(implemented on theReaderand theResultSetobject)TabularReader::sorted(implemented on theReaderand theResultSetobject)Reader::addFormatter(implemented on theReaderand theResultSetobject)
EscapeFormula::__invokeuseEscapeFormula::escapeRecordinstead
- None
- None
9.10.0 - 2023-08-04
Writer::forceEnclosureandWriter::relaxEnclosureto control the presence of enclosure in the generated CSVWriter::getEndOfLineandWriter::setEndOfLine
EncloseFieldstream filter in favor of the newWriter::forceEnclosuremethod.Writer::getNewlineandWriter::setNewlinein favor ofWriter::getEndOfLineandWriter::setEndOfLine
Stream::fwriteto 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
TabularDataWriterinterface to represent how to write to a tabular data document.TabularDataReader::firstto replaceTabularDataReader::fetchOneTabularDataReader::nthto replaceTabularDataReader::fetchOneCharsetConverter::addBOMSkippingToto improve BOM skipping see bug #483
TabularDataReader::fetchOne
-
Stream::createFromResource -
Stream::__constructis 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
seekusage and `#75917 requires PHP8.1.2 -
Remove internal usage of deprecated methods
Stream::fwriteThe class is already marked as internal so BC break does not apply on it.Stream::fgetsThe 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
$eolargument
9.8.0 - 2022-01-04
- Added PHP7.4 typed properties where applicable
TabularDataReader::fetchColumnByNameto replaceTabularDataReader::fetchColumnTabularDataReader::fetchColumnByOffsetto replaceTabularDataReader::fetchColumn
TabularDataReader::fetchColumnuseTabularDataReader::fetchColumnByOffsetorTabularDataReader::fetchColumnByNameinstead
AbstractCsvconstructor 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
EmptyEscapeParserPolyfill used inReaderclass - Remove PHP7.4 polyfill features in
Writerclass
9.7.4 - 2021-11-30
- None
- None
- Bug fix
EscapeFormulato 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
ReturnTypeWillChangeto 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_STRINGbyFILTER_UNSAFE_RAW - PHP8.1 compliance: remove duplicated public properties declaration
- PHP8.1 compliance: add support for fputcsv
$eolargument
- 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::duplicateColumnNamesto expose column name duplicates during header usageLeague\Csv\UnableToProcessCsvas the new Exception Marker InterfaceLeague\Csv\UnavailableStreamas the new ExceptionLeague\Csv\Info::getDelimiterStatsto replace the namespace functiondelimiter_detectLeague\Csv\Info::fetchBOMSequenceto replace the namespace functionbom_matchLeague\Csv\AbstractCsv::toStringto replaceLeague\Csv\AbstractCsv::getContentandLeague\Csv\AbstractCsv::__toStringLeague\Csv\XMLConverter::createto replaceLeague\Csv\XMLConverter::__constructLeague\Csv\HTMLConverter::createto replaceLeague\Csv\HTMLConverter::__constructLeague\Csv\AbstractCsv::supportsStreamFilterOnReadandLeague\Csv\AbstractCsv::supportsStreamFilterOnWriteto replaceLeague\Csv\AbstractCsv::supportsStreamFilterandLeague\Csv\AbstractCsv::getStreamFilterMode
League\Csv\delimiter_detectuseLeague\Csv\Info::getDelimiterStatsLeague\Csv\bom_matchuseLeague\Csv\Info::fetchBOMSequenceLeague\Csv\AbstractCsv::getContentuseLeague\Csv\AbstractCsv::toStringLeague\Csv\AbstractCsv::getStreamFilterModeuseLeague\Csv\AbstractCsv::supportsStreamFilterOnReadorLeague\Csv\AbstractCsv::supportsStreamFilterOnWriteLeague\Csv\AbstractCsv::supportsStreamFilteruseLeague\Csv\AbstractCsv::supportsStreamFilterOnReadorLeague\Csv\AbstractCsv::supportsStreamFilterOnWrite- Calling exceptions constructor, use named constructors instead.
League\Csv\XMLConverter::__constructuseLeague\Csv\XMLConverter::createLeague\Csv\HTMLConverter::__constructuseLeague\Csv\HTMLConverter::create
- Move tests into the
srcdirectory - Fixed encoder method resolver implementation
- all classes marked as
@internalare now final League\Csv\AbstractCsv::STREAM_FILTER_MODEconstant 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::createnamed constructor to ease constraint builder instantiationLeague\Csv\Statementcan now also processLeague\Csv\ResultSetinstances.League\Csv\TabularDataReaderinterface to represent how to read tabular dataLeague\Csv\ResultSet::getRecordshas an optional$headersecond argument to make the method works likeLeague\Csv\Reader::getRecordsLeague\Csv\ResultSet::createFromTabularDataReadercreate a new instance fromLeague\Csv\TabularDataReaderimplementing class.
- Nothing
League\Csv\Readerno longer uses__callto implementfetchOne,fetchPairsandfetchColumnmethods.
- 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\Exceptionexception marker class #360, #361 feature proposed and developed by Darren MillerLeague\Csv\UnavailableFeatureLeague\Csv\InvalidArgumentLeague\Csv\SyntaxError
- Nothing
- bug fix
bom_matchfunction see issue #363 resolved based on PR from Jerry Martinez - bug fix
delemiter_detectfunction 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::getRecordsreturn value.Reader::includeEmptyRecordsReader::skipEmptyRecordsReader::isEmptyRecordsIncluded
-
Adding support for controlling Input BOM usage in the library:
AbstractCsv::skipInputBOMAbstractCsv::includeInputBOMAbstractCsv::isInputBOMIncluded
- Nothing
EmptyEscapeParser::parseno longer auto skip empty records
- Nothing
9.3.0 - 2019-07-30
XMLConverter::importsee #348 thanks @kusabi- Support for
thead,tfootandtbodyinHTMLConverter::convertvia the addition of protected methodsHTMLConverter::addHTMLAttributesandHTMLConverter::appendHeaderSection#348 thanks @kusabi
- Nothing
- Internal improvement in
Readerdockblock thanks @ghobaty. - Improve strict comparison when using
preg_match. - Improve CSV control in
Stream.
- Nothing
9.2.1 - 2019-06-08
- Nothing
- Nothing
AbstractCSV::chunksee #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::getPathnamesee #321 thanks @tomkyle
League\Csv\RFC4180FielduseAbstractCSV::setEscapemethod with an empty string instead.
-
AbstractCSV::__constructcorrectly initializes properties -
AbstractCSV::createFromStringnamed constructor default argument is now an empty string -
AbstractCSV::setEscapenow accepts an empty string likefputcsvandfgetcsv -
Writer::insertOnefixes throwing exception when record can not be inserted -
XMLConverterconvert to string the record value to avoid PHP warning onnullvalue -
Internal
Stream::createFromStringnamed constructor default argument is now an empty string -
Internal
Stream::fwriteimproved -
Internal
Stream::__destructno longer emit warning on invalid stream filter removal. -
Internal
Stream::seekreturns0if the seeked position0is valid see #321 thanks @HaozhouChen -
Reader:getHeaderwhen the record is an empty line.
- Nothing
9.1.4 - 2018-05-01
- Nothing
- Nothing
Writer::setFlushThresholdshould accept 1 as an argument #289CharsetConverter::convertshould not try to convert numeric value #287
- Nothing
9.1.3 - 2018-03-12
- Nothing
- Nothing
Writer::insertOneallow 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::fetchAssocno longer throws exception because of a bug in PHP7.2+ issue #279
- None
9.1.2 - 2018-02-05
- Nothing
- Nothing
is_iterablepolyfill for PHP7.0Reader::getHeaderno 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_lastusage 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\EncloseFieldto force enclosure insertion on every field. #269League\Csv\EscapeFormulaa League CSV formatter to prevent CSV Formula Injection in Spreadsheet programs.League\Csv\RFC4180Field::addToaccept an option$replace_whitespaceargument to improve RFC4180 compliance.League\Csv\Abstract::getContentto replaceLeague\Csv\Abstract::__toString. The__toStringmethod may trigger a Fatal Error with non-seekable stream, instead you are recommended to used the newgetContentmethod which will trigger an exception instead.
League\Csv\Abstract::__toStringuseLeague\Csv\Abstract::getContentinstead. the__toStringtriggers a Fatal Error when used on a non-seekable CSV document. use thegetContentmethod 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::createFromPathdefault open mode isrsee #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::getRecordsto access all CSV recordsLeague\Csv\Statementprovides a constraint builder to select CSV records.League\Csv\ResultSetrepresents the result set of the selected CSV records.League\Csv\delimiter_detectfunction to detect CSV delimiter character
- Improved CSV document header selection.
League\Csv\Reader::getHeaderLeague\Csv\Reader::getHeaderOffsetLeague\Csv\Reader::setHeaderOffset
- Improved CSV Records conversion
League\Csv\CharsetConverterconverts CSV records charset.League\Csv\XMLConverterconverts CSV records into DOMDocumentLeague\Csv\HTMLConverterconverts CSV records into HTML table.
- Improved Exception handling
League\Csv\Exceptionthe default exceptionLeague\Csv\CannotInsertRecord
- Improved CSV document output
League\Csv\AbstractCsv::chunkmethod to output the CSV document in chunkLeague\Csv\bom_matchfunction to detect BOM sequence in a given stringLeague\Csv\ByteSequenceinterface 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::setFlushThresholdLeague\Csv\Writer::getFlushThreshold
- Improve RFC4180 compliance
League\Csv\RFC4180Fieldto format field according to RFC4180 rules
- Nothing
-
Improved CSV record insertion
League\Csv\Writer::insertOneonly accepts an array and returns a integerLeague\Csv\Writer::insertAllonly accepts an iterable of array and returns an integer
-
Normalized CSV offset returned value
League\Csv\Reader::fetchColumnalways returns the CSV document original offset.
examplesdirectoryPHP5support- 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::jsonSerializeLeague\Csv\AbstractCsv::toHTMLLeague\Csv\AbstractCsv::toXMLLeague\Csv\AbstractCsv::setInputEncodingLeague\Csv\AbstractCsv::getInputEncoding
- The following methods are removed because the PHP stream filter API is simplified:
League\Csv\AbstractCsv::isActiveStreamFilterLeague\Csv\AbstractCsv::setStreamFilterModeLeague\Csv\AbstractCsv::appendStreamFilterLeague\Csv\AbstractCsv::prependStreamFilterLeague\Csv\AbstractCsv::removeStreamFilterLeague\Csv\AbstractCsv::clearStreamFilters
- The following methods are removed because switching between connections is no longer possible:
League\Csv\AbstractCsv::newReaderLeague\Csv\AbstractCsv::newWriterLeague\Csv\Reader::getNewlineLeague\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\Statementclass: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::eachLeague\Csv\Reader::fetchLeague\Csv\Reader::fetchAllLeague\Csv\Reader::fetchAssocLeague\Csv\Reader::fetchPairsWithoutDuplicates
- Formatting and validating CSV records on insertion is simplified, the following methods are removed:
League\Csv\Writer::hasFormatterLeague\Csv\Writer::removeFormatterLeague\Csv\Writer::clearFormattersLeague\Csv\Writer::hasValidatorLeague\Csv\Writer::removeValidatorLeague\Csv\Writer::clearValidatorsLeague\Csv\Writer::getIterator
- The following Formatters and Validators classes are removed from the package:
League\Csv\Plugin\SkipNullValuesFormatterLeague\Csv\Plugin\ForbiddenNullValuesValidatorLeague\Csv\Plugin\ColumnConsistencyValidatorreplace byLeague\Csv\ColumnConsistency
League\Csv\Writerno longers implements theIteratorAggregateinterfaceLeague\Csv\AbstractCsv::fetchDelimitersOccurrenceis removed replace byLeague\Csv\delimiter_detectfunction
- None
- None
Writer::insertOnewas silently failing when inserting record in a CSV document in non-writing mode.- bug fix docblock
- None
- Nothing
- Nothing
- internal
Reader::getRowwhen using aStreamIteratorissue #213 - Removed
@deprecatedfrom selected methods issue #208
- Nothing
AbstractCsv::createFromStreamto enable working with resource stream issue #202
League\Csv\AbstractCsv::stripBomLeague\Csv\Reader::getOffsetLeague\Csv\Reader::getLimitLeague\Csv\Reader::getSortByLeague\Csv\Reader::getFilterLeague\Csv\Reader::setOffsetLeague\Csv\Reader::setLimitLeague\Csv\Reader::addSortByLeague\Csv\Reader::addFilterLeague\Csv\Reader::fetchLeague\Csv\Reader::eachLeague\Csv\Reader::fetchPairsWithoutDuplicatesLeague\Csv\Reader::fetchAssocLeague\Csv\Writer::removeFormatterLeague\Csv\Writer::hasFormatterLeague\Csv\Writer::clearFormattersLeague\Csv\Writer::removeValidatorLeague\Csv\Writer::hasValidatorLeague\Csv\Writer::clearValidatorsLeague\Csv\Writer::jsonSerializeLeague\Csv\Writer::toHTMLLeague\Csv\Writer::toXML
- Nothing
- Nothing
- Nothing
- Nothing
- BOM filtering fix issue #184
AbstractCsv::BOM_UTF32_LEvalue fixed
- Nothing
- Nothing
- Nothing
getInputBOMmethod name is now consistent everywhere in the API PR #171- preserve fileObject CSV controls commit #8a20c56
- Change
outputmethod header content-type value totext/csvPR #175
- Nothing
- The package now includes its own autoloader.
Ouput::getInputEncodingOuput::setInputEncoding
Ouput::getEncodingFromreplaced byOuput::getInputEncodingOuput::setEncodingFromreplaced byOuput::setInputEncoding
- Stream Filters are now url encoded before usage issue #72
- All internal parameters are now using the snake case format
- Nothing
Reader::fetchPairsReader::fetchPairsWithoutDuplicates
- Nothing
Reader::fetchColumnandReader::fetchAssocnow returnIteratorReader::fetchAssoccallable argument expects an indexed row using the submitted keys as its first argumentReader::fetchColumncallable argument expects the selected column value as its first argument- Default value on
setOutputBOMis removed AbstractCsv::getOutputBOMalways return a stringAbstractCsv::getInputBOMalways return a string
Controls::setFlagsControls::getFlagsControls::detectDelimiterListQueryFilter::removeFilterQueryFilter::removeSortByQueryFilter::hasFilterQueryFilter::hasSortByQueryFilter::clearFilterQueryFilter::clearSortByReader::query- The
$newlineargument fromAbstractCsv::createFromString
Reader::fetchreplacesLeague\Csv\Reader::queryfor naming consistencyControls::fetchDelimitersOccurrenceto replaceControls::detectDelimiterListthe latter gives erronous results
Controls::detectDelimiterListReader::query- The
$newlineargument fromAbstractCsv::createFromString
- Streamming feature no longer trim filter name argument issue #122
- Fix default
SplFileObjectflags usage PR #130 AbstractCsv::createFromStringno 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
SplFileObjectflags were not always applied using query filter issue #99
- Nothing
stripBOMquery filtering method to ease removing the BOM sequence when querying the CSV document.- All query filters are now accessible in the
Writerclass for conversion methods.
- Nothing
- Internal code has been updated to take into account issue #68479
setFlagson conversion methods SplFileObject default flags areSplFileObject::READ_AHEAD|SplFileObject::SKIP_EMPTYinsertOnenow takes into account the escape character when modified after the first insert.
- Nothing
- Nothing
- Nothing
setFlags:SplFileObject::DROP_NEW_LINEcan be remove usingsetFlagsmethod.
- Nothing
- A new flexible mechanism to format and validate a row before its insertion by adding
Writer::addFormatterto add a formatter to theWriterobjectWriter::removeFormatterto remove an already registered formatterWriter::hasFormatterto detect the presence of a formatterWriter::clearFormattersto clear all registered formatterWriter::addValidatorto add a validator to theWriterobjectWriter::removeValidatorto remove an already registered validatorWriter::hasValidatorto detect the presence of a validatorWriter::clearValidatorsto clear all registered validatorLeague\Csv\Exception\InvalidRowExceptionexception thrown when row validation failed
- Classes to maintain removed features from the
WriterclassLeague\Csv\Plugin\ColumnConsistencyValidatorto validate column consistency on insertionLeague\Csv\Plugin\ForbiddenNullValuesValidatorto validatenullvalue on insertionLeague\Csv\Plugin\SkipNullValuesFormatterto formatnullvalue on insertion
- Nothing
jsonSerialize,toXMLandtoHTMLoutput can be modified usingReaderquery options methods.AbstractCSV::detectDelimiterListindex keys now represents the occurrence of the found delimiter.getNewlineandsetNewlineare accessible on theReaderclass too.- the named constructor
createFromStringnow accepts the$newlinesequence 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,setEnclosureandsetEscapeare removed - Default
SplFileObjectflags value is nowSplFileObject::READ_CSV|SplFileObject::DROP_NEW_LINE - All CSV properties are now copied when using
newReaderandnewWritermethods - BOM addition on output improved by removing if found the existing BOM character
- the
AbstractCSV::outputmethod now returns the number of bytes send to the output buffer Reader::fetchColumnwill 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. WriterandReaderdefault constructor are removed from public API in favor of the named constructors.- All
Writermethods and constant related to CSV data validation and formatting before insertionWriter::getNullHandlingModeWriter::setNullHandlingModeWriter::setColumnsCountWriter::getColumnsCountWriter::autodetectColumnsCountWriter::NULL_AS_EXCEPTIONWriter::NULL_AS_EMPTYWriter::NULL_AS_SKIP_CELL
AbstractCSV::setOutputBOMAbstractCSV::getOutputBOMAbstractCSV::getInputBOM
to manage BOM character with CSV.
- Nothing
- Nothing
- Nothing
Writer::setNewline,Writer::getNewlineto control the newline sequence character added at the end of each CSV row.
- Nothing
- Nothing
- Nothing
Reader::fetchAssocnow 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
createFromPathandcreateFromFileObjectinLeague\Csv\AbstractCsvto ease CSV object instantiation detectDelimiterListinLeague\Csv\AbstractCsvto replace and remove the use ofRuntimeExceptionindetectDelimitersetEncodingFromandsetDecodingFrominLeague\Csv\AbstractCsvto replacesetEncodingandgetEncodingfor naming consistencynewWriterandnewReadermethods inLeague\Csv\AbstractCsvto replaceWriter::getReaderandReader::getWriter
- Nothing
League\Csv\Reader::eachmore strict$callableMUST returnstrue
League\Csv\AbstractCsv::detectDelimiterLeague\Csv\AbstractCsv::setEncodingandLeague\Csv\AbstractCsv::getEncodingLeague\Csv\Reader::setSortByLeague\Csv\Reader::setFilterLeague\Csv\Reader::getWriterLeague\Csv\Writer::getReaderLeague\Csv\Reader::fetchCol
League\Csv\Writer::setColumnsCount,League\Csv\Writer::getColumnsCount,League\Csv\Writer::autodetectColumnsCountto enable column consistency in writer modeLeague\Csv\Reader::fetchColumnreplacesLeague\Csv\Reader::fetchColfor naming consistency
League\Csv\Reader::fetchCol
- Nothing
- Nothing
- Nothing
- Nothing
$open_modedefaults tor+inLeague\Csv\AbstractCsvconstructors
- Nothing
League\Csv\Writer::setNullHandlingModeandLeague\Csv\Writer::getNullHandlingModeto handlenullvalue
- 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::clearSortByto improve sortingLeague\Csv\Reader::clearFilterto align extract filter capabilities to sorting capabilities
League\Csv\Reader::setSortByreplaced by a better implementation
League\Csv\Reader::setOffsetnow defaults to 0;League\Csv\Reader::setLimitnow defaults to -1;detectDelimiterbug fixes
- Nothing
League\Csv\Reader::eachto ease CSV import dataLeague\Csv\Reader::addFilter,League\Csv\Reader::removeFilter,League\Csv\Reader::hasFilterto improve extract filter capabilitiesdetectDelimitermethod toLeague\Csv\AbstractCsvto sniff CSV delimiter character.
League\Csv\Reader::setFilterreplaced by a better implementation
- Nothing
- Nothing
- Change namespace from
Bakame\CsvtoLeague\Csv
- Nothing
- Nothing
- Nothing
$open_modevalidation is done by PHP internals directly
- Nothing
toXMLmethod to transcode the CSV into a XML inBakame\Csv\AbstractCsv
toHTMLmethod bug inBakame\Csv\AbstractCsvoutputmethod accepts an optional$filenameargumentBakame\Csv\Reader::fetchColdefaults to$columnIndex = 0Bakame\Csv\Reader::fetchOnedefaults to$offset = 0
- Move from
PSR-0toPSR-4to autoload the library
Bakame\Csv\Readermethods fixedjsonSerializebug fixed
getEncodingandsetEncodingmethods toBakame\Csv\AbstractCsv
Bakame\Csv\Writer::insertOnetakes into account CSV controlstoHTMLmethod takes into account encoding
Bakame\Csv\WriterBakame\Csv\WriterandBakame\Csv\ReaderextendBakame\Csv\AbstractCsv
- Nothing
Bakame\Csv\Reader::fetchOneis no longer deprecatedBakame\Csv\Reader::fetchColno longer accepts a third parameter$strict
Bakame\Csv\Codecnow the library is composer of 2 main classesBakame\Csv\Reader::getFileBakame\Csv\Reader::fetchValueBakame\Csv\Readerno longer implements theArrayAccessinterface
Bakame\Csv\ReaderimplementsIteratorAggregateInterfaceBakame\Csv\Reader::createFromStringto create a CSV object from a raw stringBakame\Csv\Reader::queryaccept an optional$callableparameter
Bakame\Csv\Reader::getFilein favor ofBakame\Csv\Reader::getIterator
Bakame\Csv\ReaderInterfaceuseless interface
Bakame\Csv\Reader::fetch*$callableparameter is normalized to accept an arrayBakame\Csv\Reader::fetchColaccepts a third parameter$strict
Bakame\Csv\Readerimplements the following interfacesJsonSerializableandArrayAccessBakame\Csv\Reader::toHTMLto 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::queryto perform SQL like queries on the CSV content.Bakame\Csv\Codec::setFlags,Bakame\Csv\Codec::getFlags, Bakame\Csv\Codec::__construct : add an optional$flagsparameter to enable the use ofSplFileObjectconstants flags
Bakame\Csv\Reader::fetchOnereplaced byBakame\Csv\Reader::offsetGetBakame\Csv\Reader::fetchValueuseless method
Bakame\Csv\Reader::outputoutput the CSV data directly in the output bufferBakame\Csv\Reader::__toStringcan be use to echo the raw CSV
Bakame\Csv\Reader::fetchAssocwhen users keys and CSV row data don't have the same length
Bakame\Csv\ReaderInterfaceBakame\Csv\Readerclass
Bakame\Csv\Codec::loadStringreturns aBakame\Csv\ReaderobjectBakame\Csv\Codec::loadFilereturns aBakame\Csv\ReaderobjectBakame\Csv\Codec::savereturns aBakame\Csv\Readerobject
Bakame\Csv\CsvCodecclass renamedBakame\Csv\Codec
- Nothing
- Nothing
Bakame\Csv\Codec::createfrom public API
Initial Release of Bakame\Csv