Release Notes
These are the release notes from Csv. We’ve tried to cover all changes, including backward compatible breaks from 5.0 through to the current stable release. If we’ve missed anything, feel free to create an issue, or send a pull request.
version 9.27.1 - 2025-10-25
Added
- None
Deprecated
- None
Fixed
AbstractCsv::downloadimproved implementation see #569
Remove
- None
version 9.27.0 - 2025-10-16
Added
AbstractCsv::fromandAbstractCsv::fromStringto simplify instantiatingReaderandWriterinstance.Stream::fromandStream::fromStringto simplify internal instantiation ofStreaminstances.
Deprecated
AbstractCsv::createFromStringuseAbstractCsv::fromStringinsteadAbstractCsv::createFromStreamuseAbstractCsv::frominsteadAbstractCsv::createFromFileObjectuseAbstractCsv::frominsteadStream::createFromResourceuseStream::frominsteadStream::createFromStringuseStream::fromStringinstead
Fixed
- `None
Remove
- None
version 9.26.0 - 2025-10-01
Added
JsonFormat::NdJsonHeaderandJsonFormat::NdJsonHeaderLessJsonConverterconversion methods accept an optional$headerparameter to handle the new JSON formats.Writer::insertAlland converter classesconvertmethods now acceptTabularDataandTabularDataProviderimplementing classes
Deprecated
- None
Fixed
- 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.
Remove
- None
version 9.25.0 - 2025-09-11
Added
JsonFormatEnum to allow exporting to JsonLines with theJsonConverterobject.TabularDataProviderinterface to allow connecting to the package features without implementing all the methods.
Deprecated
- None
Fixed
- Fix test around equality, PHPUnit and closures #568
- Added support for
PHP8.5in github actions - Ensure
DOMDocument::createTextNode()receives a string #567 by serpentblade
Remove
- None
version 9.24.1 - 2025-06-25
Added
- None
Deprecated
- None
Fixed
Remove
- None
version 9.24.0 - 2025-06-24
Added
TabularData::lastandTabularData::lastAsObject
Deprecated
- None
Fixed
- Improved implementation for
AbstractCsv::downloadmethod
Remove
- None
version 9.23.0 - 2025-03-28
Added
TypeCastingInfoto improve error message when type casting fails during denormalization #561
Deprecated
fetchColumnByOffsetandfetchColumnByNameusefetchColumninstead.
Fixed
- Test suite around header testing using Xdebug functions #559
Remove
- None
version 9.22.0 - 2025-02-28
Added
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
Deprecated
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
Fixed
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.
Removed
- None
version 9.21.0 - 2025-01-08
Added
TabularDataReader::mapmethod.StreamFilterclassCallbackStreamFilterclassAbstractCsv::appendStreamFilterOnReadAbstractCsv::appendStreamFilterOnWriteAbstractCsv::prependStreamFilterOnReadAbstractCsv::prependStreamFilterOnWriteStream::getModereturns the underlying stream mode; internal codebase.
Deprecated
AbstractCsv::addStreamFilteruseAbstractCsv::appendStreamFilterOnReadorAbstractCsv::appendStreamFilterOnWriteinstead.
Fixed
- Improve
CharsetConverterandSwapDelimiterinternal code. - Fix
supportStreamFilterOnReadandsupportStreamFilterOnWriteto expose the document real stream filter capabilities.
Removed
- None
version 9.20.1 - 2024-12-18
Added
- None
Deprecated
- None
Fixed
Removed
- None
version 9.20.0 - 2024-12-13
Added
XMLConverter::formatterHTMLConverter::formatterWriter::encloseNoneWriter::encloseNecessaryWriter::noEnclosure
Deprecated
- None
Fixed
JsonConverter::formatternow accepts callable before onlyClosurewhere accepted.- The protected property
Writer::$enclose_allis no longer a boolean but an integer
Removed
- None
version 9.19.0 - 2024-12-08
Added
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.
Deprecated
JsonConverter::indentSize
Fixed
- Adding forgotten support for
callablein theQuery\Constraintnamespace. - Fix
HttpHeaders::forFileDownloadto be inline with RFC2183 and HTTP field name and value best practices.
Remove
- None
version 9.18.0 - 2024-10-18
Added
League\Csv\JsonConverter::chunkSizeLeague\Csv\AbstractCsv::download
Deprecated
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.
Fixed
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.
Remove
- None
version 9.17.0 - 2024-10-10
Added
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.
Deprecated
- None
Fixed
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.
Removed
leage\csv-doctrineis no longer a sub-split of the mainleague/csvpackage.
version 9.16.0 - 2024-05-24
Added
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
Deprecated
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.
Fixed
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.
Removed
- None
version 9.15.0 - 2024-02-20
Added
Statement::selectTabularDataReader::getRecordsAsObjectTabularDataReader::chunkByTabularDataReader::mapHeader
Deprecated
TabularDataReader::getObjectsuseTabularDataReader::getRecordsAsObjectinstead
Fixed
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
Removed
- None
version 9.14.0 - 2023-12-29
Added
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
Deprecated
- None
Fixed
- None
Removed
- None
version 9.13.0 - 2023-12-16
Added
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.
Deprecated
- None
Fixed
- None
Removed
- None
version 9.12.0 - 2023-12-01
Added
TabulatDataReader::valueTabulatDataReader::selectTabulatDataReader::getObjectsTabulatDataReader::matchingTabulatDataReader::matchingFirstTabulatDataReader::matchingFirstOrFailResultSet::fromRecordsStream::setMaxLineLenStream::getMaxLineLenLeague\Csv\Serializer\Denormalizerto allow denormalizing records into objects #508League\Csv\FragmentFinderto implement RFC7111
Deprecated
- 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.
Fixed
- 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.
Removed
- None
version 9.11.0 - 2023-09-23
Added
EscapeFormula::unescapeRecorddoes the opposite ofEscapeFormula::escapeRecordTabularReader::eachTabularReader::existsTabularReader::reduceTabularReader::filterTabularReader::sliceTabularReader::sortedReader::addFormatter
All the methods from the TabularReader interface are implemented on the Reader and the ResultSet objects.
Deprecated
EscapeFormula::__invokeuseEscapeFormula::__escapeRecordinstead
Fixed
- None
Removed
- None
version 9.10.0 - 2023-08-04
Added
Writer::forceEnclosureandWriter::relaxEnclosureto control the presence of enclosure in the generated CSVWriter::getEndOfLineandWriter::setEndOfLine
Deprecated
EncloseFieldstream filter in favor of the newWriter::forceEnclosuremethod.Writer::getNewlineandWriter::setNewlinein favor ofWriter::getEndOfLineandWriter::setEndOfLine
Fixed
Stream::fwriteto allow writing to a file in a normalized way. Internal use.- Documentation Fixed removing unreleased documented feature by @nclavaud
Removed
- None
version 9.9.0 - 2023-03-11
Added
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
Deprecated
TabularDataReader::fetchOne
Fixed
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
Removed
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
version 9.8.0 - 2022-01-04
Added
- Added PHP7.4 typed properties where applicable
TabularDataReader::fetchColumnByNameto replaceTabularDataReader::fetchColumnTabularDataReader::fetchColumnByOffsetto replaceTabularDataReader::fetchColumn
Deprecated
TabularDataReader::fetchColumnuseTabularDataReader::fetchColumnByOffsetorTabularDataReader::fetchColumnByNameinstead
Fixed
AbstractCsvconstructor is marked final via docblock.
The method should never be extended or changed in child classes to avoid unexpected behaviour
Removed
- PHP7.3 support
- Remove internal
EmptyEscapeParserPolyfill used inReaderclass - Remove PHP7.4 polyfill features in
Writerclass
version 9.7.4 - 2021-11-30
Added
- None
Deprecated
- None
Fixed
- Bug fix
EscapeFormulato follow OWASP latest recommendation PR #452
thanks to @robertfausk and @Lehmub
Removed
- None
version 9.7.3 - 2021-11-21
Added
- None
Deprecated
- None
Fixed
- 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
Removed
- None
version 9.7.2 - 2021-10-05
Added
- None
Deprecated
- None
Fixed
- 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
Removed
- None
version 9.7.1 - 2021-04-17
Added
- None
Deprecated
- None
Fixed
- fix writer filter #421 by LosingBattle
Removed
- None
version 9.7.0 - 2021-03-26
Added
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
Deprecated
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
Fixed
- 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
Removed
- Support for PHP7.2
League\Csv\AbstractCsv::$stream_filter_mode
version 9.6.2 - 2020-12-10
Added
- Using Github actions as development tools.
Deprecated
- None
Fixed
Removed
- Removing Travis and Scrutinizr as development tools
version 9.6.1 - 2020-09-05
Added
- None
Deprecated
- None
Fixed
- BOM sequence processing fix #394
Removed
- None
version 9.6.0 - 2020-03-17
Added
- 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.
Deprecated
- Nothing
Fixed
League\Csv\Readerno longer uses__callto implementfetchOne,fetchPairsandfetchColumnmethods.
Removed
- Internal polyfill for
is_iterable - Internal polyfill for
is_nullable_int - Support for PHP7.0 and PHP7.1
version 9.5.0 - 2019-12-15
Added
- 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
Deprecated
- Nothing
Fixed
- bug fix
bom_matchfunction see issue #363 resolved based on PR from Jerry Martinez - bug fix
delemiter_detectfunction see issue #366
Removed
- Nothing
version 9.4.1 - 2019-10-17
Added
- Nothing
Deprecated
- Nothing
Fixed
Removed
- Nothing
version 9.4.0 - 2019-10-02
Added
- 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
Deprecated
- Nothing
Fixed
EmptyEscapeParser::parseno longer auto skip empty records
Removed
- Nothing
version 9.3.0 - 2019-07-30
Added
XMLConverter::importsee #348 thanks @kusabi- Support for
thead,tfootandtbodyinHTMLConverter::convertvia the addition of protected methodsHTMLConverter::addHTMLAttributesandHTMLConverter::appendHeaderSection#348 thanks @kusabi
Deprecated
- Nothing
Fixed
- Internal improvement in
Readerdockblock thanks @ghobaty. - Improve strict comparison when using
preg_match. - Improve CSV control in
Stream.
Removed
- Nothing
version 9.2.1 - 2019-06-08
Added
- Nothing
Fixed
AbstractCSV::chunksee #325 remove CSV flags from the Stream class to avoid infinite loop.- Internal improve
HTMLConverter.
Deprecated
- Nothing
Removed
- Nothing
version 9.2.0 - 2019-03-08
Added
- 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
Deprecated
League\Csv\RFC4180FielduseAbstractCSV::setEscapemethod with an empty string instead.
Fixed
AbstractCSV::__constructcorrectly initializes propertiesAbstractCSV::createFromStringnamed constructor default argument is now the empty stringAbstractCSV::setEscapenow accepts the empty string likefputcsvandfgetcsvWriter::insertOnefixes throwing exception when record can not be insertedXMLConverterconvert to string the record value to avoid PHP warning onnullvalue- Internal
Stream::createFromStringnamed constructor default argument is now the 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.
Removed
- Nothing
version 9.1.4 - 2018-05-01
Added
- Nothing
Deprecated
- Nothing
Fixed
-
Writer::setFlushThresholdshould accept 1 as an argument #289 -
CharsetConverter::convertshould not try to convert numeric value #287
Removed
- Nothing
version 9.1.3 - 2018-03-12
Added
- Nothing
Deprecated
- Nothing
Fixed
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
Removed
- Nothing
version 8.2.3 - 2018-02-06
Added
- None
Deprecated
- None
Fixed
Reader::fetchAssocno longer throws exception because of a bug in PHP7.2+ issue #279
Removed
- None
version 9.1.2 - 2018-02-05
Added
- Nothing
Deprecated
- Nothing
Fixed
is_iterablepolyfill for PHP7.0Reader::getHeaderno longer throws exception because of a bug in PHP7.2+ issue #279
Removed
- Nothing
version 9.1.1 - 2017-11-28
Added
- Nothing
Deprecated
- Nothing
Fixed
-
issue with
error_get_lastusage when using a modified PHP error handler see #254 - fixed by @csiszarattila -
Removed seekable word from Stream exception messages.
Removed
- Nothing
version 9.1.0 - 2017-10-20
Added
- 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.
Deprecated
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.
Fixed
- Bug fixes headers from
AbstractCsv::outputaccording toRFC6266#250 - Make sure the internal source still exists before closing it #251
- Make sure the
Reader::createFromPathdefault open mode isrsee #258 and #266
Removed
- Nothing
version 9.0.1 - 2017-08-22
Added
- Nothing
Deprecated
- Nothing
Fixed
- CSV controls not applied when calling Writer::insertOne see issue #244
Removed
- Nothing
version 9.0.0 - 2017-08-18
Added
- 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
Deprecated
- Nothing
Fixed
- 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.
Removed
examplesdirectoryPHP5/HHVMsupport- The following method is removed because The BOM sequence is now automatically stripped:
League\Csv\AbstractCsv::stripBOM
- All conversion methods are removed in favor of 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;
- The following methods are removed as CSV records selection 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::clearValidators
- 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
version 8.2.2 - 2017-07-12
Added
- None
Deprecated
- None
Fixed
Writer::insertOnewas silently failing when inserting record in a CSV document in non-writing mode.- bug fix docblock
Removed
- None
version 8.2.1 - 2017-02-23
Added
- None
Deprecated
- None
Fixed
- internal
Reader::getRowwhen using aStreamIteratorissue #213 - Removed
@deprecatedfrom selected methods issue #208
Removed
- None
version 8.2.0 - 2017-01-25
Added
AbstractCsv::createFromStreamto enable working with resource stream issue #202
Deprecated
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
Fixed
- None
Removed
- None
version 8.1.2 - 2016-10-27
Added
- None
Deprecated
- None
Fixed
- BOM filtering fix issue #184
AbstractCsv::BOM_UTF32_LEvalue fixed
Removed
- None
version 8.1.1 - 2016-09-05
Fixed
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
version 8.1.0 - 2016-05-30
Added
- The package now includes its own autoloader.
Ouput::getInputEncodingOuput::setInputEncoding
Deprecated
Ouput::getEncodingFromreplaced byOuput::getInputEncodingOuput::setEncodingFromreplaced byOuput::setInputEncoding
Fixed
- Stream Filters are now url encoded before usage issue #72
- All internal parameters are now using the snake case format
version 8.0.0 - 2015-12-11
Added
Reader::fetchPairsReader::fetchPairsWithoutDuplicates
Deprecated
- None
Fixed
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
Removed
Controls::setFlagsControls::getFlagsControls::detectDelimiterListQueryFilter::removeFilterQueryFilter::removeSortByQueryFilter::hasFilterQueryFilter::hasSortByQueryFilter::clearFilterQueryFilter::clearSortByReader::query- The
$newlineargument fromAbstractCsv::createFromString
Please refers to the documentation or the library CHANGELOG for more details and a complete list of changes
version 7.2.0 - 2015-11-02
Added
Reader::fetchreplacesLeague\Csv\Reader::queryfor naming consistencyControls::fetchDelimitersOccurrenceto replaceControls::detectDelimiterListthe latter gives erronous results
Deprecated
Controls::detectDelimiterListReader::query- The
$newlineargument fromAbstractCsv::createFromStringis deprecated
Fixed
- 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
Removed
- Nothing
Please refers to the documentation or the library CHANGELOG for more details and a complete list of changes
version 7.1.2 - 2015-06-10
Fixed
- Enclosures should be removed when a BOM sequence is stripped bug fix #102
Please refers to the documentation or the library CHANGELOG for more details and a complete list of changes
version 7.1.1 - 2015-05-21
Fixed
SplFileObjectflags were not always applied using query filter bug fix #99
Please refers to the documentation or the library CHANGELOG for more details and a complete list of changes
version 7.1.0 - 2015-05-06
Added
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.
Fixed
- code has been updated to take into account bug fix #68479
Please refers to the documentation or the library CHANGELOG for more details and a complete list of changes
version 7.0.1 - 2015-03-23
Fixed
setFlags:SplFileObject::DROP_NEW_LINEcan be remove usingsetFlagsmethod.
Please refers to the documentation or the library CHANGELOG for more details and a complete list of changes
version 7.0.0 - 2015-02-19
Added
- A new flexible mechanism to format and validate a row before its insertion by adding
Fixed
jsonSerialize,toXMLandtoHTMLoutput can be modified usingReaderquery options methods. #66detectDelimiterListindex keys now represents the occurrence of the found delimiter.- the named constructor
createFromStringnow accepts the$newlinesequence as a second argument. - Default
SplFileObjectflags value is nowSplFileObject::READ_CSV|SplFileObject::DROP_NEW_LINE - All CSV properties are now copied when using
newReaderandnewWritermethods
Removed
ini_set("auto_detect_line_endings", true);setting 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 insertion.
Please refers to the documentation or the library CHANGELOG for more details and a complete list of changes
version 6.3.0 - 2015-01-21
Added AbstractCSV::getInputBOM , AbstractCSV::getOutputBOM, AbstractCSV::setOutputBOM methods to control the BOM character added at the top of each CSV.
Please refers to the documentation or the library CHANGELOG for more details.
version 6.2.0 - 2014-12-12
Added Writer::setNewline , Writer::getNewline to control the newline sequence characters added at the end of each inserted CSV row.
Please refers to the documentation or the library CHANGELOG for more details
version 6.1.0 - 2014-12-08
Added
Reader::fetchAssocnow also accepts an integer as first argument representing a row index.
version 6.0.1 - 2014-11-12
- bug fix
AbstractCsv::detectDelimiterList
version 6.0.0 - 2014-08-28
New API
- Stream Filter API added to enable the use of PHP stream filters on CSV objects.
New Methods
- To simplify CSV objects instantiation new named constructors are added
League\Csv\AbstractCsv::createFromPathandLeague\Csv\AbstractCsv::createFromFileObject - New methods allow creating CSV objects from already created CSV objects:
League\Csv\AbstractCsv::newWriterandLeague\Csv\AbstractCsv::newReadermethods can be call on both classes
Bug Fixes
League\Csv\Reader::eachis now more strict$callableMUST returns true
Removed Methods
League\Csv\AbstractCsv::detectDelimiterreplaced byLeague\Csv\AbstractCsv::detectDelimiterListLeague\Csv\AbstractCsv::set/getEncodingreplaced byLeague\Csv\AbstractCsv::set/getEncodingFromLeague\Csv\Reader::getWriterreplaced byLeague\Csv\AbstractCsv::newWriterLeague\Csv\Writer::getReaderreplaced byLeague\Csv\AbstractCsv::newReaderLeague\Csv\Reader::setSortBydeprecated since version 5.2League\Csv\Reader::setFilterdeprecated since version 5.1
Miscellaneous
- Since
HHVM 3.2+supports PHPFilterCallbackIterator, the library now works on HHVM. - Code quality improved
- Adding a changelog to the library
Please refers to the documentation or the library CHANGELOG for more details
version 5.4.0 - 2014-04-17
New Methods
the \League\Csv\Writer class gets 3 new methods to deal with issue #34
Writer::setColumnsCountWriter::getColumnsCountWriter::autodetectColumnsCount
To deal with column consistency check when inserting rows.
Deprecated Method
the \League\Csv\Reader::fetchCol method is renamed the \League\Csv\fetchColumn. The old method remains as a alias of the new method but will be remove on the next major version release. The change is made to add consistency with the new Writer methods.
Please refers to the documentation to see how the new methods work.
version 5.3.1 - 2014-04-10
- bug fixes in
League\Csv\AbstractCSV - internal code refactoring
- now
League\Csv\ReaderandLeague\Csv\Writerclass both use ther+$open_modeby default
version 5.3.0 - 2014-03-24
New methods
Writer::setNullHandlingMode and Writer::getNullHandlingMode to better handle null insertion and/or conversion into a CSV field data #28
Bug fix
You don’t need to set the ini_set("auto_detect_line_endings", true); anymore has the library will automatically do it for you. It is needed to be correctly work with a CSV built on a OSX machines.
This version features also internal code improvements.
Please refers to the official documentation for a full explication on the new features.
version 5.2.0 - 2014-03-13
New methods
Reader::addSortBy,Reader::removeSortBy,Reader::hasSortBy,Reader::clearSortByto enhance sorting capabilities #12Reader::clearFilterto enhance filtering capabilities #11
Improved Methods
Reader::setOffsetnow default to0;Reader::setLimitnow default to-1;
Bug fix
AbstractCsv::detectDelimiter#16
Deprecated methods
Reader::setSortByis deprecated and will be remove in the next major release. The method is now an alias ofReader::addSortBy. #12
Please review the documentation for more details on how to use these new features
version 5.1.0 - 2014-03-11
New methods
Reader::eachto apply a callable to each CSV rowReader::addFilter,Reader::removeFilter,Reader::hasFilterto enhance filtering capabilitiesReader::detectDelimiterandWriter::detectDelimiterto ease working with unknown CSV data
Deprecated methods
Reader::setFilteris deprecated and will be remove in the next major release. The method is now an alias ofReader::addFilter.
Please review the documentation for more details on how to use these new features
version 5.0.0 - 2014-02-28
- Updated to reflect new GitHub username (changed from
nyamsprodtothephpleague). - Updated to reflect new namespace (changed from
BakametoLeague).
version 4.2.1 - 2014-02-22
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 - 2014-02-17
New Trait
\Bakame\Csv\ConverterTrait to better deal with Csv conversion
New Method
\Bakame\Csv\AbstractCsv::toXMLwhich convert the Csv into aDomDocumentobject
Method improved
\Bakame\Csv\AbstractCsv::toHTML\Bakame\Csv\AbstractCsv::jsonSerialize\Bakame\Csv\AbstractCsv::outputnow can take a optional$filenameargument. When present the function will output all needed HTTP headers.\Bakame\Csv\AbstractCsv::getIteratormethod improved\Bakame\Csv\Reader::fetchColmethod now default to$columnIndex= 0\Bakame\Csv\Reader::fetchOnemethod now default to$offset= 0
version 4.1.2 - 2014-02-16
- Adding PHP 5.6 test in travis.yml
- Dropping PSR-0 in favor of PSR-4
version 4.1.1 - 2014-02-14
\Bakame\Csv\Readermethods improved\Bakame\Csv\AbstractCsv::jsonSerializemethod improved
Documentation and Examples improved
version 4.1.0 - 2014-02-07
New Methods:
\Bakame\Csv\AbstractCsv::setEncodingset the CSV encoding type\Bakame\Csv\AbstractCsv::getEncodingget the CSV encoding type
Update:
- The
\Bakame\Csv\AbstractCsv::createFromStringimproved - The
\Bakame\Csv\AbstractCsv::insertOneimproved to take into account CSV controls - The
\Bakame\Csv\AbstractCsv::toHTMLimproved to take into account the encoding type
The example directory is also rewritten with more explanations
version 4.0.0 - 2014-02-05
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::insertOneto insert one line into a CSV. - the
\Bakame\Csv\Writer::insertAllto insert many lines into a CSV.
Changed Methods:
\Bakame\Csv\Reader::fetchColno longer accept a third option$strict\Bakame\Csv\Reader::fetchOneto 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\Readerno longer implements theArrayAccessinterface\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 - 2014-01-28
New Traits
The Library is restructured and Traits are placed in their own subdirectory
\Bakame\Csv\Traits\CsvControlsto set/get Csv controls flags\Bakame\Csv\Traits\CsvOutputto output in different forms the CSV
New Interfaces:
- The
\Bakame\Csv\Readerimplements theIteratorAggregateInterface
New Methods:
\Bakame\Csv\Reader::createFromStringthis static function returns a new\Bakame\Csv\Readerobject from a string- The
\Bakame\Csv\Reader::getIteratoris introduce and will replace\Bakame\Csv\Reader::getFile
Update:
- The
\Bakame\Csv\Reader::queryhas a new optional parameter$callableformat the given iterator rows - The
\Bakame\Csv\Reader::fetch*$callableparameter is now normalized to accept an array - The
\Bakame\Csv\Reader::fetchColnow accept a third option$strictwhich is a boolean. By default$strictis false and the method behaviour remained the same. If$strictis true, the method will filter out the rows that do not contain the specified column index.
Deprecated
- The
\Bakame\Csv\Reader::getFileis deprecated and is to be remove in the next major point release
Removed
- The
\Bakame\Csv\ReaderInterfaceis removed as it was useless
version 3.2.0 - 2014-01-16
New Interfaces:
- The
\Bakame\Csv\Readerimplements theJsonSerializableInterface - The
\Bakame\Csv\Readerimplements theArrayAccessInterface
New Methods:
\Bakame\Csv\Reader::toHTMLreturns the CSV as a html table\Bakame\Csv\Reader::setFilteradds filtering capabilities to\Bakame\Csv\Reader\Bakame\Csv\Reader::setSortByadds sorting capabilities to\Bakame\Csv\Reader\Bakame\Csv\Reader::setOffsetand\Bakame\Csv\Reader::setLimitadd limiting capabilities to\Bakame\Csv\Reader\Bakame\Csv\Reader::queryadds manual filtering capabilities- The
\Bakame\Csv\Codecadds setter and getter methods for the$flagsproperty.
Update:
- The
\Bakame\Csv\Codecconstructor has a new optional parameter$flagsto set thesplFileObjectflag property
Deprecated
- The
\Bakame\Csv\Reader::fetchOneand\Bakame\Csv\Reader::fetchValueare deprecated and are to be remove in the next major point release
version 3.1.0 - 2014-01-14
New Methods:
- The
\Bakame\Csv\Reader::outputoutput the CSV data directly in the output buffer - The
\Bakame\Csv\Reader::__toStringcan be use to echo the raw CSV
Update:
- The
\Bakame\Csv\Reader::fetch*methods arguments are better validated
version 3.0.1 - 2014-01-10
- Fix Bug on
Bakame\Csv\Reader::fetchAssocwhen users keys and CSV row data don’t have the same length.
version 3.0.0 - 2014-01-10
- A new Class
\Bakame\Csv\Readeris introduced to ease CSV data reading. - The
\Bakame\Csv\Codec::loadStringnow return a\Bakame\Csv\Readerobject - The
\Bakame\Csv\Codec::loadFilenow return a\Bakame\Csv\Readerobject - The
\Bakame\Csv\Codec::savenow return a\Bakame\Csv\Readerobject
version 2.0.0 - 2014-01-09
- Class name changed from
\Bakame\CSV\CsvCodecto\Bakame\CSV\Codec; \Bakame\CSV\Codec::createmethod visibility changed from public to private;- Data formating prior to saving updated to simplify code maintenance;
version 1.0.0 - 2013-12-03
Initial Release for Bakame/Csv