Improvement of php://temp to add automatically prefix for debugging
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.1k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
Description
Hi,
Any php code that uses temporary files uses fopen("php://temp", "w") a lot. This function does not allow putting prefix or suffix like tempnam() . And because the first expression also deletes the file automatically at file closure, it is much more convenient.
So in the end, with a big application and lots of dependencies, there are many many temporary files in /tmp/php*. When debugging the source of these files, for example to know why there are big files, it is very difficult, and requires reading source code of the app and its dependencies, and then changing to tempnam() with a prefix, which also requires manual deleting.
Instead, is-it possible to automatically add as prefix the php file name? Example:
S3Upload.php => the fopen would generate in Linux something like /tmp/php-S3Upload.php-DOoeG
I don't think there are any negative impact, I guess?
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne am Einstiegspunkt fopen("php://temp") und vergleiche sein Verhalten mit tempnam(), insbesondere, wie Dateien unter /tmp/php* erstellt und entfernt werden. Definiere die gewünschte Präfixsemantik und verifiziere, dass die generierten Namen das Debugging verbessern, während die automatische Löschung erhalten bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, php
- Bereich
- backend
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100