fix(back-compat): hook 橋改雙向 + alias 表修補 + 函式 shim(E1/E2/E5)
E1 雙向 hook 橋
原本只做 tmdo_* → wpdo_* 單向轉發,但核心一律 do_action('wpdo_*')
(core:69,275、custom-table-registry:110、options-manager:59),
所以任何 add_action('tmdo_after_write') 之類的新契約永遠收不到事件。
改為雙向,並以 $GLOBALS['tmdo_hook_relay_active'] 共用旗標防止
A→B→A 迴圈與 listener 重複觸發。
連帶:兩個 test bootstrap 補 do_action_ref_array() stub(單向時不會走到)。
E2 alias 表
- 刪死條目 'TMDO_Notifier'(B 沒有這個類別,此行永不生效)
- 補 'TMDO_Abstract_Notifier' => 'WPDO_Abstract_Notifier'(自訂 notifier 基底)
- trait-wpdo-anti-eav-aware-alias.php 移除與 interface-wpdo-entity-adapter-alias.php
重複的 WPDO_Entity_Adapter_Interface 宣告(composer 曾警告 Ambiguous class resolution)
E5 函式 shim:wpdo_run() / wpdo_load_textdomain() 委派到 tmdo_ 版本
unit 451 / integration 398 GREEN
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
This commit is contained in:
@@ -30,11 +30,6 @@ if ( ! trait_exists( 'WPDO_Anti_EAV_Aware', false ) && trait_exists( 'TMDO_Anti_
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! interface_exists( 'WPDO_Entity_Adapter_Interface', false ) && interface_exists( 'TMDO_Entity_Adapter_Interface', false ) ) {
|
||||
/**
|
||||
* Backward-compat alias interface. PHP allows interface inheritance, so
|
||||
* extending the new interface gives implementing classes the same
|
||||
* obligations under the old name.
|
||||
*/
|
||||
interface WPDO_Entity_Adapter_Interface extends TMDO_Entity_Adapter_Interface {}
|
||||
}
|
||||
// NOTE: WPDO_Entity_Adapter_Interface is declared in
|
||||
// back-compat/interface-wpdo-entity-adapter-alias.php — it used to be duplicated
|
||||
// here, which made composer's classmap ambiguous.
|
||||
|
||||
Reference in New Issue
Block a user