Merge pull request #185 from parsecsv/release-1.2.0

Release candidate 1.2.0
This commit is contained in:
susgo
2020-01-06 19:32:41 +01:00
committed by GitHub
7 changed files with 71 additions and 13 deletions

View File

@@ -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.
-----------------------------------

View File

@@ -22,8 +22,7 @@
],
"autoload": {
"psr-4": {
"ParseCsv\\": "src",
"ParseCsv\\extensions\\": "src\\extensions"
"ParseCsv\\": "src"
}
},
"autoload-dev": {

View File

@@ -41,7 +41,7 @@ $csv->auto('_books.csv');
background-color: #FFF;
}
</style>
<table border="0" cellspacing="1" cellpadding="3">
<table>
<tr>
<?php foreach ($csv->titles as $value): ?>
<th><?php echo $value; ?></th>

View File

@@ -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;
}
</style>
<table border="0" cellspacing="1" cellpadding="3">
<table>
<tr>
<?php foreach ($csv->titles as $value): ?>
<th><?php echo $value; ?></th>

View File

@@ -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.
?>

View File

@@ -55,7 +55,7 @@ $csv->auto('_books.csv');
background-color: #FFF;
}
</style>
<table border="0" cellspacing="1" cellpadding="3">
<table>
<tr>
<?php foreach ($csv->titles as $value): ?>
<th><?php echo $value; ?></th>

View File

@@ -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];