Bug #65052
closedNamespaces need escaping
0%
Description
One example:
PHP Fatal error: Call to undefined function TYPO3\\CMS\\Core\\Log\\Writer\\is_resource() in [...]/typo3_src/typo3/sysext/core/Classes/Log/Writer/FileWriter.php on line 141
There are a lot of functions in that file that need namespace escaping (fclose, unset, file_exists). Maybe the other files need to be checked, too.
Files
Updated by Mathias Schreiber almost 10 years ago
- Status changed from New to Needs Feedback
- Assignee set to Mathias Schreiber
Hi Ben,
do you have the same issue on master?
Updated by Ben Reuter almost 10 years ago
Mathias Schreiber wrote:
Hi Ben,
do you have the same issue on master?
Hi Mathias,
thank you for your quick answer.
The problem occurs on a system where we updated from 4.7 to 6.2.8 where we saw the error messages in the log files while working on another issue.
Is there another way to get rid of those errors? I just checked out the master from git and I see no difference in the code mentioned above.
Updated by Mathias Schreiber almost 10 years ago
tbh I have no explanation for the errors.
If any PHP function that us run within a namespaced class needed to be escaped pretty much all PHP code worldwide must crash.
Which PHP Version do you run?
Updated by Helmut Hummel almost 10 years ago
There is no need to specify functions fully qualified if they do not exist in the current namespace. PHP automatically resolves the function in the global namespace.
http://php.net/manual/en/language.namespaces.fallback.php
This is why I assume your PHP version/ installation is kind of messed up, as the global function is_resource seems to be unavailable.
Updated by Ben Reuter almost 10 years ago
Well, this is a little embarassing.
It seems there is something wrong with the PHP installation on the server (version 5.3.29-1~dotdeb.0).
I wrote a little tool in PHP a few months ago and I've had a similar problem, but escaping with a backslash worked in that case.
Based on that I assumed that we'd have the same problem here.
My access to the particular server is limited, but I'll have a look what we can do about it.
Thank you for your quick help!
p.s.:
This issue can be closed, I just learned that I can't do that myself ;)
Updated by Mathias Schreiber almost 10 years ago
- Status changed from Needs Feedback to Closed
Issue?
What issue?
I didn't see no issue.
Updated by Mathias Schreiber almost 10 years ago
- File 59274824.jpg 59274824.jpg added
Updated by Stefanos Karasavvidis almost 10 years ago
I get the same error and I work on a ubuntu 14.04 installation.
PHP Fatal error: Call to undefined function TYPO3\CMS\Core\Log\Writer\is_resource() in .....typo3_src-6.2.9/typo3/sysext/core/Classes/Log/Writer/FileWriter.php on line 141
php --version
PHP 5.5.9-1ubuntu4.5 (cli) (built: Oct 29 2014 11:59:42)
I don't think that I 've "touched" anything special in my PHP settings.