function update(array $arrPlugin, SC_Plugin_Installer $installer) { $base_dir = dirname(__FILE__); GC_Utils_Ex::gfPrintLog("[" . $arrPlugin["plugin_code"] . "]更新処理を実行します。", PLUGIN_LOG_REALFILE, FALSE); $log = ""; $xdir = PLUGIN_UPLOAD_REALDIR . $arrPlugin["plugin_code"]; if (!is_dir($xdir . "_" . date("Ymd") . "/")) { rename($xdir . "/", $xdir . "_" . date("Ymd") . "/"); } SC_Helper_FileManager_Ex::deleteFile($xdir . "/", false); $log .= SC_Utils_Ex::sfCopyDir("{$base_dir}/", PLUGIN_UPLOAD_REALDIR . $arrPlugin["plugin_code"] . "/", '', true); // logo コピー $installer->copyDirectory("copy/plugin_dir/", ""); GC_Utils_Ex::gfPrintLog($log, PLUGIN_LOG_REALFILE, false); $core = new SupportDeviceCore($arrPlugin); $plugin_version = $arrPlugin["plugin_version"]; switch ($plugin_version) { case "0.0.0": case "0.0.1": // 再インストール $core->install($arrPlugin, $installer); $core->update($arrPlugin, $installer, "0.0.0"); break; default: $core->update($arrPlugin, $installer, $plugin_version); break; } $core->createCash(); $objQuery = SC_Query_Ex::getSingletonInstance(); $objQuery->begin(); GC_Utils_Ex::gfPrintLog("[" . $arrPlugin["plugin_code"] . "]更新処理を実行完了しました。", PLUGIN_LOG_REALFILE, FALSE); }
/** * 受注を完了する. * * 下記のフローで受注を完了する. * * 1. トランザクションを開始する * 2. カートの内容を検証する. * 3. 受注一時テーブルから受注データを読み込む * 4. ユーザーがログインしている場合はその他の発送先へ登録する * 5. 受注データを受注テーブルへ登録する * 6. トランザクションをコミットする * * 実行中に, 何らかのエラーが発生した場合, 処理を中止しエラーページへ遷移する * * 決済モジュールを使用する場合は対応状況を「決済処理中」に設定し, * 決済完了後「新規受付」に変更すること * * @param integer $orderStatus 受注処理を完了する際に設定する対応状況 * @return void */ function completeOrder($orderStatus = ORDER_NEW) { $objQuery =& SC_Query_Ex::getSingletonInstance(); $objSiteSession = new SC_SiteSession_Ex(); $objCartSession = new SC_CartSession_Ex(); $objCustomer = new SC_Customer_Ex(); $customerId = $objCustomer->getValue('customer_id'); $objQuery->begin(); if (!$objSiteSession->isPrePage()) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, $objSiteSession); } $uniqId = $objSiteSession->getUniqId(); $this->verifyChangeCart($uniqId, $objCartSession); $orderTemp = $this->getOrderTemp($uniqId); $orderTemp['status'] = $orderStatus; $cartkey = $objCartSession->getKey(); $order_id = $this->registerOrderComplete($orderTemp, $objCartSession, $cartkey); $isMultiple = SC_Helper_Purchase::isMultiple(); $shippingTemp =& $this->getShippingTemp($isMultiple); foreach ($shippingTemp as $shippingId => $val) { $this->registerShipmentItem($order_id, $shippingId, $val['shipment_item']); } $this->registerShipping($order_id, $shippingTemp); $objQuery->commit(); //会員情報の最終購入日、購入合計を更新 if ($customerId > 0) { SC_Customer_Ex::updateOrderSummary($customerId); } $this->cleanupSession($order_id, $objCartSession, $objCustomer, $cartkey); GC_Utils_Ex::gfPrintLog('order complete. order_id=' . $order_id); }
/** * Page のアクション. * * @return void */ public function action() { $masterData = new SC_DB_MasterData_Ex(); $this->arrMasterDataName = $this->getMasterDataNames(array()); // システム固定 if (is_array($_POST)) { GC_Utils_Ex::gfDebugLog($_POST); $temp = $_POST; } else { $temp = array(); } $temp["master_data_name"] = "cp_mtb_android_os_version"; switch ($this->getMode()) { case 'edit': // POST 文字列の妥当性チェック $this->masterDataName = $this->checkMasterDataName($temp, $this->arrMasterDataName); $this->errorMessage = $this->checkUniqueID($temp); if (empty($this->errorMessage)) { // 取得したデータからマスターデータを生成 $this->registMasterData($temp, $masterData, $this->masterDataName); $this->tpl_onload = "window.alert('マスターデータの設定が完了しました。');"; } // FIXME break 入れ忘れと思われる。そうでないなら、要コメント。 // FIXME break 入れ忘れと思われる。そうでないなら、要コメント。 default: case 'show': // POST 文字列の妥当性チェック $this->masterDataName = $this->checkMasterDataName($temp, $this->arrMasterDataName); // DB からマスターデータを取得 $this->arrMasterData = $masterData->getDbMasterData($this->masterDataName); break; } }
/** * Page のアクション. * * @return void */ public function action() { // チェック後のデータを格納 $arrClean = array(); // $_GET['move'] が想定値かどうかチェック switch ($_GET['move']) { case 'up': case 'down': $arrClean['move'] = $_GET['move']; break; default: $arrClean['move'] = ''; break; } // 正当な数値であればOK if (SC_Utils_Ex::sfIsInt($_GET['id'])) { $arrClean['id'] = $_GET['id']; switch ($arrClean['move']) { case 'up': $this->lfRunkUp($arrClean['id']); break; case 'down': $this->lfRunkDown($arrClean['id']); break; default: break; } } else { GC_Utils_Ex::gfPrintLog('error id=' . $_GET['id']); } // ページの表示 SC_Response_Ex::sendRedirect(ADMIN_SYSTEM_URLPATH); }
function LC_Page_Admin_System_Log_action_after(LC_Page_Admin_System_Log $objPage) { if (defined("UNSUPPORTED_DEVICE_LOG_REALFILE") && strlen(UNSUPPORTED_DEVICE_LOG_REALFILE) > 0) { $objPage->arrLogList["UNSUPPORTED_DEVICE"] = "非対応端末ログ"; } GC_Utils_Ex::gfPrintLog(print_r($objPage->arrLogList, true), DEBUG_LOG_REALFILE); }
/** * 有効なプラグインのロード. プラグインエンジンが有効になっていない場合は * プラグインエンジン自身のインストール処理を起動する * * @return void */ function load($plugin_activate_flg = true) { if (!defined('CONFIG_REALFILE') || !file_exists(CONFIG_REALFILE)) { return; } // インストール前 if (GC_Utils_Ex::isInstallFunction()) { return; } // インストール中 if ($plugin_activate_flg === false) { return; } // 有効なプラグインを取得 $arrPluginDataList = SC_Plugin_Util_Ex::getEnablePlugin(); // pluginディレクトリを取得 $arrPluginDirectory = SC_Plugin_Util_Ex::getPluginDirectory(); foreach ($arrPluginDataList as $arrPluginData) { // プラグイン本体ファイル名が取得したプラグインディレクトリ一覧にある事を確認 if (array_search($arrPluginData['plugin_code'], $arrPluginDirectory) !== false) { // プラグイン本体ファイルをrequire. require_once PLUGIN_UPLOAD_REALDIR . $arrPluginData['plugin_code'] . '/' . $arrPluginData['class_name'] . '.php'; // プラグインのインスタンス生成. $objPlugin = new $arrPluginData['class_name']($arrPluginData); // メンバ変数にプラグインのインスタンスを登録. $this->arrPluginInstances[$arrPluginData['plugin_id']] = $objPlugin; $this->arrPluginIds[] = $arrPluginData['plugin_id']; // ローカルフックポイントの登録. $this->registerLocalHookPoint($objPlugin, $arrPluginData['priority']); // スーパーフックポイントの登録. $this->registerSuperHookPoint($objPlugin, HOOK_POINT_PREPROCESS, 'preProcess', $arrPluginData['priority']); $this->registerSuperHookPoint($objPlugin, HOOK_POINT_PROCESS, 'process', $arrPluginData['priority']); } } }
function update(array $arrPlugin, SC_Plugin_Installer $installer) { $plugin_code = $arrPlugin["plugin_code"]; GC_Utils_Ex::gfPrintLog("[{$plugin_code}]更新処理を実行します。", PLUGIN_LOG_REALFILE, FALSE); SC_Utils_Ex::copyDirectory(dirname(__FILE__) . "/", PLUGIN_UPLOAD_REALDIR . $plugin_code . "/"); require_once dirname(__FILE__) . '/AutoDisplayCore.php'; $core = new AutoDisplayCore($arrPlugin); $core->install($arrPlugin, $installer); GC_Utils_Ex::gfPrintLog("[{$plugin_code}]更新処理を実行完了しました。", PLUGIN_LOG_REALFILE, FALSE); }
/** * ブロックファイルに応じて tpl_mainpage を設定する * * @param string $bloc_file ブロックファイル名 * @return void */ function setTplMainpage($bloc_file) { if (SC_Utils_Ex::isAbsoluteRealPath($bloc_file)) { $this->tpl_mainpage = $bloc_file; } else { $this->tpl_mainpage = SC_Helper_PageLayout_Ex::getTemplatePath($this->objDisplay->detectDevice()) . BLOC_DIR . $bloc_file; } $this->setTemplate($this->tpl_mainpage); $debug_message = "block:" . $this->tpl_mainpage . "\n"; GC_Utils_Ex::gfDebugLog($debug_message); }
/** * フックポイント. * * @param LC_Page $objPage */ function preProcess(LC_Page $objPage) { if (!extension_loaded("dom")) { SC_Utils_Ex::sfErrorHeader("dom extension が有効でないため キャリアIDによるログインができません。"); } if (GC_Utils_Ex::isFrontFunction()) { $xrds = new Net_URL(ROOT_URLPATH . 'au/xrds.php'); $xrds = $xrds->getURL(); header("X-XRDS-Location: {$xrds}"); header("X-Content-TYpe-Options: nosniff"); } }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { define('SKIP_MOBILE_INIT', true); if (isset($_GET['token'])) { $next_url = GC_Utils_Ex::gfFinishKaraMail($_GET['token']); } // $next_url には, セッションID付与済み if (isset($next_url) && $next_url !== false) { $this->sendRedirect($next_url); } else { $this->sendRedirect(MOBILE_SITE_URL, true); } }
public function log($message, $type = Zeclib_MigrationLogger::TYPE_INFO) { switch ($type) { case Zeclib_MigrationLogger::TYPE_DEBUG: GC_Utils_Ex::gfPrintLog($message, DEBUG_LOG_REALFILE); break; case Zeclib_MigrationLogger::TYPE_WARNING: case Zeclib_MigrationLogger::TYPE_ERROR: GC_Utils_Ex::gfPrintLog($message, ERROR_LOG_REALFILE); break; default: GC_Utils_Ex::gfPrintLog($message, $this->defaultLogFile); break; } }
/** * Page のアクション. * * @return void */ function action() { $objFormParam = new SC_FormParam_Ex(); // パラメーターの初期化 $this->initParam($objFormParam, $_GET); // パラメーターの検証 if ($objFormParam->checkError() || !SC_Utils_ex::sfIsInt($id = $objFormParam->getValue('id'))) { GC_Utils_Ex::gfPrintLog("error id={$id}"); SC_Utils_Ex::sfDispError(INVALID_MOVE_ERRORR); } $id = $objFormParam->getValue('id'); // レコードの削除 $this->deleteMember($id); // リダイレクト $url = $this->getLocation(ADMIN_SYSTEM_URLPATH) . '?pageno=' . $objFormParam->getValue('pageno'); SC_Response_Ex::sendRedirect($url); }
/** * Page のアクション. * * @return void */ public function action() { $objFormParam = new SC_FormParam_Ex(); $this->initParam($objFormParam); $objFormParam->setParam($_POST); $this->arrForm = $objFormParam->getHashArray(); $this->arrHidden = $objFormParam->getSearchArray(); $objQuery = SC_Query_Ex::getSingletonInstance(); GC_Utils_Ex::gfPrintLog(print_r($objFormParam->getHashArray(), true), DEBUG_LOG_REALFILE); GC_Utils_Ex::gfPrintLog(print_r($_POST, true), DEBUG_LOG_REALFILE); switch ($this->getMode()) { case "csv": $this->doCheck($objQuery, $objFormParam); $this->doSearchCsv($objQuery, $objFormParam); break; case "return": case "search": case "change_status": case "initialize_device_product": case "delete": $this->doCheck($objQuery, $objFormParam); switch ($this->getMode()) { default: case "return": case "search": break; case "change_status": $this->doChangeStatus($objQuery, $objFormParam); break; case "initialize_device_product": $this->doProductSupportinitial($objQuery, $objFormParam); break; case "delete": $this->doDelete($objQuery, $objFormParam); break; } $this->doSearch($objQuery, $objFormParam); break; case 'csv_upload': case "add_csv": SC_Response_Ex::sendRedirect("device_android_csv.php", array(), false); break; default: break; } }
/** * Page のプロセス. * * @return void */ function process() { $objThumb = new gdthumb(); $objBlob = new SC_Helper_Blob_Ex(); $file = NO_IMAGE_REALDIR; // NO_IMAGE_REALDIR以外のファイル名が渡された場合、ファイル名のチェックを行う if (strlen($_GET['image']) >= 1 && $_GET['image'] !== NO_IMAGE_REALDIR) { // ファイル名が正しく、ファイルが存在する場合だけ、$fileを設定 if (!$this->lfCheckFileName()) { GC_Utils_Ex::gfPrintLog('invalid access :resize_image.php $_GET[\'image\']=' . $_GET['image']); } else { $objBlob->getBlob("saveimage", $_GET['image'], IMAGE_TEMP_REALDIR . $_GET['image']); $file = IMAGE_TEMP_REALDIR . $_GET['image']; } } $ret = $objThumb->Main($file, $_GET['width'], $_GET['height'], "", true); }
/** * 有効なプラグインのロード. プラグインエンジンが有効になっていない場合は * プラグインエンジン自身のインストール処理を起動する * * @return void */ public function load($plugin_activate_flg = true) { if (!defined('CONFIG_REALFILE') || !file_exists(CONFIG_REALFILE)) { return; } // インストール前 if (GC_Utils_Ex::isInstallFunction()) { return; } // インストール中 if ($plugin_activate_flg === false) { return; } // 有効なプラグインを取得 $arrPluginDataList = SC_Plugin_Util_Ex::getEnablePlugin(); // pluginディレクトリを取得 $arrPluginDirectory = SC_Plugin_Util_Ex::getPluginDirectory(); foreach ($arrPluginDataList as $arrPluginData) { // プラグイン本体ファイル名が取得したプラグインディレクトリ一覧にある事を確認 if (array_search($arrPluginData['plugin_code'], $arrPluginDirectory) !== false) { $plugin_file_path = PLUGIN_UPLOAD_REALDIR . $arrPluginData['plugin_code'] . '/' . $arrPluginData['class_name'] . '.php'; // プラグイン本体ファイルが存在しない場合 if (!file_exists($plugin_file_path)) { // エラー出力 $msg = 'プラグイン本体ファイルが存在しない。当該プラグインを無視して続行する。'; $msg .= 'ファイル=' . var_export($plugin_file_path, true) . '; '; trigger_error($msg, E_USER_WARNING); // 次のプラグインへ続行 continue 1; } // プラグイン本体ファイルをrequire. require_once $plugin_file_path; // プラグインのインスタンス生成. $objPlugin = new $arrPluginData['class_name']($arrPluginData); // メンバ変数にプラグインのインスタンスを登録. $this->arrPluginInstances[$arrPluginData['plugin_id']] = $objPlugin; $this->arrPluginIds[] = $arrPluginData['plugin_id']; // ローカルフックポイントの登録. $this->registerLocalHookPoint($objPlugin, $arrPluginData['priority']); // スーパーフックポイントの登録. $this->registerSuperHookPoint($objPlugin, HOOK_POINT_PREPROCESS, 'preProcess', $arrPluginData['priority']); $this->registerSuperHookPoint($objPlugin, HOOK_POINT_PROCESS, 'process', $arrPluginData['priority']); } } }
/** * Page のプロセス. * * @return void */ function process() { $objThumb = new gdthumb(); $file = NO_IMAGE_DIR; // NO_IMAGE_DIR以外のファイル名が渡された場合、ファイル名のチェックを行う if (isset($_GET['image']) && $_GET['image'] !== NO_IMAGE_DIR) { // ファイル名が正しい場合だけ、$fileを設定 if ($this->lfCheckFileName() === true) { $file = IMAGE_SAVE_DIR . $_GET['image']; } else { GC_Utils_Ex::gfPrintLog('invalid access :resize_image.php $_GET["image"]=' . $_GET['image']); } } if (file_exists($file)) { $objThumb->Main($file, $_GET["width"], $_GET["height"], "", true); } else { $objThumb->Main(NO_IMAGE_DIR, $_GET["width"], $_GET["height"], "", true); } }
/** * Page のAction. * * @return void */ function action() { $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_GET); $arrForm = $objFormParam->getHashArray(); $file = NO_IMAGE_REALFILE; // NO_IMAGE_REALFILE以外のファイル名が渡された場合、ファイル名のチェックを行う if (strlen($arrForm['image']) >= 1 && $arrForm['image'] !== NO_IMAGE_REALFILE) { // ファイル名が正しく、ファイルが存在する場合だけ、$fileを設定 if (!$this->lfCheckFileName()) { GC_Utils_Ex::gfPrintLog('invalid access :resize_image.php image=' . $arrForm['image']); } elseif (file_exists(IMAGE_SAVE_REALDIR . $arrForm['image'])) { $file = IMAGE_SAVE_REALDIR . $arrForm['image']; } } // リサイズ画像の出力 $this->lfOutputImage($file, $arrForm['width'], $arrForm['height']); }
/** * enableかどうかを判別する * インスタンス化 */ function load(&$lcpage) { //データベースからクラス名を読み込む $objQuery = new SC_Query_Ex(); $col = "*"; $table = "dtb_plugin"; $where = "enable = 1 AND del_flg = 0"; // XXX 2.11.0 互換のため $arrCols = $objQuery->listTableFields($table); if (in_array('rank', $arrCols)) { $objQuery->setOrder('rank'); } $arrRet = $objQuery->select($col, $table, $where); $class_name = get_class($lcpage); // 現在のページで使用するプラグインが存在するかどうかを検証する foreach ($arrRet as $plugins) { // プラグインを稼働させるクラス名のリストを取得する // プラグインのディレクトリ内の設定ファイルを参照する $plugin_name = $plugins['plugin_name']; $plugin_class_name = $plugins['class_name']; $plugin_path = DATA_REALDIR . "plugin/{$plugin_name}/{$plugin_class_name}.php"; if (file_exists($plugin_path)) { require_once $plugin_path; if (class_exists($class_name)) { $code_str = "\$is_enable = {$plugin_class_name}::isEnable(\$class_name);"; eval($code_str); if ($is_enable) { $arrPluginList[] = $plugin_class_name; GC_Utils_Ex::gfDebugLog($class_name . ' で、プラグイン ' . $plugin_name . ' をロードしました'); } else { GC_Utils_Ex::gfDebugLog($class_name . ' で、プラグイン ' . $plugin_name . ' は無効になっています'); } } else { GC_Utils_Ex::gfDebugLog('プラグイン ' . $plugin_name . ' の ' . $class_name . ' が見つかりませんでした'); } } else { GC_Utils_Ex::gfDebugLog('プラグイン ' . $plugin_name . " が読み込めませんでした。\n" . 'Failed opening required ' . $plugin_path); } } return $arrPluginList; }
/** * ページのレイアウト情報を取得し, 設定する. * * 現在の URL に応じたページのレイアウト情報を取得し, LC_Page インスタンスに * 設定する. * * @access public * @param LC_Page $objPage LC_Page インスタンス * @param boolean $preview プレビュー表示の場合 true * @param string $url ページのURL($_SERVER['SCRIPT_NAME'] の情報) * @param integer $device_type_id 端末種別ID * @return void */ function sfGetPageLayout(&$objPage, $preview = false, $url = '', $device_type_id = DEVICE_TYPE_PC) { // URLを元にページ情報を取得 if ($preview === false) { $url = preg_replace('|^' . preg_quote(ROOT_URLPATH) . '|', '', $url); $arrPageData = $this->getPageProperties($device_type_id, null, 'url = ?', array($url)); } else { $arrPageData = $this->getPageProperties($device_type_id, 0); } $objPage->tpl_mainpage = $this->getTemplatePath($device_type_id) . $arrPageData[0]['filename'] . '.tpl'; $objPage->arrPageLayout =& $arrPageData[0]; // ページタイトルを設定 if (SC_Utils_Ex::isBlank($objPage->tpl_title)) { $objPage->tpl_title = $objPage->arrPageLayout['page_name']; } // 該当ページのブロックを取得し, 配置する $masterData = new SC_DB_MasterData_Ex(); $arrTarget = $masterData->getMasterData('mtb_target'); $arrBlocs = $this->getBlocPositions($device_type_id, $objPage->arrPageLayout['page_id']); var_dump($arrTarget); var_dump($arrBlocs); // 無効なプラグインのブロックを取り除く. $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance(); $arrBlocs = $objPlugin->getEnableBlocs($arrBlocs); // php_path, tpl_path が存在するものを, 各ターゲットに配置 foreach ($arrTarget as $target_id => $value) { foreach ($arrBlocs as $arrBloc) { if ($arrBloc['target_id'] != $target_id) { continue; } if (is_file($arrBloc['php_path']) || is_file($arrBloc['tpl_path'])) { $objPage->arrPageLayout[$arrTarget[$target_id]][] = $arrBloc; } else { $error = "ブロックが見つかりません\n" . 'tpl_path: ' . $arrBloc['tpl_path'] . "\n" . 'php_path: ' . $arrBloc['php_path']; GC_Utils_Ex::gfPrintLog($error); } } } // カラム数を取得する $objPage->tpl_column_num = $this->getColumnNum($objPage->arrPageLayout); }
function setReturnTo($key, $mode) { if (SC_Utils_Ex::isAppInnerUrl($_SERVER["HTTP_REFERER"])) { $netUrl = new Net_URL($_SERVER["HTTP_REFERER"]); $dir = basename(dirname($netUrl->path)); $file = basename($netUrl->path); if (preg_match("{.*(confirm|complete).php}", $file)) { GC_Utils_Ex::gfPrintLog($file); return; } switch ($dir) { case "au": case "docomo": case "softbank": break; default: $_SESSION[$key] = $netUrl->getURL(); break; } } }
/** * Page のプロセス. * * @return void */ function process() { // 認証可否の判定 $objSess = new SC_Session(); SC_Utils_Ex::sfIsSuccess($objSess); $this->initParam(); // パラメータの検証 if ($this->objForm->checkError() || !SC_Utils_ex::sfIsInt($id = $this->objForm->getValue('id'))) { GC_Utils_Ex::gfPrintLog("error id={$id}"); SC_Utils_Ex::sfDispError(INVALID_MOVE_ERRORR); } $id = $this->objForm->getValue('id'); // レコードの削除 $objQuery =& new SC_Query(); $objQuery->begin(); $this->renumberRank($objQuery, $id); $this->deleteRecode($objQuery, $id); $objQuery->commit(); // リダイレクト $url = $this->getLocation(URL_SYSTEM_TOP) . '?pageno=' . $this->objForm->getValue('pageno'); $this->sendRedirect($url); }
function update(array $arrPlugin, SC_Plugin_Installer $installer) { require_once DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR . "KisekaeTouchCore.php"; $plugin_code = $arrPlugin["plugin_code"]; $date = date("Ymd"); define("KTC_PLG_ORG_DIR", PLUGIN_UPLOAD_REALDIR . "{$plugin_code}/"); define("KTC_PLG_UPD_DIR", DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR); define("KTC_PLG_BKU_DIR", PLUGIN_UPLOAD_REALDIR . "{$plugin_code}_{$date}/"); if (file_exists(KTC_PLG_BKU_DIR)) { // nop } else { SC_Utils_Ex::recursiveMkdir(KTC_PLG_BKU_DIR); $log = SC_Utils_Ex::sfCopyDir(KTC_PLG_ORG_DIR, KTC_PLG_BKU_DIR, "", TRUE); GC_Utils_Ex::gfPrintLog($log, PLUGIN_LOG_REALFILE, FALSE); } SC_Helper_FileManager_Ex::deleteFile(KTC_PLG_ORG_DIR, FALSE); $log = SC_Utils_Ex::sfCopyDir(KTC_PLG_UPD_DIR, KTC_PLG_ORG_DIR, "", TRUE); GC_Utils_Ex::gfPrintLog($log, PLUGIN_LOG_REALFILE, FALSE); $installer->copyDirectory("copy/plugin_dir/", ""); $core = new KisekaeTouchCore($arrPlugin); $plugin_version = $arrPlugin["plugin_version"]; $core->update($arrPlugin, $installer, $plugin_version); $core->createCash(); }
/** * ログを出力. * * @param string $msg * @param mixed $data Dumpしたいデータ.デバッグ用. * @param string $suffix */ function log($msg, $data = null, $suffix = '') { $path = DATA_REALDIR . 'logs/' . $this->getCode() . "{$suffix}.log"; GC_Utils_Ex::gfPrintLog($msg, $path); if (!is_null($data)) { GC_Utils_Ex::gfPrintLog(print_r($data, true), $path); } }
function EndSession() { // セッション情報破棄の前にcustomer_idを保存 $customer_id = $_SESSION['customer']['customer_id']; // $_SESSION['customer']の解放 unset($_SESSION['customer']); // セッションの配送情報を全て破棄する SC_Helper_Purchase_Ex::unsetAllShippingTemp(true); // トランザクショントークンの破棄 SC_Helper_Session_Ex::destroyToken(); $objSiteSess = new SC_SiteSession_Ex(); $objSiteSess->unsetUniqId(); // ログに記録する $log = sprintf("logout : user=%d\tip=%s", $customer_id, $this->getRemoteHost()); GC_Utils_Ex::gfPrintLog($log, CUSTOMER_LOG_REALFILE, false); }
/** * JSON 文字列をデコードする. * * この関数は, json_decode() 又は Services_JSON::decode() のラッパーです. * json_decode() 関数が使用可能な場合は json_decode() 関数を使用する. * 使用できない場合は, Services_JSON::decode() 関数を使用する. * * @param string $json JSON 形式にエンコードされた文字列 * @return mixed デコードされた PHP の型 * @see json_decode() * @see Services_JSON::decode() */ function jsonDecode($json) { if (function_exists('json_decode')) { return json_decode($json); } else { GC_Utils_Ex::gfPrintLog(' *use Services_JSON::decode(). faster than using the json_decode!'); $objJson = new Services_JSON(); return $objJson->decode($json); } }
<?php /* Smarty version 2.6.26, created on 2015-06-30 07:44:31 compiled from C:%5Cwamp%5Cwww%5CGitHub%5CRise-Up%5Chtml/../data/Smarty/templates/admin/admin_popup_header.tpl */ require_once SMARTY_CORE_DIR . 'core.load_plugins.php'; smarty_core_load_plugins(array('plugins' => array(array('function', 'printXMLDeclaration', 'C:\\wamp\\www\\GitHub\\Rise-Up\\html/../data/Smarty/templates/admin/admin_popup_header.tpl', 1, false), array('function', 't', 'C:\\wamp\\www\\GitHub\\Rise-Up\\html/../data/Smarty/templates/admin/admin_popup_header.tpl', 60, false), array('modifier', 'script_escape', 'C:\\wamp\\www\\GitHub\\Rise-Up\\html/../data/Smarty/templates/admin/admin_popup_header.tpl', 29, false))), $this); echo GC_Utils_Ex::printXMLDeclaration(array(), $this); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> <head> <meta http-equiv="content-type" content="application/xhtml+xml; charset=<?php echo is_array($_tmp = @CHAR_CODE) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp); ?> " /> <meta http-equiv="content-script-type" content="text/javascript" /> <meta http-equiv="content-style-type" content="text/css" /> <link rel="stylesheet" href="<?php echo is_array($_tmp = $this->_tpl_vars['TPL_URLPATH']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp); ?> css/reset.css" type="text/css" media="all" /> <link rel="stylesheet" href="<?php echo is_array($_tmp = $this->_tpl_vars['TPL_URLPATH']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp); ?> css/admin_contents.css" type="text/css" media="all" /> <script type="text/javascript" src="<?php echo is_array($_tmp = @ROOT_URLPATH) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp); ?> js/navi.js"></script>
/** * エラーメッセージの冒頭部を生成する * * @return string */ function lfGetErrMsgHead() { $errmsg = ''; $errmsg .= GC_Utils_Ex::getUrl() . "\n"; $errmsg .= "\n"; $errmsg .= 'SERVER_ADDR: ' . $_SERVER['SERVER_ADDR'] . "\n"; $errmsg .= 'REMOTE_ADDR: ' . $_SERVER['REMOTE_ADDR'] . "\n"; $errmsg .= 'USER_AGENT: ' . $_SERVER['HTTP_USER_AGENT'] . "\n"; return $errmsg; }
/** * エラー捕捉時のエラーハンドラ関数 (for PHP >= 5.2.0) * * この関数は, register_shutdown_function() 関数に登録するための関数である。 * PHP 5.1 対応処理との互換運用ため E_USER_ERROR は handle_warning で捕捉する。 * * @return void */ public static function handle_error() { // 最後のエラーを確実に捉えるため、先頭で呼び出す。 $arrError = error_get_last(); $is_error = false; if (isset($arrError)) { switch ($arrError['type']) { case E_ERROR: case E_PARSE: case E_CORE_ERROR: case E_COMPILE_ERROR: $is_error = true; break; default: break; } } if (!$is_error) { return; } $error_type_name = GC_Utils_Ex::getErrorTypeName($arrError['type']); $errstr = "Fatal error({$error_type_name}): {$arrError[message]} on [{$arrError[file]}({$arrError[line]})]"; GC_Utils_Ex::gfPrintLog($errstr, ERROR_LOG_REALFILE, true); // エラー画面を表示する SC_Helper_HandleError_Ex::displaySystemError($errstr); }
/** * SQL の実行ログ (トレースログ) を書き出す * * @param string 実行するSQL文 * @param array $arrVal プレースホルダに挿入する配列 * @return void */ private function lfEndDbTraceLog(&$arrStartInfo, &$objSth, &$arrVal) { if (!defined('SQL_QUERY_LOG_MODE') || SQL_QUERY_LOG_MODE === 0) { return; } $msg = "[execute end {$arrStartInfo['http_request_id']}#{$arrStartInfo['count']}]\n"; $timeEnd = microtime(true); $timeExecTime = $timeEnd - $arrStartInfo['time_start']; // ログモード1の場合、 if (SQL_QUERY_LOG_MODE === 1) { // 規定時間より速い場合、ログに出力しない if (!defined('SQL_QUERY_LOG_MIN_EXEC_TIME') || $timeExecTime < (double) SQL_QUERY_LOG_MIN_EXEC_TIME) { return; } // 開始時にログ出力していないため、ここで実行内容を出力する $msg .= 'SQL: ' . $objSth->query . "\n"; $msg .= 'PlaceHolder: ' . var_export($arrVal, true) . "\n"; } $msg .= 'execution time: ' . sprintf('%.2f sec', $timeExecTime) . "\n"; GC_Utils_Ex::gfPrintLog($msg, DB_LOG_REALFILE); }
/** * Page のアクション. * * @return void */ public function action() { $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); $is_error = !SC_Utils_Ex::isBlank($this->arrErr); $this->bloc_id = $objFormParam->getValue('bloc_id'); $this->device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC); $objBloc = new SC_Helper_Bloc_Ex($this->device_type_id); switch ($this->getMode()) { // 登録/更新 case 'confirm': if (!$is_error) { $this->arrErr = $this->lfCheckError($objFormParam, $this->arrErr, $objBloc); if (SC_Utils_Ex::isBlank($this->arrErr)) { $result = $this->doRegister($objFormParam, $objBloc); if ($result !== false) { $arrPram = array('bloc_id' => $result, 'device_type_id' => $this->device_type_id, 'msg' => 'on'); SC_Response_Ex::reload($arrPram, true); SC_Response_Ex::actionExit(); } } } break; // 削除 // 削除 case 'delete': if (!$is_error) { if ($this->doDelete($objFormParam, $objBloc)) { $arrPram = array('device_type_id' => $this->device_type_id, 'msg' => 'on'); SC_Response_Ex::reload($arrPram, true); SC_Response_Ex::actionExit(); } } break; default: if (isset($_GET['msg']) && $_GET['msg'] == 'on') { // 完了メッセージ $this->tpl_onload = "alert('登録が完了しました。');"; } break; } if (!$is_error) { // ブロック一覧を取得 $this->arrBlocList = $objBloc->getList(); // bloc_id が指定されている場合にはブロックデータの取得 if (!SC_Utils_Ex::isBlank($this->bloc_id)) { $arrBloc = $this->getBlocTemplate($this->bloc_id, $objBloc); $objFormParam->setParam($arrBloc); } } else { // 画面にエラー表示しないため, ログ出力 GC_Utils_Ex::gfPrintLog('Error: ' . print_r($this->arrErr, true)); } $this->tpl_subtitle = $this->arrDeviceType[$this->device_type_id] . '>' . $this->tpl_subtitle; $this->arrForm = $objFormParam->getFormParamList(); }