| 21 | |
| 22 | |
| 23 | 使い方 |
| 24 | {{{ |
| 25 | install($arrPlugin, $objPluginInstaller) { |
| 26 | // カラム追加 |
| 27 | $objPluginInstaller->sql("alter table dtb_products add column plg_plugin_code_hoge text"); |
| 28 | |
| 29 | // テーブル追加 |
| 30 | $objPluginInstaller->sql( |
| 31 | "create table plg_plugin_code_hogehugatable ( |
| 32 | hoge_id int not null primary key |
| 33 | hoge_name text)"); |
| 34 | |
| 35 | // data/downloads/plugin/plugin_code/media/hoge.cssをhtml/plugin/plugin_code/media/huga.cssへコピー |
| 36 | $objPluginInstaller->copyFile("media/hoge.css", "media/huga.css"); |
| 37 | |
| 38 | // data/downloads/plugin/plugin_code/js/以下をhtml/plugin/plugin_code/js/へコピー |
| 39 | $objPluginInstaller->copyDirectory("js", "js"); |
| 40 | } |
| 41 | |
| 42 | uninstall($arrPlugin, $objPluginInstaller) { |
| 43 | // カラム追加 |
| 44 | $objPluginInstaller->sql("alter table dtb_products drop column plg_plugin_code_hoge"); |
| 45 | |
| 46 | // テーブル削除 |
| 47 | $objPluginInstaller->sql("drop table plg_plugin_code_hoge"); |
| 48 | |
| 49 | // ファイル削除 |
| 50 | html以下はアンインストール時にまるっと削除される |
| 51 | } |
| 52 | |
| 53 | }}} |