- Timestamp:
- 2012/02/27 17:39:02 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_Plugin.php
r21552 r21555 44 44 * @return void 45 45 */ 46 function load( ) {46 function load($plugin_activate_flg = true) { 47 47 48 48 if (!defined('CONFIG_REALFILE') || !file_exists(CONFIG_REALFILE)) return; // インストール前 49 49 if (SC_Utils_Ex::sfIsInstallFunction()) return; // インストール中 50 50 if ($plugin_activate_flg === false) return; 51 51 // 有効なプラグインを取得 52 52 $arrPluginDataList = $this->getEnablePlugin(); … … 58 58 if (array_search($arrPluginData['plugin_code'], $arrPluginDirectory) !== false) { 59 59 // プラグイン本体ファイルをrequire. 60 require_once PLUGIN_UPLOAD_REALDIR . $arrPluginData['plugin_code'] . '/' . $arrPluginData[' plugin_code'] . '.php';60 require_once PLUGIN_UPLOAD_REALDIR . $arrPluginData['plugin_code'] . '/' . $arrPluginData['class_name'] . '.php'; 61 61 62 62 // プラグインのインスタンス生成. 63 $objPlugin = new $arrPluginData[' plugin_code']($arrPluginData);63 $objPlugin = new $arrPluginData['class_name']($arrPluginData); 64 64 // メンバ変数にプラグインのインスタンスを登録. 65 65 $this->arrPluginInstances[$arrPluginData['plugin_id']] = $objPlugin; … … 79 79 * @return object SC_Helper_Pluginオブジェクト 80 80 */ 81 function getSingletonInstance( ) {81 function getSingletonInstance($plugin_activate_flg = true) { 82 82 if (!isset($GLOBALS['_SC_Helper_Plugin_instance']) || is_null($GLOBALS['_SC_Helper_Plugin_instance'])) { 83 83 $GLOBALS['_SC_Helper_Plugin_instance'] =& new SC_Helper_Plugin_Ex(); 84 $GLOBALS['_SC_Helper_Plugin_instance']->load( );84 $GLOBALS['_SC_Helper_Plugin_instance']->load($plugin_activate_flg); 85 85 } 86 86 return $GLOBALS['_SC_Helper_Plugin_instance']; … … 156 156 */ 157 157 function getPluginByPluginId($plugin_id) { 158 $objQuery = new SC_Query_Ex();158 $objQuery =& SC_Query_Ex::getSingletonInstance(); 159 159 $col = '*'; 160 160 $table = 'dtb_plugin'; … … 171 171 */ 172 172 function getPluginByPluginCode($plugin_code) { 173 $objQuery = new SC_Query_Ex();173 $objQuery =& SC_Query_Ex::getSingletonInstance(); 174 174 $col = '*'; 175 175 $table = 'dtb_plugin'; … … 179 179 } 180 180 181 /** 182 * プラグインIDをキーにプラグインを削除する。 183 * 184 * @param string $plugin_id プラグインID. 185 * @return array プラグインの基本情報. 186 */ 187 function deletePluginByPluginId($plugin_id) { 188 $objQuery =& SC_Query_Ex::getSingletonInstance(); 189 $objQuery->begin(); 190 $where = 'plugin_id = ?'; 191 $objQuery->delete('dtb_plugin', $where, array($plugin_id)); 192 $objQuery->delete('dtb_plugin_hookpoint', $where, array($plugin_id)); 193 } 194 181 195 /** 182 196 * プラグインディレクトリの取得
Note: See TracChangeset
for help on using the changeset viewer.
