Actions
Feature #15208
closedBest Practice: a) Funktion Path::join() besprechen, b) cache
Status:
Closed
Priority:
Normal
Assignee:
Enis Nuredini
Target version:
-
Start date:
17.12.2022
Due date:
% Done:
0%
Estimated time:
Discuss:
Prio Planung:
No
Vote:
Description
public static function join(...$pathPartsToAppend): string { $parts = $pathPartsToAppend; // concatenate all parts (arrays are flattened) $path = ''; array_walk_recursive($parts, function ($part) use (&$path) { // filter out empty string and null arguments if (is_null($part) || $part === '') { return; } // first part added without '/' if ($path === '') { $path .= $part; } else { $part = (string)$part; $path .= ((($part[0] ?? '') === '/')?'':'/') . $part; } }); // remove multiple occurrences of '/' (but keep http://) if (preg_match('/^\w*:\/\//', $path, $match)) { $protocol = $match[0]; $path = substr($path, strlen($protocol)); } else { $protocol = ''; } $path = preg_replace('/\/{2,}/', '/', $path); return $protocol . $path; }
Files
Related issues
Updated by Carsten Rose over 1 year ago
- File clipboard-202212181109-9yaum.png clipboard-202212181109-9yaum.png added
- Subject changed from Best Practice: Funktion Path::join() besprechen to Best Practice: a) Funktion Path::join() besprechen, b) cache
- Was ist das Problem DB in in buildCacheDate zu instantieren?
- Was waere eine gutest Best Practice?
- Bei einem Report mit 100 Downloadlinks, und pro Downloadlink 5 Referenzen auf DB Records: wieviel Queries werden gefeuert wenn die Seite aufgerufen wird?
Updated by Carsten Rose over 1 year ago
Was koennte man hier besser machen?
Updated by Carsten Rose over 1 year ago
Naming System Parameter
Updated by Carsten Rose over 1 year ago
- Bei 5 Soruces wird strtotime() 5-mal aufgerufen: warum nicht $cachedFileModified einmal konvertieren?
- Was ist das Problem bei Unix-Timestamps?
Updated by Carsten Rose over 1 year ago
- Related to Feature #5715: PDF Caching added
Updated by Carsten Rose over 1 year ago
- Status changed from New to Closed
- Target version deleted (
24.11.0)
Mit PR,JH,EN besprochen
Actions