Changeset 20484 for branches/version-2_5-dev/data/class/util/SC_Utils.php
- Timestamp:
- 2011/03/04 19:51:32 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/util/SC_Utils.php
r20480 r20484 81 81 if( !ereg('/install/', $phpself) ) { 82 82 $path = substr($phpself, 0, strpos($phpself, basename($phpself))); 83 $install_url = SC_Utils ::searchInstallerPath($path);83 $install_url = SC_Utils_Ex::searchInstallerPath($path); 84 84 header('Location: ' . $install_url); 85 85 exit; … … 88 88 $path = HTML_REALDIR . 'install/' . DIR_INDEX_FILE; 89 89 if(file_exists($path)) { 90 SC_Utils ::sfErrorHeader('>> /install/' . DIR_INDEX_FILE . ' は、インストール完了後にファイルを削除してください。');90 SC_Utils_Ex::sfErrorHeader('>> /install/' . DIR_INDEX_FILE . ' は、インストール完了後にファイルを削除してください。'); 91 91 } 92 92 } … … 106 106 $installer = 'install/' . DIR_INDEX_PATH; 107 107 108 if (SC_Utils ::sfIsHTTPS()) {108 if (SC_Utils_Ex::sfIsHTTPS()) { 109 109 $proto = "https://"; 110 110 } else { … … 119 119 } 120 120 $installer_url = $host . $path . $installer; 121 $resources = fopen(SC_Utils ::getRealURL($installer_url), 'r');121 $resources = fopen(SC_Utils_Ex::getRealURL($installer_url), 'r'); 122 122 if ($resources === false) { 123 $installer_url = SC_Utils ::searchInstallerPath($path . '../');123 $installer_url = SC_Utils_Ex::searchInstallerPath($path . '../'); 124 124 } 125 125 return $installer_url; … … 229 229 if($disp_error) { 230 230 // エラーページの表示 231 SC_Utils ::sfDispError($ret);231 SC_Utils_Ex::sfDispError($ret); 232 232 } 233 233 return false; … … 240 240 // sfErrorHeader('>> referrerが無効になっています。'); 241 241 } else { 242 $domain = SC_Utils ::sfIsHTTPS() ? HTTPS_URL : HTTP_URL;242 $domain = SC_Utils_Ex::sfIsHTTPS() ? HTTPS_URL : HTTP_URL; 243 243 $pattern = sprintf('|^%s.*|', $domain); 244 244 $referer = $_SERVER['HTTP_REFERER']; … … 246 246 // 管理画面から以外の遷移の場合はエラー画面を表示 247 247 if (!preg_match($pattern, $referer)) { 248 if ($disp_error) SC_Utils ::sfDispError(INVALID_MOVE_ERRORR);248 if ($disp_error) SC_Utils_Ex::sfDispError(INVALID_MOVE_ERRORR); 249 249 return false; 250 250 } … … 347 347 348 348 if($prefix == "") { 349 $dir_name = SC_Utils ::sfUpDirName();349 $dir_name = SC_Utils_Ex::sfUpDirName(); 350 350 $file_name = $dir_name . date("ymdHis") .".csv"; 351 351 } else { … … 369 369 function sfGetCSVData($data, $prefix = ""){ 370 370 if($prefix == "") { 371 $dir_name = SC_Utils ::sfUpDirName();371 $dir_name = SC_Utils_Ex::sfUpDirName(); 372 372 $file_name = $dir_name . date("ymdHis") .".csv"; 373 373 } else { … … 551 551 for($cnt = 0; $cnt < $max; $cnt++) { 552 552 if($keysize != "") { 553 $key = SC_Utils ::sfCutString($arrList[$cnt][$keyname], $keysize);553 $key = SC_Utils_Ex::sfCutString($arrList[$cnt][$keyname], $keysize); 554 554 } else { 555 555 $key = $arrList[$cnt][$keyname]; … … 576 576 for($cnt = 0; $cnt < $max; $cnt++) { 577 577 if($keysize != "") { 578 $key = SC_Utils ::sfCutString($arrList[$cnt][$keyname], $keysize);578 $key = SC_Utils_Ex::sfCutString($arrList[$cnt][$keyname], $keysize); 579 579 } else { 580 580 $key = $arrList[$cnt][$keyname]; … … 779 779 780 780 // 整数且つ0出なければ桁数指定を行う 781 if(SC_Utils ::sfIsInt($adjust) and $pow > 1){781 if(SC_Utils_Ex::sfIsInt($adjust) and $pow > 1){ 782 782 $ret = (round($value * $adjust)/$adjust); 783 783 } … … 822 822 $arrList = $objQuery->getAll($sql); 823 823 // キーと値をセットした配列を取得 824 $arrRet = SC_Utils ::sfArrKeyValue($arrList, 'class_id', 'count');824 $arrRet = SC_Utils_Ex::sfArrKeyValue($arrList, 'class_id', 'count'); 825 825 826 826 return $arrRet; … … 1011 1011 // ファイルが開けなかった場合はエラーページを表示 1012 1012 else { 1013 SC_Utils ::sfDispError('');1013 SC_Utils_Ex::sfDispError(''); 1014 1014 exit; 1015 1015 } … … 1119 1119 } 1120 1120 if(is_array($val)) { 1121 $arrDst = SC_Utils ::sfMakeHiddenArray($val, $arrDst, $keyname);1121 $arrDst = SC_Utils_Ex::sfMakeHiddenArray($val, $arrDst, $keyname); 1122 1122 } else { 1123 1123 $arrDst[$keyname] = $val; … … 1241 1241 if(!file_exists($dir)) { 1242 1242 mkdir($dir); 1243 GC_Utils ::gfPrintLog("mkdir $dir");1243 GC_Utils_Ex::gfPrintLog("mkdir $dir"); 1244 1244 } 1245 1245 } else { 1246 SC_Utils ::sfMakeDir($dir);1246 SC_Utils_Ex::sfMakeDir($dir); 1247 1247 if(is_writable(dirname($dir))) { 1248 1248 if(!file_exists($dir)) { 1249 1249 mkdir($dir); 1250 GC_Utils ::gfPrintLog("mkdir $dir");1250 GC_Utils_Ex::gfPrintLog("mkdir $dir"); 1251 1251 } 1252 1252 } … … 1289 1289 $data=$matches[2]; 1290 1290 if( is_dir( $data_ ) ){ 1291 $mess = SC_Utils ::sfCopyDir( $data_.'/', $des.$data.'/', $mess);1291 $mess = SC_Utils_Ex::sfCopyDir( $data_.'/', $des.$data.'/', $mess); 1292 1292 }else{ 1293 1293 if(!$override && file_exists($des.$data)) { … … 1319 1319 $ret = unlink($dir . "/" . $file); 1320 1320 }else if (is_dir($del_file)){ 1321 $ret = SC_Utils ::sfDelFile($del_file);1321 $ret = SC_Utils_Ex::sfDelFile($del_file); 1322 1322 } 1323 1323 … … 1531 1531 $path = $dir."/".$file; 1532 1532 // SELECT内の見た目を整えるため指定文字数で切る 1533 $file_name = SC_Utils ::sfCutString($file, FILE_NAME_LEN);1534 $file_size = SC_Utils ::sfCutString(SC_Utils::sfGetDirSize($path), FILE_NAME_LEN);1533 $file_name = SC_Utils_Ex::sfCutString($file, FILE_NAME_LEN); 1534 $file_size = SC_Utils_Ex::sfCutString(SC_Utils_Ex::sfGetDirSize($path), FILE_NAME_LEN); 1535 1535 $file_time = date("Y/m/d", filemtime($path)); 1536 1536 … … 1578 1578 } else if (is_dir($path) && $file != '..' && $file != '.') { 1579 1579 // 下層ファイルのバイト数を取得する為、再帰的に呼び出す。 1580 $bytes += SC_Utils ::sfGetDirSize($path);1580 $bytes += SC_Utils_Ex::sfGetDirSize($path); 1581 1581 } 1582 1582 } … … 2197 2197 * 自クラスへ再帰する. 2198 2198 */ 2199 if (!SC_Utils ::isBlank($in, $greedy)) {2199 if (!SC_Utils_Ex::isBlank($in, $greedy)) { 2200 2200 return false; 2201 2201 } … … 2314 2314 } else { 2315 2315 require_once(dirname(__FILE__) . '/../../module/Services/JSON.php'); 2316 GC_Utils ::gfPrintLog(' *use Services_JSON::encode(). faster than using the json_encode!');2316 GC_Utils_Ex::gfPrintLog(' *use Services_JSON::encode(). faster than using the json_encode!'); 2317 2317 $objJson = new Services_JSON(); 2318 2318 return $objJson->encode($value); … … 2337 2337 } else { 2338 2338 require_once(dirname(__FILE__) . '/../../module/Services/JSON.php'); 2339 GC_Utils ::gfPrintLog(' *use Services_JSON::decode(). faster than using the json_decode!');2339 GC_Utils_Ex::gfPrintLog(' *use Services_JSON::decode(). faster than using the json_decode!'); 2340 2340 $objJson = new Services_JSON(); 2341 2341 return $objJson->decode($json);
Note: See TracChangeset
for help on using the changeset viewer.