Fuel Class

The Fuel class contains the core methods of the Fuel framework. The public methods in this class that can be used in your application are documented here. All other methods are for internal use only, and should not be used.

Class constants

Environment constants. These are used in your config.php to define the application environment:

Name Type Value Description
TEST string
'test'
Identifies the TEST environment.
DEVELOPMENT string
'development'
Identifies the DEVELOPMENT environment.
STAGING string
'staging'
Identifies the STAGING environment.
PRODUCTION string
'production'
Identifies the PRODUCTION environment.

Logging constants. These are used by the Log class, and by the function logger():

Name Type Value Description
L_NONE integer
0
Logging level 0: do not log.
L_ERROR integer
1
Indicates an error message is logged.
L_WARNING integer
2
Indicates an warning is logged.
L_DEBUG integer
3
Indicates a debug message is logged.
L_INFO integer
4
Indicates an informational message is logged.
L_ALL integer
5
All logging levels.

Other constants:

Name Type Value Description
VERSION string
''
Version of the current Fuel installation.

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
'UTF-8'
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)

The load method loads (includes) a given file, and returns the results. This method is used for example to load configuration files, which return an array of configuration settings.

Static Yes
Parameters
Param Default Description
$file required Filename of the file to be loaded
Returns Mixed
Example
// load a PHP file
if (Fuel::load('myfile.php'))
{
	echo "MyFile was loaded successfully";
}

Note that if the included file does NOT contain a return statement, load() will return 1 if the load was successful, or 0 if the file could not be loaded!