Project

General

Profile

Actions

Task #54517

closed

Replace substr() and strpos() with GeneralUtility::isFirstPartOfString when it makes sense

Added by Jo Hasenau over 10 years ago. Updated about 8 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
Category:
Performance
Target version:
Start date:
2013-12-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Sprint Focus:

Description

There a few hundred calls to strpos or substr with different parameters set, but they actually check wether a certain string is the first part of another string.

Since we got GeneralUtility::isFirstPartOfString for this task, any occurence of strpos and or substr should be replaced with that, unless it checks for another position than 0.

Additionally we should get rid of the 0 offset of the isFirstPartOfString method itself, since it decreases performance as well and is just superfluous for this task.


Files

FE-images-with-links.png (42.5 KB) FE-images-with-links.png FE-images-with-links Michiel Roos, 2014-01-30 21:13
BE-login.png (38.1 KB) BE-login.png Backend login screen Michiel Roos, 2014-01-30 21:13
db_layout_php_id_1.png (38.3 KB) db_layout_php_id_1.png db_layout?id=1 Michiel Roos, 2014-01-30 21:13
typo3_backend_php.png (37.3 KB) typo3_backend_php.png /typo3/backend.php Michiel Roos, 2014-01-30 21:13
typo3-mod.php_M-web_list_id_1.png (39.3 KB) typo3-mod.php_M-web_list_id_1.png mod.php?M=web_list&id=1 Michiel Roos, 2014-01-30 21:13
Array_Access___strpos.patch (130 KB) Array_Access___strpos.patch Michiel Roos, 2014-01-30 21:31
isFirstPartOfStr.patch (146 KB) isFirstPartOfStr.patch Michiel Roos, 2014-01-30 21:31

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Task #54085: Replace all strcmp() calls with ===Closed2013-11-29

Actions
Related to TYPO3 Core - Task #63929: Deprecate usage of GeneralUtility::isFirstPartOfStr()Rejected2014-12-16

Actions
Blocked by TYPO3 Core - Task #55445: Use array access instead of strpos($str, n, 1)Closed2014-01-29

Actions
Actions

Also available in: Atom PDF