baserCMS クラスリファレンス

BcUtil
in package

Class BcUtil

Table of Contents

$contentsMaping  : array<string|int, string>
contentsMaping
$_detectors  : array<string|int, mixed>
detectors
addSessionId()  : mixed
URLにセッションIDを付加する 既に付加されている場合は重複しない
authSessionKey()  : mixed
認証用のキーを取得
base64UrlSafeDecode()  : string
パーセントエンコーディングされないURLセーフなbase64デコード
base64UrlsafeEncode()  : string
パーセントエンコーディングされないURLセーフなbase64エンコード
baseUrl()  : string
WebサイトのベースとなるURLを取得する
changePluginNameSpace()  : bool
プラグインの namespace を書き換える
checkTime()  : bool
時刻の有効性チェックを行う
checkTmpFolders()  : mixed
必要な一時フォルダが存在するかチェックし、 なければ生成する
clearAllCache()  : void
キャッシュファイルを全て削除する
clearModelCache()  : void
モデルキャッシュを削除する
convertSize()  : int
サイズの単位を変換する
createRequest()  : ServerRequest
Request を取得する
decodeContent()  : string
コンテンツタイプから拡張子を取得する
docRoot()  : string
ドキュメントルートを取得する
emptyFolder()  : bool
フォルダの中をフォルダを残して空にする(ファイルのみを削除する)
fgetcsvReg()  : mixed
ファイルポインタから行を取得し、CSVフィールドを処理する
fullUrl()  : string
httpからのフルURLを取得する
getAdminPrefix()  : string
管理画面用のプレフィックスを取得する
getAdminThemeList()  : array<string|int, mixed>
テーマリストを取得する
getAllThemeList()  : array<string|int, mixed>
全てのテーマを取得する
getAuthPrefixList()  : array<string|int, mixed>
認証プレフィックスのリストを取得
getBaserCorePrefix()  : string
baserCore用のプレフィックスを取得する
getContentsItem()  : array<string|int, mixed>
getContentsItem コンテンツ一覧用にアイテムを整形して返す
getContentType()  : false|string
ファイル名よりContent-Type を取得する
getCurrentAdminTheme()  : mixed|string
現在の管理画面のテーマ名を取得する キャメルケースが前提
getCurrentDb()  : Connection
現在のDB接続を取得する
getCurrentDbConfig()  : array<string|int, mixed>
現在のDB接続の設定を取得する
getCurrentDomain()  : string
現在のドメインを取得する
getCurrentTheme()  : string
現在のテーマ名を取得する
getCurrentThemesPlugins()  : array<string|int, mixed>
現在適用しているテーマ梱包プラグインのリストを取得する
getDbVersion()  : string
DBのバージョンを取得する
getDefaultDataPath()  : string
初期データのパスを取得する
getDomain()  : string
指定したURLのドメインを取得する
getEnablePlugins()  : array<string|int, mixed>
利用可能なプラグインのリストを取得する
getExistsTemplateDir()  : false|string
既に存在するテンプレートのディレクトリを取得する
getExistsWebrootDir()  : false|string
既に存在する webroot ディレクトリを取得する
getExtension()  : false|string
ファイル名より拡張子を取得する
getFrontTemplatePaths()  : mixed
フロントのテンプレートのパス一覧を取得する
getLoggedInUsers()  : array<string|int, mixed>
ログイン済のユーザー情報をログイン領域ごとに取得する
getMainDomain()  : string
メインとなるドメインを取得する
getPluginDir()  : false|mixed
プラグインのディレクトリ名を取得する
getPluginPath()  : string|false
プラグインのパスを取得する
getPrefix()  : string
プレフィックス全体を取得する
getRequestPrefix()  : string
指定したリクエストのプレフィックスを取得する
getRootTheme()  : mixed
ルートとなるサイトのテーマを取得する
getSubDomain()  : string
サブドメインを取得する
getTemplateList()  : array<string|int, mixed>
レイアウトテンプレートのリストを取得する
getTemplatePath()  : string|false
テンプレートのpathを返す
getThemeList()  : array<string|int, mixed>
テーマリストを取得する
getThemesPlugins()  : array<string|int, mixed>
テーマ梱包プラグインのリストを取得する
getVersion()  : bool|string
バージョンを取得する
getViewPath()  : string
現在のビューディレクトリのパスを取得する
includePluginClass()  : bool
プラグイン配下の Plugin クラスを読み込む
isAdminSystem()  : bool
管理システムかチェック
isAdminUser()  : bool
管理ユーザーかチェック
isAgentUser()  : bool
代理ログイン状態か判別する
isConsole()  : bool
コンソールから実行されているかチェックする $_ENV は、bootstrap にて設定 ユニットテストで状態を変更できる仕様とする
isCorePlugin()  : bool
指定したプラグインがコアプラグインかどうかを判定する
isDebug()  : bool
デバッグモードかどうか
isInstalled()  : bool
baserCMSのインストールが完了しているかチェックする
isInstallMode()  : bool|string|null
インストールモードか判定する
isMigrations()  : bool
現在の処理がCakePHPのマイグレーションコマンドかどうか
isOverPostSize()  : bool
送信されたPOSTがpost_max_sizeを超えているかチェックする
isSameReferrerAsCurrent()  : bool
リファラが現在のサイトと同じかどうか判定
isSuperUser()  : bool
特権ユーザでのログイン状態か判別する
isTest()  : bool
ユニットテストかどうか
isWindows()  : bool
実行環境のOSがWindowsであるかどうかを返す
loginUser()  : User|false
認証領域を指定してログインユーザーのデータを取得する
loginUserFromSession()  : array<string|int, mixed>|false|mixed|null
セッションからログイン情報を取得する
loginUserGroup()  : bool|mixed
現在ログインしているユーザーのユーザーグループ情報を取得する
loginUserName()  : string
ログインしているユーザー名を取得
mbBasename()  : string
日本語ファイル名対応版basename
offEvent()  : array<string|int, mixed>
オベントをオフにする
onEvent()  : mixed
イベントをオンにする
pairToAssoc()  : array<string|int, mixed>
引数のペアから連想配列を構築する
retry()  : mixed
処理を実行し、例外が発生した場合は指定した回数だけリトライする
serialize()  : string
シリアライズ
siteUrl()  : string
サイトの設置URLを取得する
topLevelUrl()  : string
サイトのトップレベルのURLを取得する
unserialize()  : mixed
アンシリアライズ base64_decode が前提
urlencode()  : string
URL用に文字列を変換する
verpoint()  : mixed
バージョンを特定する一意の数値を取得する 2つ目以降のバージョン番号は3桁として結合 1.5.9 => 1005009 ※ 2つ目以降のバージョン番号は999までとする β版の場合はfalseを返す

Properties

$contentsMaping

contentsMaping

public static array<string|int, string> $contentsMaping = [ "image/gif" => "gif", "image/jpeg" => "jpg", "image/pjpeg" => "jpg", "image/x-png" => "png", "image/jpg" => "jpg", "image/png" => "png", /* "application/pdf" => "pdf", */ // TODO windows で ai ファイルをアップロードをした場合、headerがpdfとして出力されるのでコメントアウト "application/pgp-signature" => "sig", "application/futuresplash" => "spl", "application/msword" => "doc", "application/postscript" => "ai", "application/x-bittorrent" => "torrent", "application/x-dvi" => "dvi", "application/x-gzip" => "gz", "application/x-ns-proxy-autoconfig" => "pac", "application/x-shockwave-flash" => "swf", "application/x-tgz" => "tar.gz", "application/x-tar" => "tar", "application/zip" => "zip", "audio/mpeg" => "mp3", "audio/x-mpegurl" => "m3u", "audio/x-ms-wma" => "wma", "audio/x-ms-wax" => "wax", "audio/x-wav" => "wav", "image/x-xbitmap" => "xbm", "image/x-xpixmap" => "xpm", "image/x-xwindowdump" => "xwd", "text/css" => "css", "text/html" => "html", "text/javascript" => "js", "text/plain" => "txt", "text/xml" => "xml", "video/mpeg" => "mpeg", "video/quicktime" => "mov", "video/x-msvideo" => "avi", "video/x-ms-asf" => "asf", "video/x-ms-wmv" => "wmv", ]

$_detectors

detectors

protected static array<string|int, mixed> $_detectors = ['get' => ['env' => 'REQUEST_METHOD', 'value' => 'GET'], 'post' => ['env' => 'REQUEST_METHOD', 'value' => 'POST'], 'put' => ['env' => 'REQUEST_METHOD', 'value' => 'PUT'], 'patch' => ['env' => 'REQUEST_METHOD', 'value' => 'PATCH'], 'delete' => ['env' => 'REQUEST_METHOD', 'value' => 'DELETE'], 'head' => ['env' => 'REQUEST_METHOD', 'value' => 'HEAD'], 'options' => ['env' => 'REQUEST_METHOD', 'value' => 'OPTIONS'], 'ssl' => ['env' => 'HTTPS', 'options' => [1, 'on']], 'ajax' => ['env' => 'HTTP_X_REQUESTED_WITH', 'value' => 'XMLHttpRequest'], 'json' => ['accept' => ['application/json'], 'param' => '_ext', 'value' => 'json'], 'xml' => ['accept' => ['application/xml', 'text/xml'], 'param' => '_ext', 'value' => 'xml']]

BcUtil::createRequest() にて ServerRequest::_detectors を初期化する際に利用

Methods

addSessionId()

URLにセッションIDを付加する 既に付加されている場合は重複しない

public static addSessionId(mixed $url[, mixed $force = false ]) : mixed
Parameters
$url : mixed
$force : mixed = false
Return values
mixed

authSessionKey()

認証用のキーを取得

public static authSessionKey([string $prefix = 'Admin' ]) : mixed
Parameters
$prefix : string = 'Admin'
Tags
checked
notodo
unitTest
Return values
mixed

base64UrlSafeDecode()

パーセントエンコーディングされないURLセーフなbase64デコード

public static base64UrlSafeDecode(string $val) : string
Parameters
$val : string

対象文字列

Return values
string

base64UrlsafeEncode()

パーセントエンコーディングされないURLセーフなbase64エンコード

public static base64UrlsafeEncode(string $val) : string

base64エンコード時でに出てくる記号 +(プラス) , /(スラッシュ) , =(イコール) このbase64エンコードした値をさらにURLのパラメータで使うためにURLエンコードすると パーセントエンコーディングされてしまいます。 そのため、このメソッドではパーセントエンコーディングされないURLセーフな base64エンコードを行います。

Parameters
$val : string

対象文字列

Return values
string

baseUrl()

WebサイトのベースとなるURLを取得する

public static baseUrl() : string

コントローラーが初期化される前など {$this->base} が利用できない場合に利用する / | /index.php/ | /subdir/ | /subdir/index.php/

※ プログラムフォルダ内の画像やCSSの読み込み時もbootstrap.php で呼び出されるのでサーバーキャッシュは利用しない

Return values
string

ベースURL

changePluginNameSpace()

プラグインの namespace を書き換える

public static changePluginNameSpace( $newPlugin) : bool
Parameters
$newPlugin :
Tags
checked
noTodo
unitTest
Return values
bool

checkTime()

時刻の有効性チェックを行う

public static checkTime( $hour,  $min[,  $sec = null ]) : bool
Parameters
$hour :
$min :
$sec : = null
Return values
bool

checkTmpFolders()

必要な一時フォルダが存在するかチェックし、 なければ生成する

public static checkTmpFolders() : mixed
Return values
mixed

clearAllCache()

キャッシュファイルを全て削除する

public static clearAllCache() : void
Tags
checked
unitTest
note

(value="viewキャッシュ/dataキャッシュ実装時に対応")

Return values
void

clearModelCache()

モデルキャッシュを削除する

public static clearModelCache() : void
Tags
checked
noTodo
Return values
void

convertSize()

サイズの単位を変換する

public static convertSize(string $size[, string $outExt = 'B' ][, string $inExt = null ]) : int
Parameters
$size : string

変換前のサイズ

$outExt : string = 'B'

変換後の単位

$inExt : string = null

変換元の単位

Tags
checked
noTodo
unitTest
Return values
int

変換後のサイズ

createRequest()

Request を取得する

public static createRequest([string $url = '/' ][, mixed $data = [] ][, mixed $method = 'GET' ][, mixed $config = [] ]) : ServerRequest
Parameters
$url : string = '/'
$data : mixed = []
$method : mixed = 'GET'
$config : mixed = []
Tags
checked
noTodo
unitTest
Return values
ServerRequest

decodeContent()

コンテンツタイプから拡張子を取得する

public static decodeContent(mixed $content[, mixed $fileName = null ]) : string
Parameters
$content : mixed
$fileName : mixed = null
Tags
checked
noTodo
unitTest
Return values
string

拡張子

docRoot()

ドキュメントルートを取得する

public static docRoot() : string

サブドメインの場合など、$_SERVER['DOCUMENT_ROOT'] が正常に取得できない場合に利用する UserDir に対応

Return values
string

ドキュメントルートの絶対パス

emptyFolder()

フォルダの中をフォルダを残して空にする(ファイルのみを削除する)

public static emptyFolder(string $path) : bool
Parameters
$path : string
Tags
checked
noTodo
unitTest
Return values
bool

fgetcsvReg()

ファイルポインタから行を取得し、CSVフィールドを処理する

public static fgetcsvReg(mixed &$handle[, mixed $length = null ][, mixed $d = ',' ][, mixed $e = '"' ]) : mixed
Parameters
$handle : mixed
$length : mixed = null
$d : mixed = ','
$e : mixed = '"'
Tags
checked
noTodo
unitTest
Return values
mixed

ファイルの終端に達した場合を含み、エラー時にFALSEを返します。

fullUrl()

httpからのフルURLを取得する

public static fullUrl(mixed $url) : string
Parameters
$url : mixed
Return values
string

getAdminPrefix()

管理画面用のプレフィックスを取得する

public static getAdminPrefix() : string
Tags
checked
noTodo
unitTest
Return values
string

getAdminThemeList()

テーマリストを取得する

public static getAdminThemeList() : array<string|int, mixed>
Tags
checked
notodo
unitTest
Return values
array<string|int, mixed>

getAllThemeList()

全てのテーマを取得する

public static getAllThemeList() : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

getAuthPrefixList()

認証プレフィックスのリストを取得

public static getAuthPrefixList() : array<string|int, mixed>

設定 BcPrefixAuth で定義されているものより取得する

  • フロント用のAPIでないこと
  • disabled = true でないこと
Tags
checked
noTodo
Return values
array<string|int, mixed>

getBaserCorePrefix()

baserCore用のプレフィックスを取得する

public static getBaserCorePrefix() : string
Tags
checked
noTodo
unitTest
Return values
string

getContentsItem()

getContentsItem コンテンツ一覧用にアイテムを整形して返す

public static getContentsItem() : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

getContentType()

ファイル名よりContent-Type を取得する

public static getContentType(string $fileName) : false|string
Parameters
$fileName : string
Tags
checked
noTodo
unitTest
Return values
false|string

getCurrentAdminTheme()

現在の管理画面のテーマ名を取得する キャメルケースが前提

public static getCurrentAdminTheme() : mixed|string
Return values
mixed|string

getCurrentDb()

現在のDB接続を取得する

public static getCurrentDb() : Connection
Return values
Connection

getCurrentDbConfig()

現在のDB接続の設定を取得する

public static getCurrentDbConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCurrentDomain()

現在のドメインを取得する

public static getCurrentDomain() : string
Tags
checked
notodo
unitTest
Return values
string

getCurrentTheme()

現在のテーマ名を取得する

public static getCurrentTheme() : string
Tags
checked
noTodo
unitTest
Return values
string

getCurrentThemesPlugins()

現在適用しているテーマ梱包プラグインのリストを取得する

public static getCurrentThemesPlugins() : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

プラグインリスト

getDbVersion()

DBのバージョンを取得する

public static getDbVersion([string $plugin = '' ]) : string
Parameters
$plugin : string = ''

プラグイン名

Tags
checked
noTodo
unitTest
Return values
string

getDefaultDataPath()

初期データのパスを取得する

public static getDefaultDataPath([string $theme = null ][, string $pattern = null ]) : string
Parameters
$theme : string = null

テーマ名

$pattern : string = null

初期データの類型

Tags
checked
noTodo
unitTest
Return values
string

Or false

getDomain()

指定したURLのドメインを取得する

public static getDomain( $url) : string
Parameters
$url :

URL

Tags
checked
notodo
unitTest
Return values
string

getEnablePlugins()

利用可能なプラグインのリストを取得する

public static getEnablePlugins([mixed $force = false ]) : array<string|int, mixed>

ClassRegistry::removeObject('Plugin'); で一旦 Plugin オブジェクトを削除 エラーの際も呼び出される事があるので、テーブルが実際に存在するかチェックする

Parameters
$force : mixed = false
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

getExistsTemplateDir()

既に存在するテンプレートのディレクトリを取得する

public static getExistsTemplateDir(string $theme, string $plugin, string $path[, string $type = '' ]) : false|string

存在しない場合は false を返す

Parameters
$theme : string
$plugin : string
$path : string
$type : string = ''
Return values
false|string

getExistsWebrootDir()

既に存在する webroot ディレクトリを取得する

public static getExistsWebrootDir(string $theme, string $plugin, string $path[, string $type = '' ]) : false|string

存在しない場合は false を返す

Parameters
$theme : string
$plugin : string
$path : string
$type : string = ''
Return values
false|string

getExtension()

ファイル名より拡張子を取得する

public static getExtension( $fileName) : false|string
Parameters
$fileName :
Tags
checked
noTodo
unitTest
Return values
false|string

getFrontTemplatePaths()

フロントのテンプレートのパス一覧を取得する

public static getFrontTemplatePaths( $siteId, mixed $plugin) : mixed
Parameters
$siteId :
$plugin : mixed
Return values
mixed

getLoggedInUsers()

ログイン済のユーザー情報をログイン領域ごとに取得する

public static getLoggedInUsers([bool $assoc = true ]) : array<string|int, mixed>
Parameters
$assoc : bool = true

ログイン領域のプレフィックスをキーとして連想配列で取得するかどうか false の場合は、通常の配列として取得する

Tags
checked
noTodo
Return values
array<string|int, mixed>

getMainDomain()

メインとなるドメインを取得する

public static getMainDomain() : string
Tags
checked
notodo
unitTest
Return values
string

getPluginDir()

プラグインのディレクトリ名を取得する

public static getPluginDir( $pluginName) : false|mixed
Parameters
$pluginName :
Return values
false|mixed

getPluginPath()

プラグインのパスを取得する

public static getPluginPath( $pluginName) : string|false
Parameters
$pluginName :
Return values
string|false

getPrefix()

プレフィックス全体を取得する

public static getPrefix([bool $regex = false ]) : string
Parameters
$regex : bool = false

正規表現時にエスケープするかどうか

Tags
checked
noTodo
unitTest
Return values
string

getRequestPrefix()

指定したリクエストのプレフィックスを取得する

public static getRequestPrefix(ServerRequest $request) : string
Parameters
$request : ServerRequest
Tags
checked
noTodo
Return values
string

getRootTheme()

ルートとなるサイトのテーマを取得する

public static getRootTheme() : mixed
Tags
checked
noTodo
unitTest
Return values
mixed

getSubDomain()

サブドメインを取得する

public static getSubDomain([mixed $host = null ]) : string
Parameters
$host : mixed = null
Return values
string

getTemplateList()

レイアウトテンプレートのリストを取得する

public static getTemplateList(string $path, mixed $plugins) : array<string|int, mixed>
Parameters
$path : string
$plugins : mixed
Tags
checked
notodo
unitTest
Return values
array<string|int, mixed>

getTemplatePath()

テンプレートのpathを返す

public static getTemplatePath(string $plugin) : string|false
Parameters
$plugin : string
Tags
checked
notodo
unitTest
Return values
string|false

$templatePath

getThemeList()

テーマリストを取得する

public static getThemeList() : array<string|int, mixed>
Tags
checked
notodo
unitTest
Return values
array<string|int, mixed>

getThemesPlugins()

テーマ梱包プラグインのリストを取得する

public static getThemesPlugins(string $theme) : array<string|int, mixed>
Parameters
$theme : string

テーマ名

Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

プラグインリスト

getVersion()

バージョンを取得する

public static getVersion([mixed $plugin = '' ]) : bool|string
Parameters
$plugin : mixed = ''
Tags
checked
noTodo
unitTest
Return values
bool|string

getViewPath()

現在のビューディレクトリのパスを取得する

public static getViewPath() : string
Return values
string

includePluginClass()

プラグイン配下の Plugin クラスを読み込む

public static includePluginClass(string|array<string|int, mixed> $pluginName) : bool

Plugin クラスが読み込めていないとプラグイン自体を読み込めないため プラグインのフォルダ名は camelize と dasherize に対応 例)BcBlog / bc-blog

Parameters
$pluginName : string|array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
bool

isAdminSystem()

管理システムかチェック

public static isAdminSystem([mixed $url = null ]) : bool

《注意》by ryuring 処理の内容にCakeRequest や、Router::parse() を使おうとしたが、 Router::parse() を利用すると、Routing情報が書き換えられてしまうので利用できない。 Router::reload() や、Router::setRequestInfo() で調整しようとしたがうまくいかなかった。

Parameters
$url : mixed = null
Tags
checked
noTodo
unitTest
Return values
bool

isAdminUser()

管理ユーザーかチェック

public static isAdminUser([mixed $user = null ]) : bool
Parameters
$user : mixed = null
Tags
checked
notodo
unitTest
Return values
bool

isAgentUser()

代理ログイン状態か判別する

public static isAgentUser() : bool
Tags
checked
noTodo
unitTest
Return values
bool

isConsole()

コンソールから実行されているかチェックする $_ENV は、bootstrap にて設定 ユニットテストで状態を変更できる仕様とする

public static isConsole() : bool
Tags
checked
noTodo
unitTest
Return values
bool

isCorePlugin()

指定したプラグインがコアプラグインかどうかを判定する

public static isCorePlugin(string $plugin) : bool
Parameters
$plugin : string
Tags
checked
noTodo
unitTest
Return values
bool

isDebug()

デバッグモードかどうか

public static isDebug() : bool
Return values
bool

isInstalled()

baserCMSのインストールが完了しているかチェックする

public static isInstalled() : bool
Tags
checked
Return values
bool

isInstallMode()

インストールモードか判定する

public static isInstallMode() : bool|string|null
Tags
checked
noTodo
unitTest
Return values
bool|string|null

isMigrations()

現在の処理がCakePHPのマイグレーションコマンドかどうか

public static isMigrations() : bool
Tags
checked
noTodo
unitTest
Return values
bool

isOverPostSize()

送信されたPOSTがpost_max_sizeを超えているかチェックする

public static isOverPostSize() : bool
Tags
checked
noTodo
unitTest
Return values
bool

isSameReferrerAsCurrent()

リファラが現在のサイトと同じかどうか判定

public static isSameReferrerAsCurrent() : bool
Tags
checked
noTodo
Return values
bool

isSuperUser()

特権ユーザでのログイン状態か判別する

public static isSuperUser([mixed $user = null ]) : bool
Parameters
$user : mixed = null
Tags
checked
noTodo
unitTest
Return values
bool

isTest()

ユニットテストかどうか

public static isTest() : bool
Return values
bool

isWindows()

実行環境のOSがWindowsであるかどうかを返す

public static isWindows() : bool
Return values
bool

loginUser()

認証領域を指定してログインユーザーのデータを取得する

public static loginUser() : User|false
  • 第一優先:authenticationから取得
  • モデルが BaserCore.Users の場合、ユーザーグループがなかったら取得する
  • 第二優先:現在のリクエストに紐づくセッションから取得
  • 第三優先:上記で取得できない場合、プレフィックスが Front だった場合に、 他の領域のログインセッションより取得する。 複数のログインセッションにログインしている場合は定義順の降順で最初のログイン情報を取得

$prefix を指定したとしても authentication より取得できた場合はそちらを優先する

Tags
checked
noTodo
unitTest
Return values
User|false

loginUserFromSession()

セッションからログイン情報を取得する

public static loginUserFromSession([string $prefix = 'Admin' ]) : array<string|int, mixed>|false|mixed|null
Parameters
$prefix : string = 'Admin'
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>|false|mixed|null

loginUserGroup()

現在ログインしているユーザーのユーザーグループ情報を取得する

public static loginUserGroup() : bool|mixed
Tags
checked
notodo
unitTest
Return values
bool|mixed

ユーザーグループ情報

loginUserName()

ログインしているユーザー名を取得

public static loginUserName() : string
Return values
string

mbBasename()

日本語ファイル名対応版basename

public static mbBasename(string $str[, string $suffix = null ]) : string
Parameters
$str : string
$suffix : string = null
Return values
string

offEvent()

オベントをオフにする

public static offEvent(EventManagerInterface $eventManager, string $eventKey) : array<string|int, mixed>
Parameters
$eventManager : EventManagerInterface
$eventKey : string
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

onEvent()

イベントをオンにする

public static onEvent(EventManagerInterface $eventManager, string $eventKey, array<string|int, EventListenerInterface$eventListeners) : mixed
Parameters
$eventManager : EventManagerInterface
$eventKey : string
$eventListeners : array<string|int, EventListenerInterface>
Tags
checked
noTodo
unitTest
Return values
mixed

pairToAssoc()

引数のペアから連想配列を構築する

public static pairToAssoc() : array<string|int, mixed>

Example: aa('a','b')

Would return: array('a'=>'b')

Return values
array<string|int, mixed>

Associative array

retry()

処理を実行し、例外が発生した場合は指定した回数だけリトライする

public static retry(int $times, callable $callback, int $interval) : mixed
Parameters
$times : int

リトライ回数

$callback : callable

実行する処理

$interval : int

試行の間隔(ミリ秒)

Tags
throws
Exception
Return values
mixed

serialize()

シリアライズ

public static serialize(mixed $value) : string
Parameters
$value : mixed

対象文字列

Tags
checked
noTodo
unitTest
Return values
string

siteUrl()

サイトの設置URLを取得する

public static siteUrl() : string

index.phpは含まない

Return values
string

topLevelUrl()

サイトのトップレベルのURLを取得する

public static topLevelUrl([bool $lastSlash = true ]) : string
Parameters
$lastSlash : bool = true
Tags
checked
noTodo
unitTest
Return values
string

unserialize()

アンシリアライズ base64_decode が前提

public static unserialize(mixed $value) : mixed
Parameters
$value : mixed

対象文字列

Return values
mixed

urlencode()

URL用に文字列を変換する

public static urlencode( $value) : string

できるだけ可読性を高める為、不要な記号は除外する

Parameters
$value :
Tags
checked
noTodo
unitTest
Return values
string

verpoint()

バージョンを特定する一意の数値を取得する 2つ目以降のバージョン番号は3桁として結合 1.5.9 => 1005009 ※ 2つ目以降のバージョン番号は999までとする β版の場合はfalseを返す

public static verpoint(int|false $version) : mixed
Parameters
$version : int|false
Tags
checked
noTodo
unitTest
Return values
mixed

Search results