Bug #15970
closed
EM leaves mirror* files on failure
Added by Dmitry Dulepov over 18 years ago.
Updated over 18 years ago.
Category:
Extension Manager
Description
If EM fails to load a list of mirror, it leaves mirror* file in the typo3temp. Thus after 10 displays of "Settings" page there will be 10 empty mirror* files. Not critical but unpleasant.
This happens on RC2 code, not sure about recent CVS version.
(issue imported from #M3097)
Files
This is the code:
t3lib_div::writeFile($mfile, $mirrorsFile);
$mirrors = implode(gzfile($mfile));
t3lib_div::unlink_tempfile($mfile);
I cannot see immediately when this leaves a file behind. Do you have any further information?
No. I found this when allow_url_fopen was off and curl was disabled. I got new mirror* file each time. Here is a partial content of this folder with permissions:
beauty:~ # ls -al /srv/www/web1/web/typo3temp
total 1310
drwxrwxr-x 8 root apache 2640 Apr 3 08:52 .
drwxrwxr-x 13 root web1 752 Apr 2 18:57 ..
drwxrwxr-x 2 root apache 240 Apr 2 16:10 GB
drwxr-xr-x 250 apache apache 6000 Apr 2 14:41 cache_pages
drwxr-xr-x 2 apache apache 200 Apr 2 15:23 cs
-rw-r--r-- 1 apache apache 497699 Apr 3 08:49 extensions.bin
-rw-r--r-- 1 apache apache 485533 Apr 3 08:49 extensions.xml.gz
drwxr-xr-x 2 apache apache 16008 Apr 3 08:52 llxml
-rw------- 1 apache apache 0 Apr 2 22:41 mirrors3NsEt0
-rw------- 1 apache apache 0 Apr 2 22:32 mirrors3j9s04
-rw------- 1 apache apache 0 Apr 2 22:42 mirrors3s3oxM
-rw------- 1 apache apache 0 Apr 2 22:48 mirrors3wdsD7
-rw------- 1 apache apache 0 Apr 2 22:30 mirrorsC5qPlj
-rw------- 1 apache apache 0 Apr 2 22:48 mirrorsO5tu8x
-rw------- 1 apache apache 0 Apr 2 22:30 mirrorsaAy8YN
-rw------- 1 apache apache 0 Apr 2 22:31 mirrorscePRxO
-rw------- 1 apache apache 0 Apr 2 22:31 mirrorsd3m2lv
-rw------- 1 apache apache 0 Apr 2 22:31 mirrorslwPhUN
-rw------- 1 apache apache 0 Apr 2 22:42 mirrorspud6CP
-rw------- 1 apache apache 0 Apr 2 22:40 mirrorsscxeDU
-rw------- 1 apache apache 0 Apr 2 22:31 mirrorssjwb0D
drwxr-xr-x 2 apache apache 1456 Apr 3 06:47 pics
Ah, one never stops learning. tempnam not only returns a filename, but actually creates the file. So I needed to add another unlink call. See attached patch (which adds clearer error messages, too).
I would only change "allow_url_fopen not allowed, curl not enabled" to "allow_url_fopen is off, curl is not enabled in Install tool". Otherwise looks great! :)
The suggested change will be put into the patch.
Also available in: Atom
PDF