Skip to content

Releases: thephpleague/csv

version 9.1.0

20 Oct 08:06
Compare
Choose a tag to compare

Added

  • 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. #269
  • League\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 replace League\Csv\Abstract::__toString. The __toString method may trigger a Fatal Error with non seekable stream, instead you are recommended to used the new getContent method which will trigger an exception instead.

Deprecated

  • League\Csv\Abstract::__toString use League\Csv\Abstract::getContent instead. the __toString triggers a Fatal Error when used on a non-seekable CSV document. use the getContent method instead which will trigger an exception instead.

Fixed

  • 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 is r see #258 and #266

Removed

  • Nothing

version 9.0.1

22 Aug 06:30
Compare
Choose a tag to compare

Added

  • Nothing

Deprecated

  • Nothing

Fixed

  • CSV controls not applied when calling Writer::insertOne see issue #244

Removed

  • Nothing

version 9.0.0

18 Aug 10:37
Compare
Choose a tag to compare

Added

  • Improved CSV Records selection
    • League\Csv\Reader::getRecords to access all CSV records
    • League\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 DOMDocument
    • League\Csv\HTMLConverter converts CSV records into HTML table.
  • Improved Exception handling
    • League\Csv\Exception the default exception
    • League\Csv\CannotInsertRecord
  • Improved CSV document output
    • League\Csv\AbstractCsv::chunk method to output the CSV document in chunk
    • League\Csv\bom_match function to detect BOM sequence in a given string
    • League\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

Deprecated

  • Nothing

Fixed

  • Improved CSV record insertion

    • League\Csv\Writer::insertOne only accepts an array and returns a integer
    • League\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.

Removed

  • examples directory
  • PHP5/HHVM support
  • 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::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;
  • The following methods are removed as CSV records selection 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
  • The following Formatters and Validators classes are removed from the package:
    • League\Csv\Plugin\SkipNullValuesFormatter
    • League\Csv\Plugin\ForbiddenNullValuesValidator
    • League\Csv\Plugin\ColumnConsistencyValidator replace by League\Csv\ColumnConsistency
  • League\Csv\Writer no longers implements the IteratorAggregate interface
  • League\Csv\AbstractCsv::fetchDelimitersOccurrence is removed replace by League\Csv\delimiter_detect function

version 8.2.2

12 Jul 07:26
Compare
Choose a tag to compare

Added

  • None

Deprecated

  • None

Fixed

  • Writer::insertOne was silently failing when inserting record in a CSV document in non-writing mode.
  • bug fix docblock

Removed

  • None

version 8.2.1

23 Feb 08:55
Compare
Choose a tag to compare

Added

  • None

Deprecated

  • None

Fixed

  • internal Reader::getRow when using a StreamIterator issue #213
  • Removed @deprecated from selected methods issue #208

Removed

  • None

version 8.2.0

25 Jan 13:34
Compare
Choose a tag to compare

Added

  • AbstractCsv::createFromStream to enable working with resource stream issue #202

Deprecated

  • 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

Fixed

  • None

Removed

  • None

version 8.1.2

27 Oct 11:27
Compare
Choose a tag to compare

Added

  • None

Deprecated

  • None

Fixed

  • BOM filtering fix issue #184
  • AbstractCsv::BOM_UTF32_LE value fixed

Removed

  • None

version 8.1.1

05 Sep 09:02
Compare
Choose a tag to compare

Fixed

  • 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 to text/csv PR #175

version 8.1.0

30 May 10:45
Compare
Choose a tag to compare

Added

  • The package now includes its own autoloader.
  • Ouput::getInputEncoding
  • Ouput::setInputEncoding

Deprecated

  • Ouput::getEncodingFrom replaced by Ouput::getInputEncoding
  • Ouput::setEncodingFrom replaced by Ouput::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

11 Dec 10:39
Compare
Choose a tag to compare

Added

  • Reader::fetchPairs
  • Reader::fetchPairsWithoutDuplicates

Deprecated

  • None

Fixed

  • Reader::fetchColumn and Reader::fetchAssoc now return Iterator
  • Reader::fetchAssoc callable argument expects an indexed row using the submitted keys as its first argument
  • Reader::fetchColumn callable argument expects the selected column value as its first argument
  • Default value on setOutputBOM is removed
  • AbstractCsv::getOutputBOM always return a string
  • AbstractCsv::getInputBOM always return a string

Removed

  • Controls::setFlags
  • Controls::getFlags
  • Controls::detectDelimiterList
  • QueryFilter::removeFilter
  • QueryFilter::removeSortBy
  • QueryFilter::hasFilter
  • QueryFilter::hasSortBy
  • QueryFilter::clearFilter
  • QueryFilter::clearSortBy
  • Reader::query
  • The $newline argument from AbstractCsv::createFromString

Please refers to the documentation or the library CHANGELOG for more details and a complete list of changes