Task #55052

Use file_exists() instead of is_file()

Added by Oliver Hader over 7 years ago. Updated over 2 years ago.

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

100%

Estimated time:
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.

#1

Updated by Oliver Hader over 7 years ago

  • Tracker changed from Bug to Task
#2

Updated by Gerrit Code Review over 7 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 over 7 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 over 7 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 over 7 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 over 7 years ago

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

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF