定数定義に defined() ガードを追加し config.php からのオーバーライドを可能にする#1375
定数定義に defined() ガードを追加し config.php からのオーバーライドを可能にする#1375nanasess wants to merge 1 commit intoEC-CUBE:masterfrom
Conversation
mtb_constants.php(自動生成キャッシュ)および mtb_constants_init.php の 全定数に defined() ガードを追加。config.php やテスト用 bootstrap で 先に定義した定数が E_NOTICE なしで優先されるようになる。 - SC_DB_MasterData::getMasterDataAsDefine(): キャッシュ生成時に defined() ガード付きの define 文を出力するよう変更 - data/mtb_constants_init.php: 全約245定数にガード追加 - html/define.php: 2定数にガード追加(一貫性のため) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughウォークスルーPHP定数定義をガード形式に統一しました。複数ファイルの無条件な 変更内容
推定コード審査工数🎯 2 (Simple) | ⏱️ ~10分 詩
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1375 +/- ##
==========================================
- Coverage 54.42% 54.39% -0.03%
==========================================
Files 84 84
Lines 10817 10822 +5
==========================================
Hits 5887 5887
- Misses 4930 4935 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
mtb_constants.php(自動生成キャッシュ)およびmtb_constants_init.phpの全定数にdefined()ガードを追加し、config.phpやテスト用 bootstrap から定数をオーバーライド可能にする。背景
EC-CUBE2 の定数は複数ファイルから定義されるが、
defined()ガードの有無にばらつきがあった:data/config/config.phpdata/cache/mtb_constants.phpdata/mtb_constants_init.phphtml/define.phpconfig.phpでAUTH_TYPE等の mtb 定数をオーバーライドしたい場合や、テスト時に定数を差し替えたい場合に E_NOTICE が発生していた。変更内容
data/class/db/SC_DB_MasterData.phpgetMasterDataAsDefine()でキャッシュ生成時にdefined()ガード付き define 文を出力data/mtb_constants_init.phpdefined()ガード追加html/define.phpdefined()ガード追加定数の優先順位(変更後)
Test plan
defined()ガード付きで再生成されること🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート