diff --git a/ChangeLog.txt b/ChangeLog.txt index 76ae0ee..517b19f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,16 +1,76 @@ -ParseCSV dev-master +ParseCSV 1.2.0 ----------------------------------- Date: unreleased -- New function getTotalDataRowCount() - useful if - $limit is set - see pull request #122. +Breaking changes: none -- Dropped support for PHP 5.4 +New features: +- Compatible with PHP 7.4. Thanks to @andreybolonin + @morrislaptop @martijnengler and @fjf2002. +- unparse() now also understands $use_mb_convert_encoding. +- Verbal condition operators are now allowed to contain + upper case letters, for example: + $csv->conditions = 'rating IS GREATER THAN 4'; +Bug fixes: +- All filter condition operators containing "is" or "equals" + were broken. + +Code quality: +- Improved test coverage. +----------------------------------- + + +ParseCSV 1.1.1 +----------------------------------- +Date: 2-Feb-2019 + +Breaking changes: none + +New features: none + +Bug fixes: +- Function load_data: check length of input, prevents E_NOTICE + if too long. +- Fixed bugs in unparse(). + +Code quality: +- Improved test coverage. +----------------------------------- + + +ParseCSV 1.1.0 +----------------------------------- +Date: 9-Aug-2018 + +Breaking changes: +- Ignore entirely empty lines at the end of files + See https://github.com/parsecsv/parsecsv-for-php/pull/142 +- Dropped support for PHP 5.4. Now, you need at leas PHP 5.5. +- Fixed parse()'s return value: return true only if $data is useful. + +New features: - Added support for Laravel-style collections via the new getCollection() function - see https://github.com/parsecsv/parsecsv-for-php/pull/134 +- New function getTotalDataRowCount() - useful if + $limit is set - see pull request #122. +- Added requires to keep Composer-free environments working. +Bug fixes: +- Better support for streams. + See https://github.com/parsecsv/parsecsv-for-php/pull/147 +- Fixed output() with custom header. + See https://github.com/parsecsv/parsecsv-for-php/issues/132 +- Fixed bug on _validate_fields_for_unparse() if titles property + is used instead of fields parameter for changing the titles for + unparsing. +- Fixed bug in unparse() that caused incorrect column order + (Issue #41). + + +Code quality: +- Improved test coverage. ----------------------------------- diff --git a/composer.json b/composer.json index de3d7d7..ec210cb 100644 --- a/composer.json +++ b/composer.json @@ -22,8 +22,7 @@ ], "autoload": { "psr-4": { - "ParseCsv\\": "src", - "ParseCsv\\extensions\\": "src\\extensions" + "ParseCsv\\": "src" } }, "autoload-dev": { diff --git a/examples/basic.php b/examples/basic.php index 7ed355a..19fa446 100644 --- a/examples/basic.php +++ b/examples/basic.php @@ -41,7 +41,7 @@ $csv->auto('_books.csv'); background-color: #FFF; } - +
titles as $value): ?> diff --git a/examples/conditions.php b/examples/conditions.php index f085064..de69be7 100644 --- a/examples/conditions.php +++ b/examples/conditions.php @@ -17,6 +17,7 @@ $csv = new Csv(); $csv->conditions = 'author does not contain dan brown'; // $csv->conditions = 'rating < 4 OR author is John Twelve Hawks'; // $csv->conditions = 'rating > 4 AND author is Dan Brown'; +// $csv->conditions = 'rating is greater than 4'; # Parse '_books.csv' using automatic delimiter detection. @@ -42,7 +43,7 @@ $csv->auto('_books.csv'); background-color: #FFF; } -
+
titles as $value): ?> diff --git a/examples/download.php b/examples/download.php index 9babb87..60dbf01 100644 --- a/examples/download.php +++ b/examples/download.php @@ -32,5 +32,3 @@ $csv->output('books.csv'); # data to download the output as a CSV file. if it's not set # or is set to null, output will only return the generated CSV # output data, and will not output to the browser itself. - -?> diff --git a/examples/limit.php b/examples/limit.php index 4adeb0c..fb2895b 100644 --- a/examples/limit.php +++ b/examples/limit.php @@ -55,7 +55,7 @@ $csv->auto('_books.csv'); background-color: #FFF; } -
+
titles as $value): ?> diff --git a/src/Csv.php b/src/Csv.php index eee55de..ccdd9c5 100644 --- a/src/Csv.php +++ b/src/Csv.php @@ -1058,11 +1058,11 @@ class Csv { $value = $capture[3]; if ($op == 'equals' && preg_match('/^(.+) is (less|greater) than or$/i', $field, $m)) { $field = $m[1]; - $op = $m[2] == 'less' ? '<=' : '>='; + $op = strtolower($m[2]) == 'less' ? '<=' : '>='; } if ($op == 'is' && preg_match('/^(less|greater) than (.+)$/i', $value, $m)) { $value = $m[2]; - $op = $m[1] == 'less' ? '<' : '>'; + $op = strtolower($m[1]) == 'less' ? '<' : '>'; } if ($op == 'is' && preg_match('/^not (.+)$/i', $value, $m)) { $value = $m[1];