| Line | |
|---|
| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | class TestPlugin1 extends SC_Plugin_Ex { |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | function enable(String $classname){ |
|---|
| 9 | return preg_match('/shopping|payment|products/',$classname)? |
|---|
| 10 | !preg_match('/list/', $classname) |
|---|
| 11 | :false |
|---|
| 12 | ; |
|---|
| 13 | } |
|---|
| 14 | |
|---|
| 15 | function init(){ |
|---|
| 16 | |
|---|
| 17 | } |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | function getVersion(){ |
|---|
| 21 | return "0.0.1"; |
|---|
| 22 | } |
|---|
| 23 | |
|---|
| 24 | function getName(){ |
|---|
| 25 | return "TestPlugin1"; |
|---|
| 26 | } |
|---|
| 27 | |
|---|
| 28 | function process(){ |
|---|
| 29 | |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | function mobileprocess(){ |
|---|
| 33 | |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | public function install(){ |
|---|
| 37 | $objQuery = new SC_Query(); |
|---|
| 38 | $arrPlugins = $objQuery->get("dtb_plugin", "plugin_id", "plugin_name = ?",array($name)); |
|---|
| 39 | $data = array( |
|---|
| 40 | 'plugin_name' => $objForm->getValue('plugin_name'), |
|---|
| 41 | 'path' => realpath(DATA_DIR.'/plugin/'.$objForm->getValue('plugin_name').'/'), |
|---|
| 42 | 'enable' => '1', |
|---|
| 43 | 'del_flg' => '0', |
|---|
| 44 | 'class_name' => $objForm->getValue('plugin_name'), |
|---|
| 45 | 'version' => $this->getVersion() |
|---|
| 46 | ); |
|---|
| 47 | |
|---|
| 48 | if(count($arrPlugins) == 0){ |
|---|
| 49 | $objQuery->insert("dtb_plugin", $data); |
|---|
| 50 | }else{ |
|---|
| 51 | $objQuery->update('dtb_plugin',$data,'plugin_id = ?',array($arrPlugins[0]['plugin_id'])); |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | } |
|---|
| 56 | |
|---|
| 57 | public function uninstall(){ |
|---|
| 58 | $objQuery = new SC_Query(); |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | } |
|---|
| 62 | |
|---|
| 63 | /** |
|---|
| 64 | * |
|---|
| 65 | * @return String インストール用のSQL |
|---|
| 66 | */ |
|---|
| 67 | protected function getInstallSQL(){ |
|---|
| 68 | |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | |
|---|
| 72 | protected function getUninstallSQL(){ |
|---|
| 73 | |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.