PEAK XOOPS - D3モジュールの定義 in englishin japanese

Archive | RSS |
XOOPS
XOOPS : D3モジュールの定義
Poster : GIJOE on 2008-08-30 06:31:19 (21776 reads)

in englishin japanese
「今さら定義?」という気もするのですが、ホダ塾メンバーでさえも、D3の重要な仕様を知らなかったことに驚き、あらためて"D3"を定義したいと思います。

もともと"Duplicatable"は、X2の制限をいかにして回避するか、ということを考えて積み上げられてきたテクニックの集大成です。

つまり、「X2で動くこと」というのがすべての"Duplicatable"の大前提となります。それはD1・D2・D3に共通します。

だから、「XCL専用」のモジュールは、複製可能でXOOPS_TRUST_PATHを使おうとも、それはD3ではないのです。

もちろん、「X2でも動作確認しなさい」などと偉そうに言うつもりはありません。ただ、D3の構造を素直に利用すれば、X2でも自動的に動くはずなのです。(この部分には多少誇張が含まれてますが)

D3の構造を意図的に外して、XCL専用とするのも当然自由ですが、それがD3でないのは自明です。

D3の構造で作ったけど、できあがったものはX2互換がなかった、なんて可能性も当然考えられます。そしてX2での動作確認を必要条件にするつもりもありません。でも、そういうケースならX2互換にするのは簡単でしょう。

D3モジュールは、世界中のX2アーキテクチャーで動きます。ImpressCMSでも、JP版X2でも、もちろん本家版XOOPSでも(一部要修正)。だからこそ、XCL専用モジュールには"Duplicatable V3"という名前を冠して欲しくないのです。それはXCL以外の海外ユーザの誤解を招くからです。


前置きが長くなりましたが、D3モジュールの定義を書きます。

*必要条件(こうじゃなければD3モジュールとは呼べないもの)
(1) 原則的にX2互換であること
(2) dirnameが[0-9a-zA-Z_-]のキャラクター組み合わせで自由に決められること
(3) ほとんどのロジックがXOOPS_TRUST_PATHの内側にあること
(4) ROOT/modules/下にあるディレクトリをコピーするだけで複数動作すること(そこにソースコード書き換えは一切発生しないこと)
(5) XOOPS_TRUST_PATHの内側(ロジックの記述されたファイル)は複製する必要がないこと

*推奨条件(そうじゃなくても良いが、できれば対応して欲しいもの)
- ROOT/modules/(dirname)/mytrustdirname.php ファイルを用意すること
- 利用する各テーブルは (prefix)_(dirname)_(table) という名前でCREATE TABLEされること
- テンプレートは (dirname)_(tplfile) という形でDBに取り込まれること
- blocks/(tplfile).html という階層を持ったテンプレートをブロックに利用しないこと(=ブロック用のテンプレートも他のmoduleテンプレートと同様に扱うこと)
- 特に理由がなければ、ブロックも複製可能とすること(can_cloneのセット)
- D3言語マネージャを利用すること
- コメントにはd3コメント統合が利用できること

「推奨条件」はまだ増えるかもしれませんが、「必要条件」は最初の5つだけです。


なお、D3モジュールの構造については、Gnaviのkentaroさんが判りやすいドキュメントを作成してくれています。まだ途中ではありますが、非常に良くできたテキストで、これからD3モジュールを作ろうという人にも、すでに作ったことのある人にも役立つと思います。
http://xoops.iko-ze.net/modules/pukiwiki/

Printer friendly page Send this story to a friend

Comments list

GIJOE  Posted on 2008/9/10 13:04
hi Mikhail.

Quote:

Hi! Just a suggestion ( maybe a feature request ):
beyond duplicatable, a module can be movable too, at least partially. Capable of being installed out of modules folder, or moved from one place to another (ex: from \modules\news\ to \news\), using a "connector module" inside the XOOPS Cube module folder with the necessary information to make this works. What do you think?
The meaning of "movable" looks ambiguous.

I had implemented a combination both of "mod_rewrite" and "ob_filter".
eg) "modules/" changer
http://xoops.peak.ne.jp/md/news/index.php?page=article&storyid=54

And a superior version by nobunobu
http://xoops.peak.ne.jp/md/d3forum/index.php?post_id=7635

Quote:
PS: Ah! A little doubt: what the number 3 means in D3?

Duplicatable V1:
eg) TinyContent Duplicatable
It can be installed as tinycontent0, tinycontent1, tinycontent2 so on.

Duplicatable V2:
eg) TinyD, myAlbum-P, piCal, xhld
This kind of modules can be installed as tinyd, contents0, test1 so on.

Duplicatable V3:
eg) wraps, pico, d3forum etc.
You can install it as any directory names as you like, if the all characters hit the regex [0-9a-zA-Z_-]
Mikhail  Posted on 2008/9/9 22:09 | Last modified
Hi! Just a suggestion ( maybe a feature request ;-) ): beyond duplicatable, a module can be movable too, at least partially. Capable of being installed out of modules folder, or moved from one place to another (ex: from \modules\news\ to \news\), using a "connector module" inside the XOOPS Cube module folder with the necessary information to make this works. What do you think? PS: Ah! A little doubt: what the number 3 means in D3?
Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!