Class: SC_Utils
Source Location: /util/SC_Utils.php
各種ユーティリティクラス.
Author(s):
Version:
- $Id:SC_Utils.php 15532 2007-08-31 14:39:46Z nanasess $
|
|
Class Details
Class Methods
method arrayDefineIndexes [line 1310]
array arrayDefineIndexes(
array
$array, array
$defineIndexes)
|
|
配列の添字が未定義の場合は空文字を代入して定義する.
Tags:
Parameters:
method getCSVData [line 1644]
string getCSVData(
$array,
$arrayIndex)
|
|
CSV出力用データ取得
Parameters:
method getHash2Array [line 775]
array getHash2Array(
array
$hash, [array
$requires = array()])
|
|
連想配列から新たな配列を生成して返す. $requires が指定された場合, $requires に含まれるキーの値のみを返す.
Tags:
Parameters:
method getRealURL [line 103]
string getRealURL(
string
$url)
|
|
相対パスで記述された URL から絶対パスの URL を取得する. この関数は, http(s):// から始まる URL を解析し, 相対パスで記述されていた 場合, 絶対パスに変換して返す 例) http://www.example.jp/aaa/../index.php ↓ http://www.example.jp/index.php
Tags:
Parameters:
method getTableTag [line 1670]
string getTableTag(
$array)
|
|
配列をテーブルタグで出力する。
Parameters:
method isAbsoluteRealPath [line 2139]
boolean isAbsoluteRealPath(
string
$realpath)
|
|
パスが絶対パスかどうかをチェックする. 引数のパスが絶対パスの場合は true を返す. この関数は, パスの存在チェックを行なわないため注意すること.
Tags:
Parameters:
method isBlank [line 1965]
boolean isBlank(
mixed
$val, [boolean
$greedy = true])
|
|
変数が空白かどうかをチェックする. 引数 $val が空白かどうかをチェックする. 空白の場合は true. 以下の文字は空白と判断する. - " " (ASCII 32 (0x20)), 通常の空白
- "\t" (ASCII 9 (0x09)), タブ
- "\n" (ASCII 10 (0x0A)), リターン
- "\r" (ASCII 13 (0x0D)), 改行
- "\0" (ASCII 0 (0x00)), NULバイト
- "\x0B" (ASCII 11 (0x0B)), 垂直タブ
引数 $val が配列の場合は, 空の配列の場合 true を返す. 引数 $greedy が true の場合は, 全角スペース, ネストした空の配列も 空白と判断する.
Tags:
Parameters:
method jsonDecode [line 2119]
mixed jsonDecode(
string
$json)
|
|
JSON 文字列をデコードする. この関数は, json_decode() 又は Services_JSON::decode() のラッパーです. json_decode() 関数が使用可能な場合は json_decode() 関数を使用する. 使用できない場合は, Services_JSON::decode() 関数を使用する.
Tags:
Parameters:
method jsonEncode [line 2096]
string jsonEncode(
mixed
$value)
|
|
値を JSON 形式にして返す. この関数は, json_encode() 又は Services_JSON::encode() のラッパーです. json_encode() 関数が使用可能な場合は json_encode() 関数を使用する. 使用できない場合は, Services_JSON::encode() 関数を使用する.
Tags:
Parameters:
method lfIsFileOpen [line 1581]
void lfIsFileOpen(
$dir,
$tree_status)
|
|
Parameters:
method mbConvertKanaWithArray [line 1294]
array mbConvertKanaWithArray(
array
$array, array
$arrConvList)
|
|
$array の要素を $arrConvList で指定した方式で mb_convert_kana を適用する.
Tags:
Parameters:
method printXMLDeclaration [line 1341]
string printXMLDeclaration(
)
|
|
XML宣言を出力する. XML宣言があると問題が発生する UA は出力しない.
Tags:
method recursiveMkdir [line 2157]
boolean recursiveMkdir(
string
$pathname, [integer
$mode = 0777])
|
|
ディレクトリを再帰的に作成する. mkdir 関数の $recursive パラメーターを PHP4 でサポートする.
Tags:
Parameters:
method searchInstallerPath [line 66]
string searchInstallerPath(
string
$path)
|
|
インストーラのパスを検索し, URL を返す. $path と同階層に install/index.php があるか検索する. 存在しない場合は上位階層を再帰的に検索する. インストーラのパスが見つかった場合は, その URL を返す. DocumentRoot まで検索しても見つからない場合は /install/index.php を返す.
Tags:
Parameters:
method sfArrayIntersectKeys [line 1326]
array sfArrayIntersectKeys(
array
$arrSrc, array
$arrKey)
|
|
$arrSrc のうち、キーが $arrKey に含まれるものを返す $arrSrc に含まない要素は返されない。
Parameters:
method sfArrCombine [line 1033]
void sfArrCombine(
$arrKeys,
$arrValues)
|
|
Parameters:
method sfArrKeyValue [line 455]
void sfArrKeyValue(
$arrList,
$keyname,
$valname, [
$len_max = ""], [
$keysize = ""])
|
|
Parameters:
method sfArrKeyValues [line 480]
void sfArrKeyValues(
$arrList,
$keyname,
$valname, [
$len_max = ""], [
$keysize = ""], [
$connect = ""])
|
|
Parameters:
method sfBacktraceToString [line 1761]
string sfBacktraceToString(
$arrBacktrace)
|
|
バックトレースをテキスト形式で出力する
Tags:
Parameters:
method sfCalcIncTax [line 664]
integer sfCalcIncTax(
integer
$price, integer
$tax, integer
$tax_rule)
|
|
税金付与した金額を返す ・店舗基本情報に基づいた計算は SC_Helper_DB::sfTax() を使用する
Tags:
Parameters:
method sfCheckSetTerm [line 554]
void sfCheckSetTerm(
$start_year,
$start_month,
$start_day,
$end_year,
$end_month,
$end_day)
|
|
Parameters:
method sfCopyDir [line 1132]
void sfCopyDir(
$src,
$des, [
$mess = ""], [
$override = false])
|
|
Parameters:
method sfCreateFile [line 1610]
void sfCreateFile(
$file, [
$mode = ""])
|
|
Parameters:
method sfCutString [line 909]
void sfCutString(
$str,
$len, [
$byte = true], [
$commadisp = true])
|
|
Parameters:
method sfDBDatetoTime [line 1021]
void sfDBDatetoTime(
$db_date)
|
|
Parameters:
method sfDeleteDir [line 1437]
method sfDelFile [line 1184]
method sfDirChildExists [line 1557]
void sfDirChildExists(
$dir)
|
|
Parameters:
method sfDispDBDate [line 735]
void sfDispDBDate(
$dbdate, [
$time = true])
|
|
Parameters:
method sfDispError [line 133]
method sfDispException [line 168]
void sfDispException(
[string
$debugMsg = null])
|
|
例外エラーページの表示
Parameters:
method sfDispSiteError [line 146]
void sfDispSiteError(
$type, [
$objSiteSess = ""], [
$return_top = false], [
$err_msg = ""])
|
|
Parameters:
method sfDownloadFile [line 1595]
void sfDownloadFile(
$file)
|
|
Parameters:
method sfEncodeFile [line 881]
string sfEncodeFile(
string
$filepath, string
$enc_type, string
$out_dir)
|
|
テキストファイルの文字エンコーディングを変換する. $filepath に存在するテキストファイルの文字エンコーディングを変換する. 変換前の文字エンコーディングは, mb_detect_order で設定した順序で自動検出する. 変換後は, 変換前のファイル名に「enc_」というプレフィクスを付与し, $out_dir で指定したディレクトリへ出力する TODO $filepath のファイルがバイナリだった場合の扱い TODO fwrite などでのエラーハンドリング
Tags:
Parameters:
method sfErrorHeader [line 122]
void sfErrorHeader(
$mess, [
$print = false])
|
|
Parameters:
method sfFlush [line 1247]
void sfFlush(
[boolean|string
$output = false], [
$sleep = 0])
|
|
ブラウザに強制的に送出する
Parameters:
method sfGetAddPoint [line 807]
integer sfGetAddPoint(
integer
$totalpoint, integer
$use_point, integer
$point_rate)
|
|
加算ポイントの計算 ・店舗基本情報に基づいた計算は SC_Helper_DB::sfGetAddPoint() を使用する
Tags:
Parameters:
method sfGetAddress [line 1805]
void sfGetAddress(
$zipcode)
|
|
Parameters:
method sfGetBrothersArray [line 1051]
void sfGetBrothersArray(
$arrData,
$pid_name,
$id_name,
$arrPID)
|
|
Parameters:
method sfGetChecked [line 605]
void sfGetChecked(
$param,
$value)
|
|
Parameters:
method sfGetClassCatCount [line 708]
void sfGetClassCatCount(
)
|
|
method sfGetCommaList [line 506]
void sfGetCommaList(
$array, [
$space = true], [
$arrPop = array()])
|
|
Parameters:
method sfGetCSVData [line 305]
void sfGetCSVData(
$data, [
$prefix = ""])
|
|
Parameters:
method sfGetCSVList [line 531]
void sfGetCSVList(
$array)
|
|
Parameters:
method sfGetDirSize [line 1405]
method sfGetEnabled [line 598]
method sfGetErrorColor [line 591]
void sfGetErrorColor(
$val)
|
|
Parameters:
method sfGetFileList [line 1353]
void sfGetFileList(
$dir)
|
|
Parameters:
method sfGetFileTree [line 1475]
void sfGetFileTree(
$dir,
$tree_status)
|
|
Parameters:
method sfGetFileTreeSub [line 1513]
void sfGetFileTreeSub(
$dir,
$default_rank,
&$cnt,
&$arrTree,
$tree_status)
|
|
Parameters:
method sfGetFileVersion [line 1269]
void sfGetFileVersion(
$path)
|
|
Parameters:
method sfGetHashString [line 2023]
string sfGetHashString(
string
$str, string
$salt)
|
|
パスワードのハッシュ化
Tags:
Parameters:
method sfGetPluginFullPathByRequireFilePath [line 1842]
SimpleXMLElement sfGetPluginFullPathByRequireFilePath(
string
$file)
|
|
プラグインが配置されているディレクトリ(フルパス)を取得する
Tags:
Parameters:
method sfGetPluginInfoArray [line 1889]
array sfGetPluginInfoArray(
string
$path)
|
|
プラグイン情報配列を取得する TODO include_once を利用することで例外対応をサボタージュしているのを改善する。
Tags:
Parameters:
method sfGetPluginPathByPluginFullPath [line 1852]
SimpleXMLElement sfGetPluginPathByPluginFullPath(
string
$pluginFullPath)
|
|
プラグインのパスを取得する
Tags:
Parameters:
method sfGetPluginsXml [line 1900]
SimpleXMLElement sfGetPluginsXml(
)
|
|
プラグイン XML を読み込む TODO 空だったときを考慮
Tags:
method sfGetProductClassId [line 721]
void sfGetProductClassId(
$product_id,
$classcategory_id1,
$classcategory_id2)
|
|
Parameters:
method sfGetRandomString [line 1732]
string sfGetRandomString(
[integer
$length = 1])
|
|
ランダムな文字列を取得する
Tags:
Parameters:
method sfGetSearchPageMax [line 2075]
integer sfGetSearchPageMax(
string
$search_page_max)
|
|
検索結果の1ページあたりの最大表示件数を取得する フォームの入力値から最大表示件数を取得する 取得できなかった場合は, 定数 SEARCH_PMAX の値を返す
Tags:
Parameters:
method sfGetTimestamp [line 263]
void sfGetTimestamp(
$year,
$month,
$day, [
$last = false])
|
|
Parameters:
method sfGetUnderChildrenArray [line 1074]
void sfGetUnderChildrenArray(
$arrData,
$pid_name,
$id_name,
$parent)
|
|
Parameters:
method sfGetUniqRandomId [line 818]
void sfGetUniqRandomId(
[
$head = ""])
|
|
Parameters:
method sfGetUrl [line 1742]
method sfInitInstall [line 38]
method sfIsAdminFunction [line 1782]
bool sfIsAdminFunction(
)
|
|
管理機能かを判定
Tags:
method sfIsFrontFunction [line 1791]
bool sfIsFrontFunction(
)
|
|
フロント機能かを判定
Tags:
method sfIsHTTPS [line 236]
method sfIsInstallFunction [line 1800]
bool sfIsInstallFunction(
)
|
|
インストール機能かを判定
Tags:
method sfIsInt [line 286]
bool sfIsInt(
mixed
$value)
|
|
INT型の数値チェック ・FIXME: マイナス値の扱いが不明確 ・XXX: INT_LENには収まるが、INT型の範囲を超えるケースに対応できないのでは?
Parameters:
method sfIsInternalDomain [line 2007]
boolean sfIsInternalDomain(
string
$url)
|
|
指定されたURLのドメインが一致するかを返す 戻り値:一致(true) 不一致(false)
Parameters:
method sfIsMatchHashPassword [line 2044]
boolean sfIsMatchHashPassword(
string
$pass, string
$hashpass, string
$salt)
|
|
パスワード文字列のハッシュ一致判定
Tags:
Parameters:
method sfIsSuccess [line 187]
void sfIsSuccess(
$objSess, [
$disp_error = true])
|
|
Parameters:
method sfIsValidTransition [line 252]
bool sfIsValidTransition(
obj
$objSess)
|
|
正規の遷移がされているかを判定 前画面でuniqidを埋め込んでおく必要がある
Parameters:
method sfIsZeroFilling [line 299]
void sfIsZeroFilling(
$value)
|
|
Parameters:
method sfLoadPluginInfo [line 1923]
void sfLoadPluginInfo(
$filenamePluginInfo)
|
|
Parameters:
method sfMakeDir [line 1105]
method sfMakeHiddenArray [line 1002]
void sfMakeHiddenArray(
$arrSrc, [
$arrDst = array()], [
$parent_key = ""])
|
|
Parameters:
method sfMakePluginInfoArray [line 1862]
array sfMakePluginInfoArray(
string
$file)
|
|
プラグイン情報配列の基本形を作成する
Tags:
Parameters:
method sfMbConvertEncoding [line 1028]
void sfMbConvertEncoding(
$str, [
$encode = 'CHAR_CODE'])
|
|
Parameters:
method sfMergeCBSearchValue [line 422]
void sfMergeCBSearchValue(
$keyname,
$max)
|
|
Tags:
Parameters:
method sfMergeCBValue [line 333]
void sfMergeCBValue(
$keyname,
$max)
|
|
Tags:
Parameters:
method sfMergeCheckBoxes [line 350]
void sfMergeCheckBoxes(
$array,
$max)
|
|
Tags:
Parameters:
method sfMergeParamCheckBoxes [line 371]
void sfMergeParamCheckBoxes(
$array)
|
|
Tags:
Parameters:
method sfMicrotimeFloat [line 1935]
integer sfMicrotimeFloat(
SimpleXMLElement
$pluginsXml)
|
|
現在の Unix タイムスタンプを float (秒単位) でマイクロ秒まで返す PHP4の上位互換用途。 FIXME PHP4でテストする。(現状全くテストしていない。)
Tags:
Parameters:
method sfMultiply [line 793]
void sfMultiply(
$num1,
$num2)
|
|
Parameters:
method sfNoImageMain [line 1709]
string sfNoImageMain(
[
$filename = ''], string
&$filename)
|
|
詳細-メイン画像のファイル指定がない場合、専用の画像ファイルに書き換える。
Parameters:
method sfNoImageMainList [line 1696]
string sfNoImageMainList(
[
$filename = ''], string
&$filename)
|
|
一覧-メイン画像のファイル指定がない場合、専用の画像ファイルに書き換える。
Parameters:
method sfPassLen [line 222]
string sfPassLen(
string
$passlen)
|
|
文字列をアスタリスクへ変換する.
Tags:
Parameters:
method sfPrePoint [line 683]
void sfPrePoint(
$price,
$point_rate, [
$rule = POINT_RULE], [
$product_id = ""])
|
|
Parameters:
method sfPrintR [line 1717]
method sfPutBR [line 827]
void sfPutBR(
$str,
$size)
|
|
Parameters:
method sfPutPluginsXml [line 1910]
integer sfPutPluginsXml(
SimpleXMLElement
$pluginsXml)
|
|
プラグイン XML を書き込む
Tags:
Parameters:
method sfQuoteSmart [line 1091]
SQLシングルクォート対応
Tags:
Parameters:
method sfReadFile [line 1626]
void sfReadFile(
$filename)
|
|
Parameters:
method sfRmDupSlash [line 849]
void sfRmDupSlash(
$istr)
|
|
Parameters:
method sfRound [line 669]
void sfRound(
$value, [
$pow = 0])
|
|
Parameters:
method sfSearchCheckBoxes [line 391]
void sfSearchCheckBoxes(
$array)
|
|
Tags:
Parameters:
method sfSearchKey [line 582]
void sfSearchKey(
$array,
$word,
$default)
|
|
Parameters:
method sfSetErrorStyle [line 577]
method sfSplitCBValue [line 439]
void sfSplitCBValue(
$val, [
$keyname = ""])
|
|
Tags:
Parameters:
method sfSplitCheckBoxes [line 407]
void sfSplitCheckBoxes(
$val)
|
|
Tags:
Parameters:
method sfSwapArray [line 751]
void sfSwapArray(
$array, [
$isColumnName = true])
|
|
Parameters:
method sfTax [line 629]
integer sfTax(
integer
$price, integer
$tax, integer
$tax_rule)
|
|
税金額を返す ・店舗基本情報に基づいた計算は SC_Helper_DB::sfTax() を使用する
Tags:
Parameters:
method sfTermMonth [line 957]
void sfTermMonth(
$year,
$month,
$close_day)
|
|
Parameters:
method sfTrim [line 612]
method sfTrimURL [line 729]
method sfUpDirName [line 322]
method sfWriteFile [line 1219]
void sfWriteFile(
$str,
$path,
$type, [
$permission = ""])
|
|
Parameters:
Documentation generated on Fri, 24 Feb 2012 14:03:03 +0900 by Seasoft
|