Changes between Initial Version and Version 2 of Ticket #2181


Ignore:
Timestamp:
2013/03/10 00:41:36 (11 years ago)
Author:
adachi
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2181 – Description

    initial v2  
    1919} 
    2020}}} 
     21 
     22 
     23使い方 
     24{{{ 
     25install($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 
     42uninstall($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}}}