Ticket #9750

Warning at module installation
Date d'ouverture: 2007-01-09 16:58 Dernière mise à jour: 2007-01-17 18:57

Rapporteur:
Propriétaire:
État:
Atteints
Composant:
(Aucun)
Jalon:
(Aucun)
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Fixed
Fichier:
Aucun

Détails

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
Commentaire
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
Commentaire
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
  • Propriétaire Update from (Aucun) to minahito
  • Résolution Update from Aucun to Accepted
Commentaire
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
  • Résolution Update from Accepted to Fixed
  • État Update from Ouvert to Atteints

Attachment File List

No attachments

Modifier

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