Changeset 22685


Ignore:
Timestamp:
2013/03/10 05:14:39 (11 years ago)
Author:
adachi
Message:

#2181 execPluginに統合

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/camp/camp-2_13-plugin/data/class/plugin/SC_Plugin_Installer.php

    r22683 r22685  
    4646    } 
    4747     
    48     public function execInstall() { 
    49         GC_Utils_Ex::gfPrintLog("start install: " . $this->arrPlugin['plugin_code']); 
    50          
    51         $plugin_code = $this->arrPlugin['plugin_code']; 
    52  
    53         $objQuery =& SC_Query::getSingletonInstance(); 
    54          
    55         // テーブル作成SQLなどを実行 
    56         $arrSql = $this->arrInstallData['sql']; 
    57          
    58         foreach ($arrSql as $sql) { 
    59             GC_Utils_Ex::gfPrintLog("exec sql:" . $sql['sql']); 
    60             $objQuery->query($sql['sql'], $sql['params']); 
    61         } 
    62          
    63         $arrInsertQuery = $this->arrInstallData['insert']; 
    64         foreach ($arrInsertQuery as $insertQuery) { 
    65             $objQuery->insert( 
    66                     $insertQuery['table'], 
    67                     $insertQuery['arrVal'], 
    68                     $insertQuery['arrSql'], 
    69                     $insertQuery['arrSqlVal'], 
    70                     $insertQuery['form'], 
    71                     $insertQuery['arrFromVal'] 
    72                     ); 
    73         } 
    74          
    75              
    76         $arrInsertQuery = $this->arrInstallData['update']; 
    77         foreach ($arrInsertQuery as $insertQuery) { 
    78             $objQuery->update( 
    79                     $insertQuery['table'], 
    80                     $insertQuery['arrVal'], 
    81                     $insertQuery['where'], 
    82                     $insertQuery['arrWhereVal'], 
    83                     $insertQuery['arrRawSql'], 
    84                     $insertQuery['arrRawSqlVal'] 
    85                     ); 
    86         } 
    87                              
    88         // プラグインのディレクトリコピー 
    89         $arrCopyDirectories = $this->arrInstallData['copy_directory']; 
    90  
    91         foreach ($arrCopyDirectories as $directory) { 
    92             GC_Utils_Ex::gfPrintLog("exec dir copy:" . $directory['src']); 
    93             // ディレクトリコピー -> HTML配下とDATA配下を別関数にする 
    94             SC_Utils::copyDirectory( 
    95                     PLUGIN_UPLOAD_REALDIR . $plugin_code . DIRECTORY_SEPARATOR . $directory['src'], 
    96                     PLUGIN_HTML_REALDIR   . $plugin_code . DIRECTORY_SEPARATOR . $directory['dist']); 
    97         } 
    98  
    99         // プラグインのファイルコピー 
    100         $arrCopyFiles = $this->arrInstallData['copy_file']; 
    101  
    102         foreach ($arrCopyFiles as $file) { 
    103             GC_Utils_Ex::gfPrintLog("exec file copy:" . $file['src']); 
    104             // ファイルコピー 
    105             copy(PLUGIN_UPLOAD_REALDIR . $plugin_code . DIRECTORY_SEPARATOR . $file['src'], 
    106                  PLUGIN_HTML_REALDIR   . $plugin_code . DIRECTORY_SEPARATOR . $file['dist']); 
    107         } 
    108  
    109         GC_Utils_Ex::gfPrintLog("end install: " . $this->arrPlugin['plugin_code']); 
    110     } 
    111      
    11248    public function execPlugin() { 
    11349        $this->log("start"); 
Note: See TracChangeset for help on using the changeset viewer.