Bug #76801 [Opn->Csd]: require()ing a file blocks writing or deleting the file

From: Date: Sat, 23 Mar 2019 08:50:53 +0000
Subject: Bug #76801 [Opn->Csd]: require()ing a file blocks writing or deleting the file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220146@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76801&edit=1

 ID:                 76801
 Updated by:         krakjoe@php.net
 Reported by:        peehaa@php.net
 Summary:            require()ing a file blocks writing or deleting the
                     file
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            phpdbg
 Operating System:   Windows
 PHP Version:        7.2.9
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of alekitto@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b8b880932e95ff1e575a04a6988bc0cf00b89842
Log: fix bug #76801: phpdbg too many open files error


Previous Comments:
------------------------------------------------------------------------
[2019-03-20 08:04:06] cmb@php.net

The following pull request has been associated:

Patch Name: Close file handles and add files to included files after opening
On GitHub:  https://github.com/php/php-src/pull/3968
Patch:      https://github.com/php/php-src/pull/3968.patch

------------------------------------------------------------------------
[2019-03-20 08:03:42] cmb@php.net

The following pull request has been associated:

Patch Name: Fix bug #76801: phpdbg too many open files error
On GitHub:  https://github.com/php/php-src/pull/3965
Patch:      https://github.com/php/php-src/pull/3965.patch

------------------------------------------------------------------------
[2019-03-20 07:14:14] andrew at nicols dot co dot uk

Pull request created on https://github.com/php/php-src/pull/3968

------------------------------------------------------------------------
[2019-03-20 00:48:54] andrew at nicols dot co dot uk

Also, it's worth pointing out that the behaviour was also broken before this patch (The script
being run is not in the list of includedfiles like it is in PHP). Either way
Zend/tests/014.phpt will fail both before and after this patch when called with phpdbg.

------------------------------------------------------------------------
[2019-03-20 00:45:01] andrew at nicols dot co dot uk

I've been debugging with this further and rediscovered what I was seeing  with this patch

Using phpdbg, files which were included using include or require are not
added to the list of included files, and are then included again when include_once is
called.

Test script:
---------------
<?php

require('example.php');
print_r(get_included_files());

Expected result:
---------------
Array
(
    [0] => /private/tmp/argh/test2.php
    [1] => /private/tmp/argh/example.php
)

Actual result with PHP:
---------------
2015 nicols@boysenberry:/tmp/argh> php test2.php
Array
(
    [0] => /private/tmp/argh/test2.php
    [1] => /private/tmp/argh/example.php
)


Actual result with PHPDBG before this patch:
---------------
2011 nicols@boysenberry:/tmp/argh> phpdbg -rr test2.php
[Welcome to phpdbg, the interactive PHP debugger, v0.5.0]
To get help using phpdbg type "help" and press enter
[Please report bugs to <http://bugs.php.net/report.php>]
Array
(
    [0] => /private/tmp/argh/example.php
)

Actual result with PHPDBG after this patch:
---------------
2016 nicols@boysenberry:/tmp/argh> phpdbg -rr test2.php
[Welcome to phpdbg, the interactive PHP debugger, v0.5.0]
To get help using phpdbg type "help" and press enter
[Please report bugs to <http://bugs.php.net/report.php>]
Array
(
)


Overall effect of the proposed change:
---------------
File handles are now closed correctly
Files which have been included with include or require are not added to
the list of included files, and are re-included the first time that include_once or
require_once is called.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=76801


--
Edit this bug report at https://bugs.php.net/bug.php?id=76801&edit=1


Thread (1 message)

  • krakjoe@php.net
  • Unknown Message
    • krakjoe@php.net
« previous php.bugs (#220146) next »