[Svn-src-all:1356] [version-2_5-dev 20246] #976 ([管理画面]プラグイン)

kotani admin @ mail.ec-cube.net
2011年 2月 20日 (日) 12:03:01 JST


Subversion committed to /home/svn/open 20246
http://svn.ec-cube.net/open_trac/changeset/20246
┌────────────────────────────┐
│更新者 :  kotani                                       │
│更新日時:  2011-02-20 12:03:00 +0900 (日, 20  2月 2011)│
└────────────────────────────┘

Log:
--------------------------------------------------------
#976 ([管理画面]プラグイン)
* プラグインアップロード機能追加
* リファクタリング開発
* SC_CheckError 拡張子チェックメソッドFILE_EXT_CHECK() を、判定拡張子にピリオドが複数ある場合にも対応するよう修正

Changed:                      [U:修正,A:追加,D:削除]
--------------------------------------------------------
U   branches/version-2_5-dev/data/Smarty/templates/admin/system/plugin.tpl
U   branches/version-2_5-dev/data/class/SC_CheckError.php
U   branches/version-2_5-dev/data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php
U   branches/version-2_5-dev/data/mtb_constants_init.php
D   branches/version-2_5-dev/data/plugin/TestPlugin1/
D   branches/version-2_5-dev/data/plugin/bingo/
U   branches/version-2_5-dev/html/install/sql/create_table_mysql.sql
U   branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql
U   branches/version-2_5-dev/html/install/sql/insert_data.sql

変更: branches/version-2_5-dev/data/Smarty/templates/admin/system/plugin.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/admin/system/plugin.tpl	2011-02-20 02:53:11 UTC (rev 20245)
+++ branches/version-2_5-dev/data/Smarty/templates/admin/system/plugin.tpl	2011-02-20 03:03:00 UTC (rev 20246)
@@ -1,56 +1,108 @@
-<form name="form1" id="form1" method="post" action="?">
+<!--{*
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+*}-->
+<!--<form name="form1" id="form1" method="post" action="?">-->
+<form name="form1" method="post" action="?" enctype="multipart/form-data">
 <input type="hidden" name="mode" value="" />
-<input type="hidden" name="keyname" value="" />
+<input type="hidden" name="plugin_id" value="" />
+<input type="hidden" name="plugin_code" value="" />
+
 <div id="system" class="contents-main">
-  <div class="paging">
-    <!--▼ページ送り-->
-    <!--{$tpl_strnavi}-->
-    <!--▲ページ送り-->
+
+  <h2>プラグイン登録</h2>
+  <table class="form">
+    <tr>
+      <th>プラグイン<span class="attention"> *</span></th>
+      <td>
+        <!--{assign var=key value="plugin_file"}-->
+        <span class="attention"><!--{$arrErr[$key]}--></span>
+        <input type="file" name="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" class="box54" size="64" <!--{if $arrErr[$key]}-->style="background-color:<!--{$smarty.const.ERR_COLOR|h}-->"<!--{/if}-->>
+      </td>
+    </tr>
+  </table>
+
+  <div class="btn-area">
+    <a class="btn-action" href="javascript:;" onclick="fnModeSubmit('upload', '', '');return false;"><span class="btn-next">この内容で登録する</span></a>
   </div>
   
-  <!--▼メンバー一覧ここから-->
-  <table class="list">
+  <!--▼プラグイン一覧ここから-->
+  <h2>プラグイン一覧</h2>
+  <!--{if count($plugins) > 0}-->
+  <span class="attention"><!--{$arrErr.plugin_error}--><!--{$arrErr.mode}--><!--{$arrErr.plugin_id}--><!--{$arrErr.plugin_code}--></span>
+  <table class="list" width="900">
+    <colgroup width="15%">
+    <colgroup width="10%">
+    <colgroup width="25%">
+    <colgroup width="28%">
+    <colgroup width="7%">
+    <colgroup width="10%">
+    <colgroup width="5%">
     <tr>
-      <th>名前</th>
-      <th>パス</th>
-      <th>有効/無効</th>
+      <th >プラグイン名</th>
+      <th>作者</th>
+      <th>サイトURL</th>
+      <th>説明</th>
+      <th>ステータス</th>
+      <th>操作</th>
       <th>設定</th>
     </tr>
     <!--{section name=data loop=$plugins}-->
-    <!--▼メンバー<!--{$smarty.section.data.iteration}-->-->
     <tr>
-      <td><!--{$plugins[data].plugin_name|h}--></td>
-      <td><!--{$plugins[data].plugin_name|h}--></td>
-      <td>
-        <!--{if $plugins[data].create_date == null}-->
-        <input type="hidden" name="plugin_name" value="<!--{$plugins[data].plugin_name}-->" />
-           <a class="btn-normal" href="javascript:;" name="install" onclick="fnModeSubmit('install','',''); return false;">install</a>
+      <td><!--{$plugins[data].plugin_name|default:$plugins[data].plugin_code|h}--><!--{if $plugins[data].plugin_version != ''}--><br /><!--{$plugins[data].plugin_version|h}--><!--{/if}--></td>
+      <td><!--{$plugins[data].author|default:'-'|h}--></td>
+      <td><!--{$plugins[data].plugin_site_url|default:'-'|h}--></td>
+      <td><!--{$plugins[data].plugin_description|default:'-'|h}--></td>
+      <td class="center">
+        <!--{if $plugins[data].enable == $smarty.const.PLUGIN_ENABLE_TRUE}-->
+        有効
+        <!--{elseif $plugins[data].enable == $smarty.const.PLUGIN_ENABLE_FALSE}-->
+        無効
+        <!--{else}-->-<!--{/if}-->
+      </td>
+      <td class="center">
+        <!--{if $plugins[data].status == $smarty.const.PLUGIN_STATUS_UPLOADED}-->
+        <a class="btn-normal" href="javascript:;" name="install" onclick="fnSetFormValue('plugin_id', '<!--{$plugins[data].plugin_id}-->'); fnModeSubmit('install','plugin_code','<!--{$plugins[data].plugin_code}-->'); return false;">install</a>
         <!--{else}-->
-          <!--{if $plugins[data].enable == 1}-->
-           <a class="btn-normal" href="javascript:;" name="disable" onclick="fnModeSubmit('disable','',''); return false;">disable</a>
+          <!--{if $plugins[data].enable == $smarty.const.PLUGIN_ENABLE_TRUE}-->
+          <a class="btn-normal" href="javascript:;" name="disable" onclick="fnSetFormValue('plugin_id', '<!--{$plugins[data].plugin_id}-->'); fnModeSubmit('disable','plugin_code','<!--{$plugins[data].plugin_code}-->'); return false;">disable</a><br />
           <!--{else}-->
-           <a class="btn-normal" href="javascript:;" name="enable" onclick="fnModeSubmit('enable','',''); return false;">enable</a>
+          <a class="btn-normal" href="javascript:;" name="enable" onclick="fnSetFormValue('plugin_id', '<!--{$plugins[data].plugin_id}-->'); fnModeSubmit('enable','plugin_code','<!--{$plugins[data].plugin_code}-->'); return false;">enable</a><br />
           <!--{/if}-->
-           <a class="btn-normal" href="javascript:;" name="uninstall" onclick="fnModeSubmit('uninstall','',''); return false;">uninstall</a>
+          <a class="btn-normal" href="javascript:;" name="uninstall" onclick="fnSetFormValue('plugin_id', '<!--{$plugins[data].plugin_id}-->'); fnModeSubmit('uninstall','plugin_code','<!--{$plugins[data].plugin_code}-->'); return false;">uninstall</a>
         <!--{/if}-->
       </td>
-      
-      <td>
-      <!--{if $plugins[data].create_date != null && $plugins[data].enable == 1}-->
-        <input type="button" name="preference" value="preference" onclick="" />
-        <!--{/if}-->
+      <td class="center">
+        <!--{if $plugins[data].plugin_setting_path != ''}-->
+        <a href="?" onclick="win03('<!--{$plugins[data].plugin_setting_path}-->','plugin_setting','620','760'); return false;">設定</a>
+        <!--{else}-->-<!--{/if}-->
       </td>
       
     </tr>
-    <!--▲メンバー<!--{$smarty.section.data.iteration}-->-->
     <!--{/section}-->
   </table>
+  <!--{else}-->
+  登録されているプラグインはありません。
+  <!--{/if}-->
 
-  <div class="paging">
-    <!--▼ページ送り-->
-    <!--{$tpl_strnavi}-->
-    <!--▲ページ送り-->
-  </div>
-
 </div>
 </form>

変更: branches/version-2_5-dev/data/class/SC_CheckError.php
===================================================================
--- branches/version-2_5-dev/data/class/SC_CheckError.php	2011-02-20 02:53:11 UTC (rev 20245)
+++ branches/version-2_5-dev/data/class/SC_CheckError.php	2011-02-20 03:03:00 UTC (rev 20246)
@@ -620,12 +620,26 @@
         if($_FILES[$value[1]]['name'] != "" ) {
             $errFlag = 1;
             $array_ext = explode(".", $_FILES[$value[1]]['name']);
-            $ext = $array_ext[ count ( $array_ext ) - 1 ];
-            $ext = strtolower($ext);
 
             $strExt = "";
 
             foreach ( $value[2] as $checkExt ){
+                $ext = "";
+
+                // チェック拡張子のピリオドの数を取得('tar.gz'の場合1個、'jpg'のように通常は0個)
+                $count_period = substr_count($checkExt, ".");
+                
+                if($count_period > 0) {
+                    for($i = max(array_keys($array_ext)) - $count_period; $i < count($array_ext); $i++) {
+                        $ext .= $array_ext[$i] . ".";
+                    }
+                    $ext = preg_replace("/.$/", "" ,$ext);
+                } else {
+                    $ext = $array_ext[ count ( $array_ext ) - 1 ];
+                }
+
+                $ext = strtolower($ext);
+
                 if ( $ext == $checkExt) {
                     $errFlag = 0;
                 }

変更: branches/version-2_5-dev/data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php	2011-02-20 02:53:11 UTC (rev 20245)
+++ branches/version-2_5-dev/data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php	2011-02-20 03:03:00 UTC (rev 20246)
@@ -23,6 +23,7 @@
 
 // {{{ requires
 require_once(CLASS_REALDIR . "pages/admin/LC_Page_Admin.php");
+require_once(CLASS_EX_REALDIR . "helper_extends/SC_Helper_FileManager_Ex.php");
 
 /**
  * システム情報 のページクラス.
@@ -51,20 +52,6 @@
     }
 
     /**
-     * フォームパラメータ初期化
-     *
-     * @return void
-     */
-    function initForm() {
-        $objForm = new SC_FormParam();
-        $objForm->addParam('mode', 'mode', INT_LEN, '', array('ALPHA_CHECK', 'MAX_LENGTH_CHECK'));
-        $objForm->addParam('plugin_name', 'plugin_name', INT_LEN, '', array('ALPHA_CHECK', 'MAX_LENGTH_CHECK'));
-
-        $objForm->setParam($_POST);
-        $this->objForm = $objForm;
-    }
-
-    /**
      * Page のプロセス.
      *
      * @return void
@@ -80,72 +67,66 @@
      * @return void
      */
     function action() {
+        // 認証可否の判定
         SC_Utils_Ex::sfIsSuccess(new SC_Session);
-        $this->initForm();
-        switch($this->getMode()) {
-            // PHP INFOを表示
-            case 'install':
-                $name = $this->objForm->getValue('plugin_name');
-                require_once(DATA_REALDIR.'/plugin/'.$name.'/'.$name.'.php');
-                $plugin = new $name();
-                $plugin->install();
-                break;
-            case 'uninstall':
-                $name = $this->objForm->getValue('plugin_name');
-                require_once(DATA_REALDIR.'/plugin/'.$name.'/'.$name.'.php');
-                $plugin = new $name();
-                $plugin->uninstall();
-                break;
-            case 'enable':
-                $name = $this->objForm->getValue('plugin_name');
-                require_once(DATA_REALDIR.'/plugin/'.$name.'/'.$name.'.php');
-                $plugin = new $name();
-                $plugin->enable();
 
-                break;
-            case 'disable':
-              $name = $this->objForm->getValue('plugin_name');
-                require_once(DATA_REALDIR.'/'.$name.'/'.$name.'.php');
-                $plugin = new $name();
-                $plugin->disable();
-                break;
-            default:
-                $plugins = SC_Helper_Plugin_Ex::getAllPlugin();
-                $this->plugins = array_merge($plugins,
-                $this->getPluginOnFilesystem($plugins));
-                break;
-        }
+        // パラメータ管理クラス
+        $objFormParam = new SC_FormParam();
+        // パラメータ情報の初期化
+        $this->lfInitParam($objFormParam);
+        $objFormParam->setParam($_POST);
+        
+        $mode = $this->getMode();
 
-        $this->arrSystemInfo = $this->getSystemInfo();
-    }
+        switch($mode) {
+        case 'install':
+        case 'uninstall':
+        case 'enable':
+        case 'disable':
+            // エラーチェック
+            $this->arrErr = $objFormParam->checkError();
 
-    /*
-     CREATE TABLE dtb_plugin (
-     plugin_id INT NOT NULL,
-     plugin_name VARCHAR(255) NOT NULL DEFAULT "",
-     enable INT NOT NULL DEFAULT 0,
-     del_flg INT NOT NULL DEFAULT 0,
-     class_name VARCHAR(255) NOT NULL DEFAULT NULL,
-     create_date DATETIME NOT NULL,
-     update_date DATETIME NOT NULL,
-     PRIMARY KEY (plugin_id)
-     ) TYPE=InnoDB;
-     */
+            if(count($this->arrErr) == 0) {
+                $plugin_id = $objFormParam->getValue('plugin_id');
+                $plugin_code = $objFormParam->getValue('plugin_code');
+                
+                // プラグインファイルを読み込み、modeで指定されたメソッドを実行
+                $this->arrErr = $this->lfExecPlugin($plugin_id, $plugin_code, $mode);
+            }
+            break;
+        case 'upload':
+            // プラグイン情報を設定
+            $plugin_code = $this->lfGetPluginCode($_FILES['plugin_file']['name']);
+            $plugin_dir = $this->lfGetPluginDir($plugin_code);
 
-    function getPluginOnFilesystem($existsPlugins){
+            // ファイルアップロード情報を設定
+            $objUpFile = new SC_UploadFile(TEMPLATE_TEMP_REALDIR, $plugin_dir);
+            $this->lfInitUploadFile($objUpFile);
 
-        $dir = DATA_REALDIR."plugin/";
-        $arrPlugins = array();
-        if($dh =  opendir($dir)){
-            while(($file = readdir($dh)) !== false){
-                if(!preg_match('/^\\./', $file) && $file !='..' && filetype($dir.$file) == 'dir'){
-                    $arrPlugins[] = array('plugin_name'=>$file,'class_name'=>$file);
+            // エラーチェック
+            $this->arrErr = $this->lfCheckErrorUploadFile($plugin_code, $plugin_dir);
 
+            if(count($this->arrErr) == 0) {
+                // 一時ディレクトリへアップロード
+                $this->arrErr['plugin_file'] = $objUpFile->makeTempFile('plugin_file', false);
+
+                if($this->arrErr['plugin_file'] == "") {
+                    // プラグイン保存ディレクトリへ解凍
+                    $this->arrErr = $this->lfUploadPlugin($objUpFile, $plugin_dir, $plugin_code, $_FILES['plugin_file']['name']);
+
+                    // 完了メッセージアラート設定
+                    if(count($this->arrErr) == 0) {
+                        $this->tpl_onload = "alert('プラグインをアップロードしました。');";
+                    }
                 }
             }
+            break;
+        default:
+            break;
         }
-        //        var_dump($arrPlugins);
-        return $arrPlugins;
+
+        // DBからプラグイン情報を取得
+        $this->plugins = SC_Helper_Plugin_Ex::getAllPlugin();
     }
 
     /**
@@ -158,22 +139,183 @@
     }
 
     /**
-     * システム情報を取得する
+     * パラメータ初期化.
      *
-     * @return array
+     * @param object $objFormParam
+     * @return void
+     * 
      */
-    function getSystemInfo() {
-        $objDB = SC_DB_DBFactory_Ex::getInstance();
+    function lfInitParam(&$objFormParam) {
+        $objFormParam->addParam('mode', 'mode', INT_LEN, '', array('ALPHA_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('plugin_id', 'plugin_id', INT_LEN, '', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('plugin_code', 'plugin_code', MTEXT_LEN, '', array('ALPHA_CHECK', 'MAX_LENGTH_CHECK'));
+    }
 
-        $arrSystemInfo = array(
-        array('title' => 'EC-CUBE',  'value' => ECCUBE_VERSION),
-        array('title' => 'OS',       'value' => php_uname()),
-        array('title' => 'DBサーバ',  'value' => $objDB->sfGetDBVersion()),
-        array('title' => 'WEBサーバ', 'value' => $_SERVER['SERVER_SOFTWARE']),
-        array('title' => 'PHP',      'value' => phpversion()),
-        array('title' => 'GD',       'value' => extension_loaded('GD') ? 'Loaded' : '--'),
-        );
+    /**
+     * アップロードファイルパラメータ初期化.
+     *
+     * @param object $objUpFile SC_UploadFileのインスタンス.
+     * @return void
+     */
+    function lfInitUploadFile(&$objUpFile) {
+        $objUpFile->addFile("プラグイン", 'plugin_file', array('tar', 'tar.gz'), TEMPLATE_SIZE, true, 0, 0, false);
+    }
 
-        return $arrSystemInfo;
+    /**
+     * アップロードファイルのエラーチェック.
+     * 
+     * @param string $plugin_code
+     * @param string $plugin_dir
+     * @return array エラー情報を格納した連想配列.
+     * 
+     */
+    function lfCheckErrorUploadFile($plugin_code, $plugin_dir) {
+        $arrErr = array();
+
+        // プラグイン重複チェック
+        $plugins = SC_Helper_Plugin_Ex::getAllPlugin();
+        foreach($plugins as $val) {
+            if($val['plugin_code'] == $plugin_code) {
+                $arrErr['plugin_file'] = "※ 同名のプラグインがすでに登録されています。<br/>";
+            }
+        }
+
+        return $arrErr;
     }
+
+    /**
+     * プラグイン名(物理名)を取得する.
+     * (アップロードされたファイル名をプラグイン名(物理名)とする).
+     * 
+     * @param string $upload_file_name
+     * @return string プラグイン名(物理名).
+     * 
+     */
+    function lfGetPluginCode($upload_file_name) {
+        $array_ext = explode(".", $upload_file_name);
+        return $array_ext[0];
+    }
+
+    /**
+     * プラグイン保存ディレクトリのパスを取得する.
+     *
+     * @param string $plugin_code
+     * @return string プラグイン保存ディレクトリ.
+     * 
+     */
+    function lfGetPluginDir($plugin_code) {
+        $plugin_dir = DATA_REALDIR . 'plugin/' . $plugin_code . '/';
+        return $plugin_dir;
+    }
+
+    /**
+     * プラグインファイルのパスを取得する.
+     * 
+     * @param string $plugin_code
+     * @return string プラグインファイルパス.
+     */
+    function lfGetPluginFilePath($plugin_code) {
+        $plugin_file_path = $this->lfGetPluginDir($plugin_code) . $plugin_code . '.php';
+        return $plugin_file_path;
+    }
+    /**
+     * プラグインをアップロードする.
+     * 
+     * @param object $objUpFile
+     * @param string $plugin_dir
+     * @param string $plugin_code
+     * @param string $plugin_file_name
+     * @return array エラー情報を格納した連想配列.
+     * 
+     */
+    function lfUploadPlugin(&$objUpFile, $plugin_dir, $plugin_code, $plugin_file_name) {
+        $arrErr = array();
+        
+        // 必須チェック
+        $arrErr = $objUpFile->checkEXISTS('plugin_file');
+
+        if(count($arrErr) == 0) {
+            // プラグイン保存ディレクトリ作成
+            if(file_exists($plugin_dir)) {
+                $arrErr['plugin_file'] = "※ 同名のディレクトリがすでに存在します。<br/>";
+            } else {
+                mkdir($plugin_dir);
+            }
+
+            if(count($arrErr) == 0) {
+                // 一時ディレクトリからプラグイン保存ディレクトリへ移動
+                $objUpFile->moveTempFile();
+
+                // プラグイン保存ディレクトリへ解凍
+                SC_Helper_FileManager::unpackFile($plugin_dir . $plugin_file_name);
+
+                // プラグイン情報をDB登録
+                $this->lfRegistData($plugin_dir, $plugin_code);
+            }
+        }
+
+        return $arrErr;
+    }
+
+    /**
+     * プラグイン情報をDB登録.
+     *
+     * @param string $plugin_dir
+     * @param string $plugin_code
+     * @return void
+     *
+     */
+    function lfRegistData($plugin_dir, $plugin_code) {
+        $objQuery =& SC_Query::getSingletonInstance();
+        $sqlval = array();
+        
+        $sqlval['plugin_id'] = $objQuery->nextVal('dtb_plugin_plugin_id');
+        $sqlval['plugin_code'] = $plugin_code;
+        $sqlval['status'] = PLUGIN_STATUS_UPLOADED;
+        $sqlval['enable'] = PLUGIN_ENABLE_FALSE;
+        $sqlval['update_date'] = 'now()';
+        $objQuery->insert('dtb_plugin', $sqlval);
+    }
+
+    /**
+     * プラグインファイルを読み込む.
+     * 
+     * @param string $plugin_code
+     * @return array エラー情報を格納した連想配列.
+     */
+    function lfRequirePluginFile($plugin_code) {
+        $arrErr = array();
+        $plugin_file_path = $this->lfGetPluginFilePath($plugin_code);
+
+        if(file_exists($plugin_file_path)) {
+            require_once($plugin_file_path);
+        } else {
+            $arrErr['plugin_error'] = "※ " . $plugin_code . ".phpが存在しないため実行できません。<br/>";
+        }
+        
+        return $arrErr;
+    }
+
+    /**
+     * プラグインファイルを読み込み、指定されたメソッドを実行する.
+     *
+     * @param integer $plugin_id
+     * @param string $plugin_code
+     * @param string $exec_mode プラグイン実行メソッド名.
+     * @return array エラー情報を格納した連想配列.
+     *
+     */
+    function lfExecPlugin($plugin_id, $plugin_code, $exec_mode) {
+        $arrErr = array();
+
+        // プラグインファイル読み込み
+        $arrErr = $this->lfRequirePluginFile($plugin_code);
+        
+        if(count($arrErr) == 0) {
+            $plugin = new $plugin_code();
+            $arrErr = $plugin->$exec_mode($plugin_id);
+        }
+
+        return $arrErr;
+    }
 }

変更: branches/version-2_5-dev/data/mtb_constants_init.php
===================================================================
--- branches/version-2_5-dev/data/mtb_constants_init.php	2011-02-20 02:53:11 UTC (rev 20245)
+++ branches/version-2_5-dev/data/mtb_constants_init.php	2011-02-20 03:03:00 UTC (rev 20246)
@@ -602,4 +602,12 @@
 define('ECCUBE_INFO', true);
 /** 外部サイトHTTP取得タイムアウト時間(秒) */
 define('HTTP_REQUEST_TIMEOUT', "5");
+/** プラグインの状態:アップロード済み */
+define('PLUGIN_STATUS_UPLOADED', "1");
+/** プラグインの状態:インストール済み */
+define('PLUGIN_STATUS_INSTALLED', "2");
+/** プラグイン有効/無効:有効 */
+define('PLUGIN_ENABLE_TRUE', "1");
+/** プラグイン有効/無効:無効 */
+define('PLUGIN_ENABLE_FALSE', "2");
 ?>

変更: branches/version-2_5-dev/html/install/sql/create_table_mysql.sql
===================================================================
--- branches/version-2_5-dev/html/install/sql/create_table_mysql.sql	2011-02-20 02:53:11 UTC (rev 20245)
+++ branches/version-2_5-dev/html/install/sql/create_table_mysql.sql	2011-02-20 03:03:00 UTC (rev 20246)
@@ -1231,10 +1231,17 @@
 
 CREATE TABLE dtb_plugin (
     plugin_id int NOT NULL,
-    plugin_name varchar(255) NOT NULL,
+    plugin_name varchar(255) NOT NULL DEFAULT '',
+    plugin_code varchar(255) NOT NULL,
+    author varchar(255) NOT NULL DEFAULT '',
+    plugin_site_url varchar(255) NOT NULL DEFAULT '',
+    plugin_version varchar(255) NOT NULL DEFAULT '',
+    plugin_description varchar(255) NOT NULL DEFAULT '',
+    plugin_setting_path varchar(255) NOT NULL DEFAULT '',
+    class_name varchar(255) NOT NULL DEFAULT '',
+    status smallint NOT NULL DEFAULT 0,
     enable smallint NOT NULL DEFAULT 0,
     del_flg smallint NOT NULL DEFAULT 0,
-    class_name varchar(255) NOT NULL,
     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
     update_date timestamp NOT NULL,
     PRIMARY KEY (plugin_id)

変更: branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql
===================================================================
--- branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql	2011-02-20 02:53:11 UTC (rev 20245)
+++ branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql	2011-02-20 03:03:00 UTC (rev 20246)
@@ -1231,10 +1231,17 @@
 
 CREATE TABLE dtb_plugin (
     plugin_id int NOT NULL,
-    plugin_name text NOT NULL,
+    plugin_name text NOT NULL DEFAULT '',
+    plugin_code text NOT NULL,
+    author text NOT NULL DEFAULT '',
+    plugin_site_url text NOT NULL DEFAULT '',
+    plugin_version text NOT NULL DEFAULT '',
+    plugin_description text NOT NULL DEFAULT '',
+    plugin_setting_path text NOT NULL DEFAULT '',
+    class_name text NOT NULL DEFAULT '',
+    status smallint NOT NULL DEFAULT 0,
     enable smallint NOT NULL DEFAULT 0,
     del_flg smallint NOT NULL DEFAULT 0,
-    class_name text NOT NULL,
     create_date timestamp NOT NULL DEFAULT now(),
     update_date timestamp NOT NULL,
     PRIMARY KEY (plugin_id)

変更: branches/version-2_5-dev/html/install/sql/insert_data.sql
===================================================================
--- branches/version-2_5-dev/html/install/sql/insert_data.sql	2011-02-20 02:53:11 UTC (rev 20245)
+++ branches/version-2_5-dev/html/install/sql/insert_data.sql	2011-02-20 03:03:00 UTC (rev 20246)
@@ -1270,6 +1270,10 @@
 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('UNLIMITED_FLG_LIMITED', '"0"', 1217, '無制限フラグ: 制限有り');
 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('ECCUBE_INFO', 'true', 1218, ' EC-CUBE更新情報取得 (true:取得する false:取得しない)');
 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('HTTP_REQUEST_TIMEOUT', '"5"', 1219, '外部サイトHTTP取得タイムアウト時間(秒)');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_STATUS_UPLOADED', '"1"', 1220, 'プラグインの状態:アップロード済み');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_STATUS_INSTALLED', '"2"', 1221, 'プラグインの状態:インストール済み');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_ENABLE_TRUE', '"1"', 1222, 'プラグイン有効/無効:有効');
+INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_ENABLE_FALSE', '"2"', 1223, 'プラグイン有効/無効:無効');
 
 INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_customer', 'email_mobile', 0, '会員数増加時のログイン処理速度を向上させたいときに試してみてください');
 INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_products', 'name', 2, '商品名検索速度を向上させたいときに試してみてください');




Svn-src-all メーリングリストの案内