#Changelog
All Notable changes to League\Csv will be documented in this file
Reader::fetchreplacesLeague\Csv\Reader::queryfor naming consistencyControls::fetchDelimitersOccurrenceto replaceControls::detectDelimiterListthe latter gives erronous results
Controls::detectDelimiterListReader::query- The
$newlineargument fromAbstractCsv::createFromStringis deprecated
- 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_modedefault 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 default to 0;League\Csv\Reader::setLimitnow default 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::fetchColdefault to$columnIndex = 0Bakame\Csv\Reader::fetchOnedefault 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