-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that process isolation works with PHP 8.3 #5356
Comments
Identified the change in PHP 8.3 that causes this using |
Huh, I certainly did not expect BC breaks from that change. I see that you override STDOUT and STDERR if they're not defined yet: if (!defined('STDOUT')) {
define('STDOUT', fopen('php://temp', 'w+b'));
define('STDERR', fopen('php://stderr', 'wb'));
} But since we now always define those, this breaks. As a side note I found that the following breaks even in current versions of PHP: $f = fopen("php://stdout", "w");
fwrite($f, "abc");
fclose($f); As for a solution I see three options:
Let me know what you think. cc @iluuu1994 |
I think we should avoid options with very rare use-cases.
This does sound like a more robust solution. The fact that these FD constants were missing seems more like an oversight, rather than a conscious design decision. @sebastianbergmann WDYT? Can you trivially change this? If this causes issues for you, then of course reverting this is no problem. |
All the more reason then to reimplement process isolation (#5290). Thanks! |
I discussed this with @theseer today and we came to the following conclusions:
|
In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process. This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`. This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory. PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used. References: - sebastianbergmann/phpunit#5356 Props desrosj, mukesh27, SergeyBiryukov, costdev. Fixes #59394. git-svn-id: https://develop.svn.wordpress.org/trunk@56622 602fd350-edb4-49c9-b593-d223f7449a82
In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process. This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`. This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory. PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used. References: - sebastianbergmann/phpunit#5356 Props desrosj, mukesh27, SergeyBiryukov, costdev. Fixes #59394. Built from https://develop.svn.wordpress.org/trunk@56622 git-svn-id: https://core.svn.wordpress.org/trunk@56134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process. This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`. This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory. PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used. References: - sebastianbergmann/phpunit#5356 Props desrosj, mukesh27, SergeyBiryukov, costdev. Fixes #59394. Built from https://develop.svn.wordpress.org/trunk@56622 git-svn-id: http://core.svn.wordpress.org/trunk@56134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process. This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`. This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory. PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used. References: - sebastianbergmann/phpunit#5356 Props desrosj, mukesh27, SergeyBiryukov, costdev. Merges [56622] to the 6.3 branch. See #59394. git-svn-id: https://develop.svn.wordpress.org/branches/6.3@56624 602fd350-edb4-49c9-b593-d223f7449a82
In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process. This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`. This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory. PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used. References: - sebastianbergmann/phpunit#5356 Props desrosj, mukesh27, SergeyBiryukov, costdev. Merges [56622] to the 6.3 branch. See #59394. Built from https://develop.svn.wordpress.org/branches/6.3@56624 git-svn-id: http://core.svn.wordpress.org/branches/6.3@56136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process. This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`. This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory. PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used. References: - sebastianbergmann/phpunit#5356 Props desrosj, mukesh27, SergeyBiryukov, costdev. Merges [56622] to the 6.2 branch. See #59394. git-svn-id: https://develop.svn.wordpress.org/branches/6.2@56625 602fd350-edb4-49c9-b593-d223f7449a82
In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process. This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`. This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory. PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used. References: - sebastianbergmann/phpunit#5356 Props desrosj, mukesh27, SergeyBiryukov, costdev. Merges [56622] to the 6.2 branch. See #59394. Built from https://develop.svn.wordpress.org/branches/6.2@56625 git-svn-id: http://core.svn.wordpress.org/branches/6.2@56137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…r` tests. In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process. This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`. This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory. PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used. References: - sebastianbergmann/phpunit#5356 WP:Props desrosj, mukesh27, SergeyBiryukov, costdev. Fixes https://core.trac.wordpress.org/ticket/59394. --- Merges https://core.trac.wordpress.org/changeset/56622 / WordPress/wordpress-develop@7d96189ba1 to ClassicPress.
In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process. This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`. This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory. PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used. References: - sebastianbergmann/phpunit#5356 WP:Props desrosj, mukesh27, SergeyBiryukov, costdev. Fixes https://core.trac.wordpress.org/ticket/59394. --- Merges https://core.trac.wordpress.org/changeset/56622 / WordPress/wordpress-develop@7d96189ba1 to ClassicPress. Co-authored-by: Colin Stewart <[email protected]>
* Update nav-menu.js Improve feedback for accessibility when moving items in nav menu * Use localized strings in nav-menu.js * Add new localized strings to nav-menus.php Adds new localized strings to `nav-menus.php` to make them available in `nav-menu.js` * Renovate[bot]: Update dependency rollup to v3.29.2 (#211) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Renovate[bot]: Update dependency grunt-contrib-qunit to v8.0.1 (#212) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * JS Coding standards fixes * Update common.css Removes CSS that's no longer needed because of previous commits, and adds new CSS to make the nav menu page more accessible. * Renovate[bot]: Update dependency postcss to v8.4.30 (#215) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update common.css Changes `focus-within` to use `outline` instead of `border` * Update nav-menu.js After some testing, I have found that merely adding `setTimeout` in itself creates enough of a delay to enable the correct message to be generated. There is no need to set a value greater than 0. * WP-r56622: Add `sys_get_temp_dir()` to `open_basedir` tests. (#218) In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process. This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`. This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory. PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used. References: - sebastianbergmann/phpunit#5356 WP:Props desrosj, mukesh27, SergeyBiryukov, costdev. Fixes https://core.trac.wordpress.org/ticket/59394. --- Merges https://core.trac.wordpress.org/changeset/56622 / WordPress/wordpress-develop@7d96189ba1 to ClassicPress. Co-authored-by: Colin Stewart <[email protected]> * Renovate[bot]: Update dependency node to v18.18.0 (#216) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update nav-menu.js Improve feedback for accessibility when moving items in nav menu * Use localized strings in nav-menu.js * Add new localized strings to nav-menus.php Adds new localized strings to `nav-menus.php` to make them available in `nav-menu.js` * JS Coding standards fixes * Update common.css Removes CSS that's no longer needed because of previous commits, and adds new CSS to make the nav menu page more accessible. * Update common.css Changes `focus-within` to use `outline` instead of `border` * Update nav-menu.js After some testing, I have found that merely adding `setTimeout` in itself creates enough of a delay to enable the correct message to be generated. There is no need to set a value greater than 0. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: mattyrob <[email protected]> Co-authored-by: Colin Stewart <[email protected]>
In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process. This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`. This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory. PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used. References: - sebastianbergmann/phpunit#5356 Props desrosj, mukesh27, SergeyBiryukov, costdev. Fixes #59394. git-svn-id: https://develop.svn.wordpress.org/trunk@56622 602fd350-edb4-49c9-b593-d223f7449a82
* Adds details and summary elements to post metaboxes and dashboard widgets This enhances accessibility for post metaboxes and dashboard widgets and enables them to be toggled open and closed without JavaScript. * Update edit.css Ensures that post metaboxes and dashboard widgets look the same as before the use of details and summary elements. * Update common.css Enures that post metaboxes and dashboard widgets look the same as before the use of details and summary elements. * Update postbox.js Ensures that open/closed state of post metaboxes and dashboard widgets is preserved across page loads. Before it was based on the presence or otherwise of the class "closed"; now it is dependent on the presence or otherwise of the attribute "open". * Update sortable.js Sortable widgets in the CP backend currently rely on jQuery UI. While it would be nice to replace that with something more modern (like SortableJS), that has to wait for another day. In the meantime, we need a fix to address the fact that the HTML5 elements `details` and `summary` were introduced after development ceased on jQuery UI. This fix simply avoids the presence of an ugly artefact when dragging and dropping a `details` element. * WP-r56622: Add `sys_get_temp_dir()` to `open_basedir` tests. (#218) In PHPUnit 10.3.5, 9.6.13 and 8.5.34, the child processes used for process isolation now use temporary files to communicate their result to the parent process. This caused a failure in some tests that set the `open_basedir` PHP directive to a value that did not include `sys_get_temp_dir()`. This adds `sys_get_temp_dir()` to the `open_basedir` value set by the tests to ensure that permission is still granted for the temporary directory. PHPUnit uses `sys_get_temp_dir()`. To ensure the result is the same, Core's `get_temp_dir()` function is not used. References: - sebastianbergmann/phpunit#5356 WP:Props desrosj, mukesh27, SergeyBiryukov, costdev. Fixes https://core.trac.wordpress.org/ticket/59394. --- Merges https://core.trac.wordpress.org/changeset/56622 / WordPress/wordpress-develop@7d96189ba1 to ClassicPress. Co-authored-by: Colin Stewart <[email protected]> * Renovate[bot]: Update dependency node to v18.18.0 (#216) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Adds details and summary elements to post metaboxes and dashboard widgets This enhances accessibility for post metaboxes and dashboard widgets and enables them to be toggled open and closed without JavaScript. * Update edit.css Ensures that post metaboxes and dashboard widgets look the same as before the use of details and summary elements. * Update common.css Enures that post metaboxes and dashboard widgets look the same as before the use of details and summary elements. * Update postbox.js Ensures that open/closed state of post metaboxes and dashboard widgets is preserved across page loads. Before it was based on the presence or otherwise of the class "closed"; now it is dependent on the presence or otherwise of the attribute "open". * Update sortable.js Sortable widgets in the CP backend currently rely on jQuery UI. While it would be nice to replace that with something more modern (like SortableJS), that has to wait for another day. In the meantime, we need a fix to address the fact that the HTML5 elements `details` and `summary` were introduced after development ceased on jQuery UI. This fix simply avoids the presence of an ugly artefact when dragging and dropping a `details` element. * PHP Coding standards * JS Coding Standards * Update common.js to address Safari's failure to respect effect of closure of details element Addresses the focusable issue mentioned in this comment: #217 (comment) This commit applies the `inert` attribute to elements within a closed `details` element. This appears to be supported by both desktop and mobile versions of Safari: see https://caniuse.com/?search=inert * Update common.css to replace details arrows via CSS so that they can also have a pointer cursor. * Update common.css to improve style of arrows * JS syntax corrections * Update common.css to make `details` marker bigger and remove the default in Safari. * Compliant CSS comment * Suggested Safari fix * Update common.css for summary header and custom marker * Update template.php to add back `h2` and `h3` tags. This responds to feedback at #217 (comment) This should also resolve the issue where clicking on the pointer icon still enabled the widget to be dragged. Dragging is now possible only where the draggable icon appears. * Update template.php to move a class to avoid causing problems on the admin menus page. * Update common.css to modify styling on admin menus page. The changes made elsewhere in the PR have an impact on the visual styling of the admin menus page. For reasons long forgotten, and as noted in this file already, that page works differently from other admin pages that use widgets. So some modifications are necessary to ensure the menus page continues to look as expected. * Update template.php to remove tabindex and enqueuing of deleted script. * Fix whitespace in wp-admin/includes/template.php --------- Co-authored-by: Matt Robinson <[email protected]> Co-authored-by: Colin Stewart <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
PHPUnit 8.5
PHPUnit 9.6
PHPUnit 10.1
The text was updated successfully, but these errors were encountered: