Ticket #1692 (assigned 新規開発) — at Version 20
プラグイン機能
Reported by: | h_yoshimoto | Owned by: | h_yoshimoto |
---|---|---|---|
Priority: | 高 | Milestone: | EC-CUBE2.12.0 |
Component: | その他 | Version: | 2.12.0 α |
Keywords: | Cc: | ||
修正済み: | yes |
Description (last modified by h_yoshimoto) (diff)
■プラグイン機能仕様書
http://downloads.ec-cube.net/src/manual/12.0_plugin/plugin.pdf
http://downloads.ec-cube.net/src/manual/12.0_plugin/hook_point.pdf
●プラグイン・エンジン
プラグイン機能のコア
●フックポイント
フックポイントを使ってプラグインは処理に介入します。
●トランスフォーマー(ヘルパー)
プラグインがテンプレートを変更する際に仕様するインターフェイス
Change History
comment:6 follow-up: ↓ 7 Changed 12 years ago by Seasoft
動作未確認ですが、ソース査読にて lc_page_products_list_action_end が2連続実行しているように思います。
comment:8 Changed 12 years ago by h_yoshimoto
r21671 にて各プラグインの設定画面を呼び出し方を変更。モジュール同様に認証可否判定を通るようにしました。
comment:9 follow-up: ↓ 11 Changed 12 years ago by h_yoshimoto
プラグイン機能のクラス設計について
現状のSC_Helper_Pluginには
プラグインエンジンとしての役割(各Pageクラスで使用)と
DBからデータ取得などの役割(Pageクラス・エンジン部分で使用)
が混同しています。
そこで、エンジン部分とデータ取得部分を分離させようかと考えています。
以下の仕様で考えていますが、いかがでしょうか?
エンジン部分→SC_Helper_Plugin
データ取得部分→data/plugin/SC_Plugin.phpを作成。
ご懸念される点がございましたら、ご意見頂ければと思います。
問題無ければ進めさせて頂きます。
comment:10 Changed 12 years ago by h_yoshimoto
r21672 にてregistをregisterに変更
合わせてサンプルプラグインも修正
Changed 12 years ago by eccuore
- attachment RecordIPaddress.tar added
uninstall時の処理追加、addActionでpriority追加、prefilterTransformにreplaceElementのパターンとinsertAfterのパターンを追加
comment:11 in reply to: ↑ 9 Changed 12 years ago by h_yoshimoto
h_yoshimoto への返信
プラグイン機能のクラス設計について
現状のSC_Helper_Pluginには
プラグインエンジンとしての役割(各Pageクラスで使用)と
DBからデータ取得などの役割(Pageクラス・エンジン部分で使用)
が混同しています。そこで、エンジン部分とデータ取得部分を分離させようかと考えています。
以下の仕様で考えていますが、いかがでしょうか?エンジン部分→SC_Helper_Plugin
データ取得部分→data/plugin/SC_Plugin.phpを作成。ご懸念される点がございましたら、ご意見頂ければと思います。
問題無ければ進めさせて頂きます。
r21681 にて対応しました。
comment:12 Changed 12 years ago by h_yoshimoto
r21689 にてプラグインエンジンのインスタンス生成時の処理を統一
comment:13 Changed 12 years ago by h_yoshimoto
21693 r21694 にてフックポイント名を変更
comment:16 Changed 12 years ago by Yammy
SLTEXT_LEN という TYPO があったので、r21705 で修正しておきました。
comment:17 Changed 12 years ago by adachi
TO:h_yoshimoto
SC_Plugin_Util::deletePluginByPluginIdで、commitし忘れているようにみえるのですが、これはあってます?
function deletePluginByPluginId($plugin_id) { $objQuery =& SC_Query_Ex::getSingletonInstance(); $objQuery->begin(); $where = 'plugin_id = ?'; $objQuery->delete('dtb_plugin', $where, array($plugin_id)); $objQuery->delete('dtb_plugin_hookpoint', $where, array($plugin_id)); }
comment:18 follow-up: ↓ 19 Changed 12 years ago by adachi
CategoryContents?でWaringがぽろぽろ
2012/04/09 01:06:21 [/products/list.php] Warning(E_WARNING): Missing argument 3 for SC_Helper_Plugin::addAction(), called in /mnt/NetBeans/version-2_12-dev/data/downloads/plugin/CategoryContents/CategoryContents.php on line 168 and defined on [/mnt/NetBeans/version-2_12-dev/data/class/helper/SC_Helper_Plugin.php(154)] from 192.168.56.1 2012/04/09 01:06:22 [/products/list.php] Warning(E_WARNING): array_key_exists() [<a href='function.array-key-exists'>function.array-key-exists</a>]: The second argument should be either an array or an object on [/mnt/NetBeans/version-2_12-dev/data/class/helper/SC_Helper_Transform.php(483)] from 192.168.56.1
comment:19 in reply to: ↑ 18 Changed 12 years ago by h_yoshimoto
adachi さんへの返信
CategoryContents?でWaringがぽろぽろ
2012/04/09 01:06:21 [/products/list.php] Warning(E_WARNING): Missing argument 3 for SC_Helper_Plugin::addAction(), called in /mnt/NetBeans/version-2_12-dev/data/downloads/plugin/CategoryContents/CategoryContents.php on line 168 and defined on [/mnt/NetBeans/version-2_12-dev/data/class/helper/SC_Helper_Plugin.php(154)] from 192.168.56.1 2012/04/09 01:06:22 [/products/list.php] Warning(E_WARNING): array_key_exists() [<a href='function.array-key-exists'>function.array-key-exists</a>]: The second argument should be either an array or an object on [/mnt/NetBeans/version-2_12-dev/data/class/helper/SC_Helper_Transform.php(483)] from 192.168.56.1
ご報告ありがとうございます。
r21728 にて対応致しました。
comment:20 Changed 12 years ago by h_yoshimoto
- Description modified (diff)
- Summary changed from プラグイン機能(α版) to プラグイン機能