Ignore:
Timestamp:
2012/06/03 03:06:37 (12 years ago)
Author:
Yammy
Message:

バージョン毎のプラグイン利用に必要なモジュールのチェック機構

refs #1845

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/plugin/SC_Plugin_Util.php

    r21867 r21884  
    143143        return $objQuery->select($cols, $from, $where, array($plugin_id)); 
    144144    } 
     145 
     146    /** 
     147     * プラグイン利用に必須のモジュールチェック 
     148     * 
     149     * @param array|null $arrBlocs  配置情報を含めたブロックの配列 
     150     * @return void 
     151     */ 
     152    function checkExtension() { 
     153        // プラグイン利用に必須のモジュール 
     154        // 'EC-CUBEバージョン' => array('モジュール名') 
     155        $arrRequireExtension = array( 
     156                                     '2.12.0' => array('dom'), 
     157                                    ); 
     158        // 必須拡張モジュールのチェック 
     159        $arrErr = array(); 
     160        if (is_array($arrRequireExtension[ECCUBE_VERSION])) { 
     161            foreach ($arrRequireExtension[ECCUBE_VERSION] AS $val) { 
     162                if (!extension_loaded($val)) { 
     163                    $arrErr[$val] = "※ プラグインを利用するには、拡張モジュール「${val}」が必要です。<br />"; 
     164                } 
     165            } 
     166        } 
     167        return $arrErr; 
     168    } 
     169 
    145170} 
Note: See TracChangeset for help on using the changeset viewer.