Changeset 21563 for branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php
- Timestamp:
- 2012/02/28 22:35:14 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php
r21555 r21563 85 85 $upload_file_file_name = $upload_file['name']; 86 86 // インストール処理. 87 $this->arrErr = $this->installPlugin($upload_file_file_name, "plugin_file");87 $this->arrErr = $this->installPlugin($upload_file_file_name, 'plugin_file'); 88 88 if ($this->isError($this->arrErr) === false) { 89 89 // コンパイルファイルのクリア処理 … … 147 147 $target_plugin_code = $objFormParam->getValue('plugin_code'); // アップデート対象のプラグインコード 148 148 $this->arrErr = $this->checkUploadFile($target_plugin_code); 149 149 150 150 if ($this->isError($this->arrErr) === false) { 151 151 $update_plugin_file = $_FILES[$target_plugin_code]; … … 333 333 } 334 334 // plugin_infoを読み込み. 335 $arrErr = $this->requirePluginFile(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR . "plugin_info.php", $key);335 $arrErr = $this->requirePluginFile(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR . 'plugin_info.php', $key); 336 336 if ($this->isError($arrErr) === true) { 337 337 $this->rollBack(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR); 338 338 return $arrErr; 339 339 } 340 340 341 341 // リフレクションオブジェクトを生成. 342 $objReflection = new ReflectionClass( "plugin_info");342 $objReflection = new ReflectionClass('plugin_info'); 343 343 // プラグインクラスに必須となるパラメータが正常に定義されているかチェックします. 344 344 $arrErr = $this->checkPluginConstants($objReflection, DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR); … … 347 347 return $arrErr; 348 348 } 349 349 350 350 // プラグインコード 351 351 $plugin_code = $objReflection->getConstant('PLUGIN_CODE'); 352 352 // プラグイン名 353 353 $plugin_name = $objReflection->getConstant('PLUGIN_NAME'); 354 354 355 355 // 既にインストールされていないかを判定. 356 356 if ($this->isInstalledPlugin($plugin_code) === true) { 357 357 $this->rollBack(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR); 358 $arrErr['plugin_file'] = "※ " . $plugin_name . "は既にインストールされています。<br/>";358 $arrErr['plugin_file'] = '※ ' . $plugin_name . 'は既にインストールされています。<br/>'; 359 359 return $arrErr; 360 360 } … … 366 366 return $arrErr; 367 367 } 368 368 369 369 // プラグイン保存ディレクトリを作成し、一時展開用ディレクトリから移動します. 370 $plugin_dir_path = PLUGIN_UPLOAD_REALDIR . $plugin_code . "/";370 $plugin_dir_path = PLUGIN_UPLOAD_REALDIR . $plugin_code . '/'; 371 371 $this->makeDir($plugin_dir_path); 372 372 SC_Utils_Ex::copyDirectory(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR, $plugin_dir_path); … … 374 374 // プラグイン情報を取得 375 375 $plugin = SC_Helper_Plugin_Ex::getPluginByPluginCode($plugin_code); 376 376 377 377 // クラスファイルを読み込み. 378 $plugin_class_file_path = $plugin_dir_path . $plugin['class_name'] . ".php";378 $plugin_class_file_path = $plugin_dir_path . $plugin['class_name'] . '.php'; 379 379 $arrErr = $this->requirePluginFile($plugin_class_file_path, $key); 380 380 if ($this->isError($arrErr) === true) { … … 385 385 $plugin_html_dir = PLUGIN_HTML_REALDIR . $plugin_code; 386 386 $this->makeDir($plugin_html_dir); 387 387 388 388 $arrErr = $this->execPlugin($plugin['plugin_id'], $plugin['class_name'], 'install'); 389 389 if ($this->isError($arrErr) === true) { … … 391 391 return $arrErr; 392 392 } 393 393 394 394 // 不要なファイルの削除 395 395 SC_Utils_EX::deleteFile(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR, false); 396 396 return $arrErr; 397 397 } 398 398 399 399 /** 400 400 * ロールバック処理 … … 405 405 * @param string $plugin_html_dir プラグイン毎に生成されるhtmlディレクトリのパス. 406 406 */ 407 function rollBack($temp_dir, $plugin_id = "", $plugin_html_dir ="") {407 function rollBack($temp_dir, $plugin_id = '', $plugin_html_dir ='') { 408 408 // 一時ディレクトリを削除. 409 409 SC_Utils_Ex::deleteFile($temp_dir, false); … … 432 432 return $arrErr; 433 433 } 434 $class_name = $objReflection->getConstant('CLASS_NAME') . ".php";434 $class_name = $objReflection->getConstant('CLASS_NAME') . '.php'; 435 435 if ($class_name === false ||file_exists($unpack_dir . $class_name) === false) { 436 436 $arrErr['plugin_file'] = '※ CLASS_NAMEが定義されていません。またはCLASS_NAMEが正しく定義されていません。<br/>'; … … 492 492 return $arrErr; 493 493 } 494 494 495 495 // plugin_infoを読み込み. 496 $arrErr = $this->requirePluginFile(DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR . "plugin_info.php", $target_plugin['plugin_code']);496 $arrErr = $this->requirePluginFile(DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR . 'plugin_info.php', $target_plugin['plugin_code']); 497 497 if ($this->isError($arrErr) === true) { 498 498 $this->rollBack(DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR); 499 499 return $arrErr; 500 500 } 501 501 502 502 // リフレクションオブジェクトを生成. 503 $objReflection = new ReflectionClass( "plugin_info");503 $objReflection = new ReflectionClass('plugin_info'); 504 504 // プラグインクラスに必須となるパラメータが正常に定義されているかチェックします. 505 505 $arrErr = $this->checkPluginConstants($objReflection, DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR); … … 508 508 return $arrErr; 509 509 } 510 510 511 511 // プラグインのクラス名を取得; 512 512 $class_name = $objReflection->getConstant('CLASS_NAME'); 513 513 514 514 // 展開されたディレクトリからプラグインクラスファイルを読み込みます. 515 515 $update_plugin_class_path = DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR . $class_name . '.php'; … … 521 521 // プラグインクラスファイルのUPDATE処理を実行. 522 522 $arrErr = $this->execPlugin($plugin_id, $class_name, 'update'); 523 523 524 524 // 保存ディレクトリの削除. 525 525 SC_Utils_Ex::deleteFile(DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR, false); 526 526 527 527 return $arrErr; 528 528 } … … 545 545 return $arrErr; 546 546 } 547 547 548 548 // 正常にアップロードされているかをチェック. 549 549 $arrErr = $objUpFile->checkEXISTS($file_key); … … 570 570 $arrErr = array(); 571 571 // プラグインファイルを読み込みます. 572 $plugin_class_file_path = PLUGIN_UPLOAD_REALDIR . $plugin['plugin_code'] . "/" . $plugin['class_name'] . ".php";572 $plugin_class_file_path = PLUGIN_UPLOAD_REALDIR . $plugin['plugin_code'] . '/' . $plugin['class_name'] . '.php'; 573 573 $arrErr = $this->requirePluginFile($plugin_class_file_path, 'plugin_error'); 574 574 if ($this->isError($arrErr) === true) { … … 595 595 $arrErr = array(); 596 596 // クラスファイルを読み込み. 597 $plugin_class_file_path = PLUGIN_UPLOAD_REALDIR . $plugin['plugin_code'] . "/" . $plugin['class_name'] . ".php";597 $plugin_class_file_path = PLUGIN_UPLOAD_REALDIR . $plugin['plugin_code'] . '/' . $plugin['class_name'] . '.php'; 598 598 $arrErr = $this->requirePluginFile($plugin_class_file_path, 'plugin_error'); 599 599 if ($this->isError($arrErr) === true) { … … 620 620 $arrErr = array(); 621 621 // クラスファイルを読み込み. 622 $plugin_class_file_path = PLUGIN_UPLOAD_REALDIR . $plugin['plugin_code'] . "/" . $plugin['class_name'] . ".php";622 $plugin_class_file_path = PLUGIN_UPLOAD_REALDIR . $plugin['plugin_code'] . '/' . $plugin['class_name'] . '.php'; 623 623 $arrErr = $this->requirePluginFile($plugin_class_file_path, 'plugin_error'); 624 624 if ($this->isError($arrErr) === true) { … … 718 718 require_once $file_path; 719 719 } else { 720 $arrErr[$key] = "※ " . $file_path ."の読み込みに失敗しました。<br/>";720 $arrErr[$key] = '※ ' . $file_path .'の読み込みに失敗しました。<br/>'; 721 721 } 722 722 return $arrErr;
Note: See TracChangeset
for help on using the changeset viewer.