SC_ClassAutoloader が LC_Page_AbstractMypage_Ex のファイルパス解決を誤る
- Dominant language
- PHP
- Stars
- 92
- Forks
- 97
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 9
Description
変数 `$classpath`
- 解決されるパス data/class_extends/page_extends/abstractmypage/LC_Page_AbstractMypage_Ex.php
- 本来(実在)のパス data/class_extends/page_extends/mypage/LC_Page_AbstractMypage_Ex.php
クラス名を LC_Page_Mypage_Abstract_Ex とすれば、解決する予感がする。
data/class_extends/page_extends/mypage/LC_Page_Mypage_Abstract_Ex.php
その場合、互換対応が必要そう。(class_alias で済む?)
LC_Page_AbstractMypage も同様かも。(未検証)
`require_once CLASS_EX_REALDIR.'page_extends/mypage/LC_Page_AbstractMypage_Ex.php';` するカスタマイズが存在する状態下で、phpStan を実行すると、終了時に不可解なエラーが発生し、ステップデバッグで特定した。
```
PHP Fatal error: Cannot redeclare class LC_Page_AbstractMypage (previously declared in ****/data/class/pages/mypage/LC_Page_AbstractMypage.php:31) in
****/data/class_extends/page_extends/mypage/LC_Page_AbstractMypage_Ex.php on line 39
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing SC_ClassAutoloader’s $classpath calculation for LC_Page_AbstractMypage_Ex and compare it with data/class_extends/page_extends/mypage/LC_Page_AbstractMypage_Ex.php; also check the analogous LC_Page_AbstractMypage case. Reproduce the failure with the documented require_once customization and phpStan, then verify that class loading no longer ends with the reported Cannot redeclare fatal error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100