Ignore:
Timestamp:
2012/02/27 17:39:02 (14 years ago)
Author:
h_yoshimoto
Message:

#1603 #1632 プラグイン仕様変更に伴う修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/helper/SC_Helper_Plugin.php

    r21552 r21555  
    4444     * @return void 
    4545     */ 
    46     function load() { 
     46    function load($plugin_activate_flg = true) { 
    4747 
    4848        if (!defined('CONFIG_REALFILE') || !file_exists(CONFIG_REALFILE)) return; // インストール前 
    4949        if (SC_Utils_Ex::sfIsInstallFunction()) return; // インストール中 
    50  
     50        if ($plugin_activate_flg === false) return; 
    5151        // 有効なプラグインを取得 
    5252        $arrPluginDataList = $this->getEnablePlugin(); 
     
    5858            if (array_search($arrPluginData['plugin_code'], $arrPluginDirectory) !== false) { 
    5959                // プラグイン本体ファイルを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'; 
    6161 
    6262                // プラグインのインスタンス生成. 
    63                 $objPlugin = new $arrPluginData['plugin_code']($arrPluginData); 
     63                $objPlugin = new $arrPluginData['class_name']($arrPluginData); 
    6464                // メンバ変数にプラグインのインスタンスを登録. 
    6565                $this->arrPluginInstances[$arrPluginData['plugin_id']] = $objPlugin; 
     
    7979     * @return object SC_Helper_Pluginオブジェクト 
    8080     */ 
    81     function getSingletonInstance() { 
     81    function getSingletonInstance($plugin_activate_flg = true) { 
    8282        if (!isset($GLOBALS['_SC_Helper_Plugin_instance']) || is_null($GLOBALS['_SC_Helper_Plugin_instance'])) { 
    8383            $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); 
    8585        } 
    8686        return $GLOBALS['_SC_Helper_Plugin_instance']; 
     
    156156     */ 
    157157    function getPluginByPluginId($plugin_id) { 
    158         $objQuery = new SC_Query_Ex(); 
     158        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    159159        $col = '*'; 
    160160        $table = 'dtb_plugin'; 
     
    171171     */ 
    172172    function getPluginByPluginCode($plugin_code) { 
    173         $objQuery = new SC_Query_Ex(); 
     173        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    174174        $col = '*'; 
    175175        $table = 'dtb_plugin'; 
     
    179179    } 
    180180 
     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     
    181195    /** 
    182196     * プラグインディレクトリの取得 
Note: See TracChangeset for help on using the changeset viewer.