Task #55052

Use file_exists() instead of is_file()

Added by Oliver Hader almost 6 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Performance
Target version:
-
Start date:
2014-01-16
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

is_file() checks whether a resource exists and whether it is actually a file.
There are several parts in the core, where it is sufficient to check for the existence only, which is faster.

Associated revisions

Revision 956c2fef (diff)
Added by Oliver Hader almost 6 years ago

[TASK] Use file_exists() instead of is_file()

is_file() checks whether a resource exists and whether it
is actually a file. There are several parts in the core,
where it is sufficient to check for the existence only,
which is faster.

Resolves: #55052
Releases: 6.2
Change-Id: I57b6d2f68dd3c1c45b603c3f194cc0c53c48e28c
Reviewed-on: https://review.typo3.org/26872
Reviewed-by: Wouter Wolters
Reviewed-by: Tom Ruether
Tested-by: Tom Ruether
Reviewed-by: Oliver Klee
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack

History

#1 Updated by Oliver Hader almost 6 years ago

  • Tracker changed from Bug to Task

#2 Updated by Gerrit Code Review almost 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26872

#3 Updated by Oliver Hader almost 6 years ago

Tests on an uncached page showed an approx. 9% better performance.
But that depends on the system, files and TypoScripts of course.

#4 Updated by Oliver Hader almost 6 years ago

Possibly there's a rewrite for TYPO3\CMS\Core\Resource\ResourceFactory::retrieveFileOrFolderObject() as well...
I'm did not test, whether is_dir() might be faster here...

#5 Updated by Oliver Hader almost 6 years ago

Oliver Hader wrote:

Possibly there's a rewrite for TYPO3\CMS\Core\Resource\ResourceFactory::retrieveFileOrFolderObject() as well...
I'm did not test, whether is_dir() might be faster here...

Obviously that does not help..

#6 Updated by Oliver Hader almost 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF