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

Prefer is_file() #6025

Merged
merged 1 commit into from
May 25, 2022
Merged

Prefer is_file() #6025

merged 1 commit into from
May 25, 2022

Conversation

MGatner
Copy link
Member

@MGatner MGatner commented May 24, 2022

Description
file_exists() will confirm hit on any system object (e.g. directory) as well as being less efficient. This switches to is_file() wherever relevant.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@MGatner MGatner changed the title Prefer is_file Prefer is_file() May 24, 2022
@datamweb
Copy link
Contributor

datamweb commented May 24, 2022

@MGatner I know not related to these PR.
But I can ask you to check filesystem as well.
I believe the return of the folder name does not make sense.

output :

Array
(
    [0] => 20220524212815_backup_files.zip
    [1] => folderName
    [2] => folderName\20220524212814_backup_files.zip
)

Output what I expect:

Array
(
    [0] => 20220524212815_backup_files.zip
    [1] => folderName\20220524212814_backup_files.zip
)

Oh! This problem is solved by adding option$includeDir.

@kenjis kenjis added the refactor Pull requests that refactor code label May 25, 2022
@MGatner MGatner merged commit ec7311b into codeigniter4:develop May 25, 2022
@MGatner MGatner deleted the is-file branch May 25, 2022 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Pull requests that refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants