Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$reader->setTestAutodetect() not usefull when php version > 8.1 #4092

Open
7 tasks
zio-mitch opened this issue Jul 10, 2024 · 5 comments
Open
7 tasks

$reader->setTestAutodetect() not usefull when php version > 8.1 #4092

zio-mitch opened this issue Jul 10, 2024 · 5 comments

Comments

@zio-mitch
Copy link

This is:

- [x] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

To not force the user to set autodetect to false when detected php version is >= 8.1
Simply keep it to false or never set it .

What is the current behavior?

Forced to set false in order to not have problems with deprecation notices

What are the steps to reproduce?

Set true with php >= 8.1 version

<?php

require __DIR__ . '/vendor/autoload.php';

// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();

// add code that show the issue here...

If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.

What features do you think are causing the issue

  • [ x] Reader
  • Writer
  • Styles
  • Data Validations
  • Formula Calculations
  • Charts
  • AutoFilter
  • Form Elements

Does an issue affect all spreadsheet file formats? If not, which formats are affected?

any software

Which versions of PhpSpreadsheet and PHP are affected?

= 8.1

@oleibman
Copy link
Collaborator

It is useful in 8.1+ for anyone who wants to read Csv's with Mac line endings, which is admittedly a small (possibly non-existent) group. That functionality has been marked deprecated, and will disappear when Php stops supporting it, scheduled for Php9. There is no reason to prematurely create a BC break for those users. The test for auto-detect itself should not cause any problems even if you don't need it (messages are suppressed for ini_set and the setting is restored after it is processed).

@zio-mitch
Copy link
Author

No BC break for php version > 8.1 makenthe method Just a dummy and set default to false in ini-set.

@zio-mitch
Copy link
Author

I'm using this.
https://github.com/Multidialogo/php-line-endings-normalizer
No dos2unix needed.

@oleibman
Copy link
Collaborator

What is the problem you are trying to solve?

@zio-mitch
Copy link
Author

Continue using the library in my project without being forced to set false on any reader instance cosebase wide.
We are Just migrating from 7.4 to 8.2.
Since we do not use to ignore notices in our projects what's the takeaway to have a default ini set?
I understand, in order to not break retrocompat, at this point use a polyfill instead of ini set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants