Skip to content
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

開発環境がPHP7.4で動くように、pecl/xdebugがPHP7系で対応しているバージョンを指定する #169

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

ShioriPeace
Copy link
Contributor

@ShioriPeace ShioriPeace commented Nov 1, 2023

現在のmasterの状態だと、pecl/xdebugの最新バージョンがPHP7.4に対応していないことが原因で、docker-compose buildを行った際にpecl/xdebug requires PHP (version >= 8.0.0, version <= 8.2.99), installed version is 7.4.33というエラーが発生し、開発環境の構築に失敗します。

ref, #167
docker-compose build を行った時の結果全文
https://gist.github.com/ShioriPeace/7e71ea98254a6726d1565bbfe4b55be0

#168 の対応を行うために、手元の環境を一時的にPHP8.2の状態にして動かしていたのですが、今度はPHP8系に挙げたことによるDeprecatedが発生しました。

Deprecated: Return type of Pimple\Container::offsetExists($id) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/wp-content/plugins/colormeshop/vendor/pimple/pimple/src/Pimple/Container.php on line 133 Call Stack: 0.0005 366512 1. {main}() /var/www/html/wp-admin/options.php:0 0.0005 367216 2. require_once('/var/www/html/wp-admin/admin.php') /var/www/html/wp-admin/options.php:19 0.0005 367784 3. require_once('/var/www/html/wp-load.php') /var/www/html/wp-admin/admin.php:34 0.0005 368576 4. require_once('/var/www/html/wp-config.php') /var/www/html/wp-load.php:50 0.0006 375760 5. require_once('/var/www/html/wp-settings.php') /var/www/html/wp-config.php:133 0.0086 1742608 6. include_once('/var/www/html/wp-content/plugins/colormeshop/colormeshop-wp-plugin.php') /var/www/html/wp-settings.php:462 0.0089 1744248 7. ColorMeShop\Plugin->__construct() /var/www/html/wp-content/plugins/colormeshop/colormeshop-wp-plugin.php:18 0.0089 1744248 8. ColorMeShop\Plugin->initialize_container() /var/www/html/wp-content/plugins/colormeshop/src/class-plugin.php:31 0.0089 1744248 9. Composer\Autoload\ClassLoader->loadClass($class = 'Pimple\\Container') /var/www/html/wp-content/plugins/colormeshop/src/class-plugin.php:279 0.0089 1744376 10. Composer\Autoload\includeFile($file = '/var/www/html/wp-content/plugins/colormeshop/vendor/composer/../pimple/pimple/src/Pimple/Container.php') /var/www/html/wp-content/plugins/colormeshop/vendor/composer/ClassLoader.php:428 0.0089 1744640 11. include('/var/www/html/wp-content/plugins/colormeshop/vendor/pimple/pimple/src/Pimple/Container.php') /var/www/html/wp-content/plugins/colormeshop/vendor/composer/ClassLoader.php:571 Deprecated: Return type of Pimple\Container::offsetGet($id) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/wp-content/plugins/colormeshop/vendor/pimple/pimple/src/Pimple/Container.php on line 98 Call Stack: 0.0005 366512 1. {main}() /var/www/html/wp-admin/options.php:0 0.0005 367216 2. require_once('/var/www/html/wp-admin/admin.php') /var/www/html/wp-admin/options.php:19 0.0005 367784 3. require_once('/var/www/html/wp-load.php') /var/www/html/wp-admin/admin.php:34 0.0005 368576 4. require_once('/var/www/html/wp-config.php') /var/www/html/wp-load.php:50 0.0006 375760 5. require_once('/var/www/html/wp-settings.php') /var/www/html/wp-config.php:133 0.0086 1742608 6. include_once('/var/www/html/wp-content/plugins/colormeshop/colormeshop-wp-plugin.php') /var/www/html/wp-settings.php:462 0.0089 1744248 7. ColorMeShop\Plugin->__construct() /var/www/html/wp-content/plugins/colormeshop/colormeshop-wp-plugin.php:18 0.0089 1744248 8. ColorMeShop\Plugin->initialize_container() /var/www/html/wp-content/plugins/colormeshop/src/class-plugin.php:31 0.0089 1744248 9. Composer\Autoload\ClassLoader->loadClass($class = 'Pimple\\Container') /var/www/html/wp-content/plugins/colormeshop/src/class-plugin.php:279 0.0089 1744376 10. Composer\Autoload\includeFile($file = '/var/www/html/wp-content/plugins/colormeshop/vendor/composer/../pimple/pimple/src/Pimple/Container.php') /var/www/html/wp-content/plugins/colormeshop/vendor/composer/ClassLoader.php:428 0.0089 1744640 11. include('/var/www/html/wp-content/plugins/colormeshop/vendor/pimple/pimple/src/Pimple/Container.php') /var/www/html/wp-content/plugins/colormeshop/vendor/composer/ClassLoader.php:571 Deprecated: Return type of Pimple\Container::offsetSet($id, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/wp-content/plugins/colormeshop/vendor/pimple/pimple/src/Pimple/Container.php on line 79 Call Stack: 0.0005 366512 1. {main}() /var/www/html/wp-admin/options.php:0 0.0005 367216 2. require_once('/var/www/html/wp-admin/admin.php') /var/www/html/wp-admin/options.php:19 0.0005 367784 3. require_once('/var/www/html/wp-load.php') /var/www/html/wp-admin/admin.php:34 0.0005 368576 4. require_once('/var/www/html/wp-config.php') /var/www/html/wp-load.php:50 0.0006 375760 5. require_once('/var/www/html/wp-settings.php') /var/www/html/wp-config.php:133 0.0086 1742608 6. include_once('/var/www/html/wp-content/plugins/colormeshop/colormeshop-wp-plugin.php') /var/www/html/wp-settings.php:462 0.0089 1744248 7. ColorMeShop\Plugin->__construct() /var/www/html/wp-content/plugins/colormeshop/colormeshop-wp-plugin.php:18 0.0089 1744248 8. ColorMeShop\Plugin->initialize_container() /var/www/html/wp-content/plugins/colormeshop/src/class-plugin.php:31 0.0089 1744248 9. Composer\Autoload\ClassLoader->loadClass($class = 'Pimple\\Container') /var/www/html/wp-content/plugins/colormeshop/src/class-plugin.php:279 0.0089 1744376 10. Composer\Autoload\includeFile($file = '/var/www/html/wp-content/plugins/colormeshop/vendor/composer/../pimple/pimple/src/Pimple/Container.php') /var/www/html/wp-content/plugins/colormeshop/vendor/composer/ClassLoader.php:428 0.0089 1744640 11. include('/var/www/html/wp-content/plugins/colormeshop/vendor/pimple/pimple/src/Pimple/Container.php') /var/www/html/wp-content/plugins/colormeshop/vendor/composer/ClassLoader.php:571 Deprecated: Return type of Pimple\Container::offsetUnset($id) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/wp-content/plugins/colormeshop/vendor/pimple/pimple/src/Pimple/Container.php on line 143 Call Stack: 0.0005 366512 1. {main}() /var/www/html/wp-admin/options.php:0 0.0005 367216 2. require_once('/var/www/html/wp-admin/admin.php') /var/www/html/wp-admin/options.php:19 0.0005 367784 3. require_once('/var/www/html/wp-load.php') /var/www/html/wp-admin/admin.php:34 0.0005 368576 4. require_once('/var/www/html/wp-config.php') /var/www/html/wp-load.php:50 0.0006 375760 5. require_once('/var/www/html/wp-settings.php') /var/www/html/wp-config.php:133 0.0086 1742608 6. include_once('/var/www/html/wp-content/plugins/colormeshop/colormeshop-wp-plugin.php') /var/www/html/wp-settings.php:462 0.0089 1744248 7. ColorMeShop\Plugin->__construct() /var/www/html/wp-content/plugins/colormeshop/colormeshop-wp-plugin.php:18 0.0089 1744248 8. ColorMeShop\Plugin->initialize_container() /var/www/html/wp-content/plugins/colormeshop/src/class-plugin.php:31 0.0089 1744248 9. Composer\Autoload\ClassLoader->loadClass($class = 'Pimple\\Container') /var/www/html/wp-content/plugins/colormeshop/src/class-plugin.php:279 0.0089 1744376 10. Composer\Autoload\includeFile($file = '/var/www/html/wp-content/plugins/colormeshop/vendor/composer/../pimple/pimple/src/Pimple/Container.php') /var/www/html/wp-content/plugins/colormeshop/vendor/composer/ClassLoader.php:428 0.0089 1744640 11. include('/var/www/html/wp-content/plugins/colormeshop/vendor/pimple/pimple/src/Pimple/Container.php') /var/www/html/wp-content/plugins/colormeshop/vendor/composer/ClassLoader.php:571 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/colormeshop/vendor/pimple/pimple/src/Pimple/Container.php:39) in /var/www/html/wp-admin/includes/misc.php on line 1431 Call Stack: 0.0005 366512 1. {main}() /var/www/html/wp-admin/options.php:0 0.0005 367216 2. require_once('/var/www/html/wp-admin/admin.php') /var/www/html/wp-admin/options.php:19 0.0693 8246696 3. do_action($hook_name = 'admin_init') /var/www/html/wp-admin/admin.php:175 0.0693 8246912 4. WP_Hook->do_action($args = [0 => '']) /var/www/html/wp-includes/plugin.php:517 0.0693 8246912 5. WP_Hook->apply_filters($value = '', $args = [0 => '']) /var/www/html/wp-includes/class-wp-hook.php:334 0.0699 8285760 6. wp_admin_headers('') /var/www/html/wp-includes/class-wp-hook.php:310 0.0699 8286080 7. header($header = 'Referrer-Policy: strict-origin-when-cross-origin') /var/www/html/wp-admin/includes/misc.php:1431 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/colormeshop/vendor/pimple/pimple/src/Pimple/Container.php:39) in /var/www/html/wp-includes/functions.php on line 6935 Call Stack: 0.0005 366512 1. {main}() /var/www/html/wp-admin/options.php:0 0.0005 367216 2. require_once('/var/www/html/wp-admin/admin.php') /var/www/html/wp-admin/options.php:19 0.0693 8246696 3. do_action($hook_name = 'admin_init') /var/www/html/wp-admin/admin.php:175 0.0693 8246912 4. WP_Hook->do_action($args = [0 => '']) /var/www/html/wp-includes/plugin.php:517 0.0693 8246912 5. WP_Hook->apply_filters($value = '', $args = [0 => '']) /var/www/html/wp-includes/class-wp-hook.php:334 0.0702 8285984 6. send_frame_options_header() /var/www/html/wp-includes/class-wp-hook.php:308 0.0702 8285984 7. header($header = 'X-Frame-Options: SAMEORIGIN') /var/www/html/wp-includes/functions.php:6935 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/colormeshop/vendor/pimple/pimple/src/Pimple/Container.php:39) in /var/www/html/wp-includes/pluggable.php on line 1435 Call Stack: 0.0005 366512 1. {main}() /var/www/html/wp-admin/options.php:0 0.0751 8292144 2. wp_redirect($location = '/wp-admin/admin.php?page=colorme_wp_settings&settings-updated=true', $status = ???, $x_redirect_by = ???) /var/www/html/wp-admin/options.php:352 0.0751 8292232 3. header($header = 'X-Redirect-By: WordPress') /var/www/html/wp-includes/pluggable.php:1435 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/colormeshop/vendor/pimple/pimple/src/Pimple/Container.php:39) in /var/www/html/wp-includes/pluggable.php on line 1438 Call Stack: 0.0005 366512 1. {main}() /var/www/html/wp-admin/options.php:0 0.0751 8292144 2. wp_redirect($location = '/wp-admin/admin.php?page=colorme_wp_settings&settings-updated=true', $status = ???, $x_redirect_by = ???) /var/www/html/wp-admin/options.php:352 0.0751 8292288 3. header($header = 'Location: /wp-admin/admin.php?page=colorme_wp_settings&settings-updated=true', $replace = TRUE, $response_code = 302) /var/www/html/wp-includes/pluggable.php:1438

上記で指摘されている内容を修正しPHP8.0系で動くように改修する動きがベストですが、#168 を直さない限り、実際にユーザーに影響が出ている状況が続いてしまうことから、APIクライアントの更新を優先するため、PHP7.4の状態で開発環境の構築が成功するようにします。

レビューポイント

このPRの変更を適用した状態で、開発環境の構築が問題なく行えるか
https://github.com/pepabo/colormeshop-wp-plugin#%E3%81%99%E3%81%90%E3%81%AB%E9%96%8B%E7%99%BA%E3%82%92%E5%A7%8B%E3%82%81%E3%82%89%E3%82%8C%E3%81%BE%E3%81%99

@ShioriPeace ShioriPeace self-assigned this Nov 1, 2023
@ShioriPeace
Copy link
Contributor Author

xdebugのバージョンを指定した結果、別のエラーが発生することなくphp7.4の状態で開発環境の構築が行えたことを確認しました。

@ShioriPeace
Copy link
Contributor Author

In WordPress 5.9: Added a dependency on the external PHPUnit Polyfills, which enabled support for PHPUnit 8 and 9, making it so the tests can now run on the most appropriate PHPUnit version for each PHP version.
https://make.wordpress.org/core/handbook/references/phpunit-compatibility-and-wordpress-versions/

PHPUnit Polyfillsが存在していない状態であることが原因でCIが失敗したので、0d3d803 にて追加しました
https://github.com/pepabo/colormeshop-wp-plugin/actions/runs/6719162776/job/18260236844

@ShioriPeace ShioriPeace marked this pull request as ready for review November 1, 2023 11:49
Copy link
Contributor

@ikaruga777 ikaruga777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙆‍♂️

@ikaruga777 ikaruga777 merged commit 25307a5 into master Nov 6, 2023
3 checks passed
@ikaruga777 ikaruga777 deleted the fix-dev-error branch November 6, 2023 05:21
milkcaramel added a commit that referenced this pull request Jan 29, 2024
下記の修正を含めます

#169
#171
#172
@milkcaramel milkcaramel mentioned this pull request Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants