Project

General

Profile

Actions

Bug #37946

closed

extension manager PHP warning on Windows

Added by Tomasz Krawczyk about 12 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
Code Cleanup
Target version:
-
Start date:
2012-06-12
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

On my IIS I have such warnings when I click "Check for new updates"

PHP Warning:  filemtime(): stat failed for D:/(...)/typo3temp/extensions.xml.gz in D:\(...)\typo3_src\typo3\sysext\em\classes\index.php on line 2466

Line 2466 contains instruction:

filemtime(PATH_site . 'typo3temp/extensions.xml.gz')

So, in order to avoid such messages we need to add @ operator before the filemtime function.

@filemtime(PATH_site . 'typo3temp/extensions.xml.gz')
Actions #1

Updated by Jigal van Hemert almost 12 years ago

  • Status changed from New to Needs Feedback

Is the complete path correct? The error only shows D:/(...)/typo3temp/extensions.xml.gz (part is replaced with (...)). If the complete path is incorrect the filemtime will always fail. Adding a @ will only mask the real problem.

Actions #2

Updated by Tomasz Krawczyk almost 12 years ago

Yes. Real path is correct in this warning. I masked part of the path.

What kind of problem do you suspect?

Actions #3

Updated by Martin Heinemann over 11 years ago

I get this warning message after an update of the extension list from TER.

PHP Warning: filemtime() [function.filemtime]: stat failed for /pfad/t3/typo3temp/extensions.xml.gz in /pfad/system/typo3_src-4.5.25/typo3/sysext/em/classes/index.php line 2466

The path /pfad/t3/typo3temp is correct. But there is no file extensions.xml.gz in it.
No error message has been shown after the update of the extension list.

Actions #4

Updated by Gerrit Code Review almost 11 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/21775

Actions #5

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/21776

Actions #6

Updated by Tomasz Krawczyk almost 11 years ago

Guys!

In TYPO3 4.5.29 it is solved.

The

if (is_file(PATH_site . 'typo3temp/extensions.xml.gz')) {

was added and it solves problem. I checked it with Scheduler, old and new EM. So, the bug may be closed and no patch has to be commited.

Actions #7

Updated by Jigal van Hemert almost 11 years ago

@Tomasz : I just checked the latest 4.5 source files from git and those in 4.5.29, and in both cases there were no changes regarding this issue. Are you sure you don't use some patched, custom version of 4.5.29?

Actions #8

Updated by Tomasz Krawczyk almost 11 years ago

I have correctly symlined 4.5.29. Source taken from typo3_src-4.5.29.tar.gz file. I see a block:

            } else {
                $onCLick = 'window.location.href="' . t3lib_div::linkThisScript(array(
                    'CMD[fetchMetaData]' => 'extensions'
                )) . '";return false;';
                $content .= $GLOBALS['LANG']->getLL('connect_to_ter') . '<br />
                    <input type="submit" value="' . $GLOBALS['LANG']->getLL('retrieve_update') .
                        '" onclick="' . htmlspecialchars($onCLick) . '" />';
                if (is_file(PATH_site . 'typo3temp/extensions.xml.gz')) {
                    $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
                    $timeFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
                    $content .= ' ' . sprintf($GLOBALS['LANG']->getLL('ext_list_last_updated') . ' ',
                        date(
                            $dateFormat . ', ' . $timeFormat,
                            filemtime(PATH_site . 'typo3temp/extensions.xml.gz')
                        ),
                        tx_em_Database::getExtensionCountFromRepository()
                    );
                }
            }

in ..typo3\sysext\em\classes\index.php file.

Maybe it was fixed in another issue.

Actions #9

Updated by Roman Eberle over 10 years ago

Same issue here, with TYPO3 V4.5.32, running under Linux/apache:

When I go to Extension-Manager -> "Check for extension updates", I get this notification:

PHP Warning: filemtime(): stat failed for (....)/typo3temp/extensions.xml.gz in (....)/typo3_src-4.5.32/typo3/sysext/em/classes/index.php line 2467

and

Last update of the list of extensions: 01-01-70, 01:00.

at the bottom of the page.

This seems really weird to me, because Extension Manager -> "Extension Manager" -> "Remote repository" shows:

Last Update: 13/03/2014 10:08  Extensions in repository: 6251

grepping through .../typo3/sysext/em/classes/index.php I see three lines with filemtime(),
two of which look like this:

filemtime(PATH_site . 'typo3temp/extensions.xml.gz')

and one which looks like this:

filemtime($repoUtility->getLocalExtListFile())

...so I suspect the one with getLocalExtListFile() is the correct one, and the others need to be updated.

UPDATE:
I just edited typo3/sysext/em/classes/index.php:
replacing PATH_site.'typo3temp/extensions.xml.gz' with repoUtility->getLocalExtListFile(), and adding the checks and objects needed (t3lib_div::makeInstance('tx_em_Settings'), t3lib_div::makeInstance('tx_em_Repository_Utility'), etc.).

This fixes the notification at top of page, but doesn't seem to work for the "Version information" at bottom of page.

Looks like settings-Object is empty here, no settings loaded, so no $repoUtility->setRepository($selectedRepo), and as a result no repoUtility->getLocalExtListFile().

Actions #10

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch TYPO3_4-5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21776

Actions #11

Updated by Gerrit Code Review over 9 years ago

Patch set 3 for branch TYPO3_4-5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21776

Actions #12

Updated by Jigal van Hemert over 9 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF