Changeset 22661
- Timestamp:
- 2013/03/10 00:12:41 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/camp/camp-2_13-plugin/data/class/plugin/SC_Plugin_Installer.php
r22655 r22661 23 23 class SC_Plugin_Installer { 24 24 25 protected $plugin_code; 26 25 27 protected $arrPlugin; 26 28 … … 28 30 29 31 function __construct($arrPlugin) { 30 $this->arrPlugin = $arrPlugin; 32 $this->arrPlugin = $arrPlugin; 33 $this->arrInstallData = array(); 34 $this->arrInstallData['sql'] = array(); 35 $this->arrInstallData['copy_file'] = array(); 36 $this->arrInstallData['copy_direcrtory'] = array(); 37 $this->arrInstallData['remove_file'] = array(); 38 $this->arrInstallData['remove_directory'] = array(); 31 39 } 32 40 … … 40 48 41 49 // テーブル作成SQLなどを実行 42 $arrSql = $this->arrInstallData[ $plugin_code]['sql'];50 $arrSql = $this->arrInstallData['sql']; 43 51 44 52 foreach ($arrSql as $sql) { … … 46 54 $objQuery->query($sql['sql'], $sql['params']); 47 55 } 48 56 49 57 // プラグインのディレクトリコピー 50 $arrCopyDirectories = $this->arrInstallData[ $plugin_code]['copy_directory'];58 $arrCopyDirectories = $this->arrInstallData['copy_directory']; 51 59 52 60 foreach ($arrCopyDirectories as $directory) { … … 59 67 60 68 // プラグインのファイルコピー 61 $arrCopyFiles = $this->arrInstallData[ $plugin_code]['copy_file'];69 $arrCopyFiles = $this->arrInstallData['copy_file']; 62 70 63 71 foreach ($arrCopyFiles as $file) { … … 74 82 75 83 function copyFile($src, $dist) { 76 $plugin_code = $this->arrPlugin['plugin_code']; 77 $this->arrInstallData[$plugin_code]['copy_file'][] = array( 84 $this->arrInstallData['copy_file'][] = array( 78 85 'src' => $src, 79 86 'dist' => $dist 80 87 ); 81 88 } 82 89 83 90 function copyDirectory($src, $dist) { 84 $plugin_code = $this->arrPlugin['plugin_code']; 85 $this->arrInstallData[$plugin_code]['copy_directory'][] = array( 91 $this->arrInstallData['copy_directory'][] = array( 86 92 'src' => $src, 87 93 'dist' => $dist 88 94 ); 89 95 } 90 96 91 97 function removeFile($dist) { 92 98 $this->arrInstallData['remove_file'][] = array( 99 'dist' => $dist 100 ); 93 101 } 94 102 103 function removeDirectory($dist) { 104 $this->arrInstallData['remove_file'][] = array( 105 'dist' => $dist 106 ); 107 } 108 95 109 public function sql($sql, array $params = array()) { 96 $plugin_code = $this->arrPlugin['plugin_code']; 97 $this->arrInstallData[$plugin_code]['sql'][] = array( 110 $this->arrInstallData['sql'][] = array( 98 111 'sql' => $sql, 99 112 'params' => $params
Note: See TracChangeset
for help on using the changeset viewer.
