id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	modified_flg
2181	開発合宿：プラグインのインストーラ	adachi	somebody	"以下は、現状プラグイン任せなので、エラーがおきやすい

・インストール
・アンインストール
・有効
・無効

インストール用ユーティリティを用意し、プラグイン作成者に使ってもらう
※テーブル作成、ファイルコピー、ブロック追加など

利用イメージ
{{{
function install($arrPlugin) {
  $objInstaller->sql(""create table xxx"")
  $objInstaller->copyfiles(""media/product.css"", ""media/product.css"");
  $objInstaller->sql(""alter table add column xxx int"");
  ※このタイミングでは、SQLやファイルコピーは実行されない。
  ※実行は上のレイヤで制御
}
}}}


使い方
{{{
install($arrPlugin, $objPluginInstaller) {
    // カラム追加
    $objPluginInstaller->sql(""alter table dtb_products add column plg_plugin_code_hoge text"");

    // テーブル追加
    $objPluginInstaller->sql(
        ""create table plg_plugin_code_hogehugatable (
             hoge_id int not null primary key
             hoge_name text)"");

    // data/downloads/plugin/plugin_code/media/hoge.cssをhtml/plugin/plugin_code/media/huga.cssへコピー
    $objPluginInstaller->copyFile(""media/hoge.css"", ""media/huga.css"");

    // data/downloads/plugin/plugin_code/js/以下をhtml/plugin/plugin_code/js/へコピー
    $objPluginInstaller->copyDirectory(""js"", ""js"");
}

uninstall($arrPlugin, $objPluginInstaller) {
    // カラム追加
    $objPluginInstaller->sql(""alter table dtb_products drop column plg_plugin_code_hoge"");

    // テーブル削除
    $objPluginInstaller->sql(""drop table plg_plugin_code_hoge"");

    // ファイル削除
    html以下はアンインストール時にまるっと削除される
}

}}}"	改善提案	new	中	EC-CUBE2.13.0	フロント	2.12.3				0
