a-blog cms PHP API Reference

Web
in package
implements LoggerInterface, WebLoggerInterface

Table of Contents

Interfaces

LoggerInterface
WebLoggerInterface

Constants

LOAD_RETRY_INTERVAL  = 20000
進捗ファイル読み込みリトライの待機時間(マイクロ秒)
MAX_LOAD_ATTEMPTS  = 3
進捗ファイル読み込みの最大試行回数(書き込み中の競合対策)

Properties

$destinationPath  : string
$json  : stdClass

Methods

dbUpdateSuccess()  : void
アップデート成功時
failure()  : void
アップデート失敗時
fileUpdateSuccess()  : void
ファイルのアップデート成功時
getDestinationPath()  : string
ログ書き出し先を取得
getJson()  : stdClass|null
Get json object
incrementProgress()  : void
進行状況(パーセント)を追加
init()  : void
初期化
load()  : void
ファイルからログをロード
message()  : void
メッセージを表示
setDestinationPath()  : void
ログ書き出し先を設定
terminate()  : void
アップデート終了時
build()  : void
JSON生成
readJson()  : stdClass|null
進捗ファイルを読み込み、JSON をデコードして返す。

Constants

LOAD_RETRY_INTERVAL

進捗ファイル読み込みリトライの待機時間(マイクロ秒)

private mixed LOAD_RETRY_INTERVAL = 20000

MAX_LOAD_ATTEMPTS

進捗ファイル読み込みの最大試行回数(書き込み中の競合対策)

private mixed MAX_LOAD_ATTEMPTS = 3

Properties

$destinationPath

private string $destinationPath = ''

$json

private stdClass $json

Methods

dbUpdateSuccess()

アップデート成功時

public dbUpdateSuccess() : void

failure()

アップデート失敗時

public failure(string $message) : void
Parameters
$message : string

fileUpdateSuccess()

ファイルのアップデート成功時

public fileUpdateSuccess() : void

getDestinationPath()

ログ書き出し先を取得

public getDestinationPath() : string
Return values
string

getJson()

Get json object

public getJson() : stdClass|null
Return values
stdClass|null

incrementProgress()

進行状況(パーセント)を追加

public incrementProgress([int $percentage = 0 ]) : void
Parameters
$percentage : int = 0

init()

初期化

public init() : void

load()

ファイルからログをロード

public load() : void

message()

メッセージを表示

public message(string $message[, int $percentage = 0 ][, int $status = 1 ]) : void
Parameters
$message : string
$percentage : int = 0
$status : int = 1

setDestinationPath()

ログ書き出し先を設定

public setDestinationPath(string $path) : void
Parameters
$path : string

terminate()

アップデート終了時

public terminate() : void

build()

JSON生成

protected build() : void

readJson()

進捗ファイルを読み込み、JSON をデコードして返す。

private readJson() : stdClass|null

アップデート処理(別リクエスト)が進捗ファイルを書き込んでいる最中に読み込むと、 truncate 直後の空ファイルや不完全な JSON を読み、json_decode が null を返すことがある。 その場合は短時間待って数回リトライし、書き込み完了後の内容を取得する。 ファイルが存在しない(処理未開始・完了後の削除)場合は null を返す。

Return values
stdClass|null

        
On this page

Search results