待辦事項 #9750

Warning at module installation
啟用日期: 2007-01-09 16:58 最後更新: 2007-01-17 18:57

回報者:
負責人:
狀態:
關閉
元件:
(無)
里程碑:
(無)
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
修正
檔案:

細節

module いんすとーる時に sql ふぁいるが空っぽだと
/modules/legacy/admin/class/Legacy_SQLScanner.class.php
L28

foreach (array_keys($this->mTokens) as $key) {
ここで

Warning [PHP]: array_keys(): The first argument
should be an array in
file ...\modules\legacy\admin\class\Legacy_SQLScanner.c
lass.php line 28
Warning [PHP]: Invalid argument supplied for foreach
() in
file ...\modules\legacy\admin\class\Legacy_SQLScanner.c
lass.php line 28

と怒られちゃいます
foreach の前に $this->mTokens をちぇっくしてもいいけど
/modules/legacy/lib/EasyLex/EasyLex_SQLScanner.class.ph
p L91

var $mTokens;

var $mTokens = array();
なかんじのほうがよさそうかなぁ?
ほかのめんばはちゃんと初期化されてるし・・・

Ticket History (3/4 Histories)

2007-01-10 10:52 Updated by: minahito
評語
Logged In: YES
user_id=8353

[EN]
If the specified SQL file is empty on module installation,
Legacy_SQLScanner.class.php L28 warns.

EasyLex_SQLScanner should initialize all members.
2007-01-10 11:02 Updated by: minahito
評語
Logged In: YES
user_id=8353

[EN]
You're right. EasyLex_SQLScanner should initialize all
members on their declarations. I had not decided the place
where I should write the initializing code, because I was in
between PHP spec and C++ spec. But, I we should write
initializing code on the declaration under PHP spec, now.

[JA]
おっしゃるとおりで、EasyLex_SQLScanner はすべてのメンバをそ
の宣言時に初期化するべきですね。これまで宣言時にできる宣言は
やってしまうか、コンストラクタのみで行うか、 PHP スタイルと
C++ スタイルの間をふらふらしていましたが、 PHP 仕様の下、可
能な初期化は宣言時にやってしまうのがいいと今は考えています。
2007-01-17 16:47 Updated by: minahito
  • 負責人 Update from (無) to minahito
  • 處理結果 Update from to Accepted
評語
Logged In: YES
user_id=8353


[JA](Junk)
まちがえて bug fix #7892 で流してしまった...
2007-01-17 18:57 Updated by: minahito
  • Ticket Close date is changed to 2007-01-17 18:57
  • 處理結果 Update from Accepted to 修正
  • 狀態 Update from 開啟 to 關閉

Attachment File List

No attachments

編輯

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » 登入