php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55101 Reflection tries to find symlink() and readlink() when they don't exist
Submitted: 2011-07-01 08:51 UTC Modified: 2017-10-24 08:04 UTC
From: vrana@php.net Assigned: requinix (profile)
Status: Closed Package: Reflection related
PHP Version: 5.4.0alpha1 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vrana@php.net
New email:
PHP Version: OS:

 

 [2011-07-01 08:51 UTC] vrana@php.net
Description:
------------
These two functions are available on Windows >= Vista since PHP 5.3.0. The problem is that reflection have some pointers on them even in Windows < Vista (e.g. XP) where they are not available.


Test script:
---------------
<?php
$r = new ReflectionExtension("standard");
$r->getFunctions();
?>


Expected result:
----------------
bool(false)


Actual result:
--------------
bool(false)

Warning: ReflectionExtension::getFunctions(): Internal error: Cannot find extension function readlink in global function table

Warning: ReflectionExtension::getFunctions(): Internal error: Cannot find extension function symlink in global function table


Patches

disable-functions.patch (last revision 2011-08-30 13:13 UTC by bjori@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-01 08:54 UTC] vrana@php.net
The first line of Test script should be:

var_dump(function_exists('readlink'));

It outputs bool(false) mentioned in the result.
 [2011-07-01 09:03 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2011-07-01 09:03 UTC] pajoye@php.net
They are only available in vista and later.
 [2011-07-01 09:04 UTC] pajoye@php.net
They are also dynamically available, we remove them at init time if the Windows 
version is < vista.
 [2011-07-01 09:06 UTC] pajoye@php.net
-Status: Bogus +Status: Open
 [2011-07-01 09:06 UTC] pajoye@php.net
re-open, but really not sure if it is fixable in reflexion, but there is no bug in 
these functions per se :)
 [2011-07-01 09:07 UTC] vrana@php.net
-Summary: Functions symlink() and readlink() are missing on Windows < Vista +Summary: Reflection tries to find symlink() and readlink() when they don't exist
 [2011-07-01 09:07 UTC] vrana@php.net
I know, it is even mentioned in the bug report. The problem is that Reflection doesn't know it and produces an Internal error.
 [2011-07-01 09:19 UTC] pajoye@php.net
It certainly does something nasty, can you try to figure out where pls?
 [2011-07-01 09:40 UTC] vrana@php.net
I've looked in the source codes but I didn't get a clue how is it achieved that readlink() is disabled on Windows < Vista.

I also don't see anything related at http://lxr.php.net/search?project=PHP_5_4&refs=readlink
 [2011-07-01 18:43 UTC] felipe@php.net
This specific windows disabling stuff is done at http://lxr.php.net/xref/PHP_5_4/main/main.c#php_win32_disable_functions but I think it might be handled like we treat the disable_functions INI entry at http://lxr.php.net/xref/PHP_5_4/Zend/zend_API.c#disabled_function
 [2011-08-30 13:13 UTC] bjori@php.net
The following patch has been added/updated:

Patch Name: disable-functions.patch
Revision:   1314710033
URL:        https://bugs.php.net/patch-display.php?bug=55101&patch=disable-functions.patch&revision=1314710033
 [2011-08-30 14:18 UTC] bjori@php.net
-Assigned To: +Assigned To: pajoye
 [2011-08-30 14:18 UTC] bjori@php.net
I don't have a Windows build environment.. but I believe the attached patch fixes 
this issue, and makes more sense :]

Could you verify it for me Pierre?
 [2017-10-24 07:35 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: pajoye +Assigned To:
 [2017-10-24 08:04 UTC] requinix@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: requinix
 [2017-10-24 08:04 UTC] requinix@php.net
Windows < Vista is no longer supported.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC