Fuelクラス

Fuelクラスには、Fuelフレームワークのコアメソッドが含まれています。 本ドキュメントでは、アプリケーションで利用可能な同クラスのpublicメソッドを纏めています。 ここに記していないメソッドはクラス内部でのみ利用されるものなので、利用してはいけません。

クラス定数

環境定数。config.phpにおいてアプリケーションの動作環境を定めるために用いられます。

名前 タイプ 説明
TEST 文字列型
'test'
テスト環境を同定します。
DEVELOPMENT 文字列型
'development'
開発環境を同定します。
STAGE 文字列型
'stage'
ステージング環境を同定します。
PRODUCTION 文字列型
'production'
製品環境を同定します。

ロギング定数。Logクラスで用いられます。またlogger():関数で用いられます。

名前 タイプ 説明
L_NONE 整数型
0
ロギングレベル 0:ログをとりません。
L_ERROR 整数型
1
エラーメッセージのログをとります。
L_WARNING 整数型
2
警告メッセージのログをとります。
L_DEBUG 整数型
3
デバッグメッセージのログをとります。
L_INFO 整数型
4
情報メッセージのログをとります。
L_ALL 整数型
5
全てのレベルのログをとります。

Other constants:

名前 タイプ 説明
VERSION 文字列型
'1.1'
インストールされているFuelのバージョンです。

Class properties

Note that although these properties are defined as public, you should not alter them without good reason.

Name Static Type Value Description
$initialized yes boolean
false
Indicates if the framework has been initialized.
$env yes string
FUEL::DEVELOPMENT
Environment the framework runs in. Must be one of the environment constants mentioned above.
$profiling yes boolean
false
If true, the profiler has been enabled.
$locale yes string
en_US
Currently defined locale.
$timezone yes string
UTC
Currently defined timezone.
$encoding yes string
UTF8
Currently defined character encoding.
$is_cli yes boolean
false
If true, the framework runs in CLI mode.
$is_test yes boolean
false
If true, the framework runs in Unit Test mode.

load($file)

loadメソッドは、指定ファイルをロード(インクルード)し、その結果を返します。例えば、設定ファイルをロードする時に本メソッドは使われます。その場合、設定情報は配列で返されます。

Static Yes
パラメタ
Param 初期値 解説
$file 必須 ロードしたいファイル名
返り値 Mixed
// あるPHP fileをロード
if (Fuel::load('myfile.php'))
{
	echo "MyFile was loaded successfully";
}

次の点に留意してください。もしインクルードされるファイルにreturn宣言が含まれていない(NOT)場合、ロードが成功すればload() は1を返し、失敗すれば0を返します!