[21395] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | * This file is part of EC-CUBE |
---|
| 4 | * |
---|
[22206] | 5 | * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved. |
---|
[21395] | 6 | * |
---|
| 7 | * http://www.lockon.co.jp/ |
---|
| 8 | * |
---|
| 9 | * This program is free software; you can redistribute it and/or |
---|
| 10 | * modify it under the terms of the GNU General Public License |
---|
| 11 | * as published by the Free Software Foundation; either version 2 |
---|
| 12 | * of the License, or (at your option) any later version. |
---|
| 13 | * |
---|
| 14 | * This program is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this program; if not, write to the Free Software |
---|
| 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 22 | * |
---|
| 23 | * |
---|
| 24 | */ |
---|
| 25 | |
---|
| 26 | /** |
---|
| 27 | * プラグインの基底クラス |
---|
| 28 | * |
---|
| 29 | * @package Plugin |
---|
| 30 | * @author LOCKON CO.,LTD. |
---|
| 31 | * @version $Id: $ |
---|
| 32 | */ |
---|
[22856] | 33 | abstract class SC_Plugin_Base |
---|
[22567] | 34 | { |
---|
[21794] | 35 | protected $arrSelfInfo; |
---|
[21395] | 36 | |
---|
| 37 | /** |
---|
| 38 | * コンストラクタ |
---|
[21885] | 39 | * |
---|
[21395] | 40 | * @param array $arrSelfInfo 自身のプラグイン情報 |
---|
| 41 | * @return void |
---|
| 42 | */ |
---|
[22567] | 43 | function __construct(array $arrSelfInfo) |
---|
| 44 | { |
---|
[21395] | 45 | $this->arrSelfInfo = $arrSelfInfo; |
---|
| 46 | } |
---|
[21763] | 47 | /** |
---|
| 48 | * インストール |
---|
| 49 | * installはプラグインのインストール時に実行されます. |
---|
| 50 | * 引数にはdtb_pluginのプラグイン情報が渡されます. |
---|
| 51 | * |
---|
| 52 | * @param array $arrPlugin plugin_infoを元にDBに登録されたプラグイン情報(dtb_plugin) |
---|
| 53 | * @return void |
---|
| 54 | */ |
---|
[22978] | 55 | function install($arrPlugin, $objPluginInstaller = null) { |
---|
| 56 | |
---|
| 57 | } |
---|
[21829] | 58 | |
---|
[21763] | 59 | /** |
---|
| 60 | * アンインストール |
---|
| 61 | * uninstallはアンインストール時に実行されます. |
---|
| 62 | * 引数にはdtb_pluginのプラグイン情報が渡されます. |
---|
[21885] | 63 | * |
---|
[21763] | 64 | * @param array $arrPlugin プラグイン情報の連想配列(dtb_plugin) |
---|
| 65 | * @return void |
---|
| 66 | */ |
---|
[22978] | 67 | function uninstall($arrPlugin, $objPluginInstaller = null) { |
---|
| 68 | |
---|
| 69 | } |
---|
[21829] | 70 | |
---|
[21763] | 71 | /** |
---|
| 72 | * 稼働 |
---|
| 73 | * enableはプラグインを有効にした際に実行されます. |
---|
| 74 | * 引数にはdtb_pluginのプラグイン情報が渡されます. |
---|
| 75 | * |
---|
| 76 | * @param array $arrPlugin プラグイン情報の連想配列(dtb_plugin) |
---|
| 77 | * @return void |
---|
| 78 | */ |
---|
[22978] | 79 | function enable($arrPlugin, $objPluginInstaller = null) { |
---|
| 80 | |
---|
| 81 | } |
---|
[21829] | 82 | |
---|
[21763] | 83 | /** |
---|
| 84 | * 停止 |
---|
| 85 | * disableはプラグインを無効にした際に実行されます. |
---|
| 86 | * 引数にはdtb_pluginのプラグイン情報が渡されます. |
---|
| 87 | * |
---|
| 88 | * @param array $arrPlugin プラグイン情報の連想配列(dtb_plugin) |
---|
| 89 | * @return void |
---|
| 90 | */ |
---|
[22978] | 91 | function disable($arrPlugin, $objPluginInstaller = null) { |
---|
| 92 | |
---|
| 93 | } |
---|
[21794] | 94 | |
---|
| 95 | /** |
---|
| 96 | * プラグインヘルパーへ, コールバックメソッドを登録します. |
---|
| 97 | * |
---|
| 98 | * @param object $objPluginHelper |
---|
| 99 | * @param integer $priority |
---|
| 100 | */ |
---|
[22567] | 101 | function register(SC_Helper_Plugin $objHelperPlugin, $priority) |
---|
| 102 | { |
---|
[21794] | 103 | if (isset($this->arrSelfInfo['plugin_hook_point'])) { |
---|
| 104 | $arrHookPoints = $this->arrSelfInfo['plugin_hook_point']; |
---|
| 105 | foreach ($arrHookPoints as $hook_point) { |
---|
| 106 | if (isset($hook_point['callback'])) { |
---|
| 107 | $hook_point_name = $hook_point['hook_point']; |
---|
| 108 | $callback_name = $hook_point['callback']; |
---|
| 109 | $objHelperPlugin->addAction($hook_point_name, array($this, $callback_name), $priority); |
---|
| 110 | } |
---|
| 111 | } |
---|
| 112 | } |
---|
| 113 | } |
---|
[21885] | 114 | |
---|
| 115 | /** |
---|
| 116 | * このプラグインのプラグイン情報を返す。 |
---|
| 117 | * |
---|
| 118 | * @return array $arrSelfInfo 自身のプラグイン情報 |
---|
| 119 | */ |
---|
[22567] | 120 | function getPluginInfo() |
---|
| 121 | { |
---|
[21885] | 122 | return $this->arrSelfInfo; |
---|
| 123 | } |
---|
[21395] | 124 | } |
---|