Phpcraft
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Phpcraft\Configuration Class Reference
Inheritance diagram for Phpcraft\Configuration:
Inheritance graph
[legend]
Collaboration diagram for Phpcraft\Configuration:
Collaboration graph
[legend]

Public Member Functions

 __construct ($file=null, $default_data=null)
 
 queueSave ()
 
 __destruct ()
 
 save ()
 
 get (string $key, $default_value=null)
 
 has (string $key)
 
 setFile (string $file)
 
 current ()
 
 next ()
 
 key ()
 
 valid ()
 
 rewind ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 set (string $key, $value)
 
 offsetUnset ($offset)
 
 unset (string $key)
 
 count ()
 

Static Public Member Functions

static handleQueue (float $time_limit=0.0)
 

Public Attributes

 $file
 
 $data
 
 $unsaved_changes = false
 

Static Public Attributes

static $save_queue
 

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\Configuration::__construct (   $file = null,
  $default_data = null 
)

◆ __destruct()

Phpcraft\Configuration::__destruct ( )

Member Function Documentation

◆ count()

Phpcraft\Configuration::count ( )

◆ current()

Phpcraft\Configuration::current ( )

◆ get()

Phpcraft\Configuration::get ( string  $key,
  $default_value = null 
)

◆ handleQueue()

static Phpcraft\Configuration::handleQueue ( float  $time_limit = 0.0)
static
Parameters
float$time_limit
Returns
void

◆ has()

Phpcraft\Configuration::has ( string  $key)
Parameters
string$key
Returns
bool

◆ key()

Phpcraft\Configuration::key ( )

◆ next()

Phpcraft\Configuration::next ( )

◆ offsetExists()

Phpcraft\Configuration::offsetExists (   $offset)

◆ offsetGet()

Phpcraft\Configuration::offsetGet (   $offset)

◆ offsetSet()

Phpcraft\Configuration::offsetSet (   $offset,
  $value 
)

◆ offsetUnset()

Phpcraft\Configuration::offsetUnset (   $offset)

◆ queueSave()

Phpcraft\Configuration::queueSave ( )

Queues the configuration for saving.

Returns
Configuration $this

◆ rewind()

Phpcraft\Configuration::rewind ( )

◆ save()

Phpcraft\Configuration::save ( )

Forces a save, removing the configuration from the save queue.

Returns
Configuration $this

◆ set()

Phpcraft\Configuration::set ( string  $key,
  $value 
)

◆ setFile()

Phpcraft\Configuration::setFile ( string  $file)
Parameters
string$file
Returns
Configuration

◆ unset()

Phpcraft\Configuration::unset ( string  $key)

◆ valid()

Phpcraft\Configuration::valid ( )

Member Data Documentation

◆ $data

Phpcraft\Configuration::$data

◆ $file

Phpcraft\Configuration::$file

◆ $save_queue

SplObjectStorage Phpcraft\Configuration::$save_queue
static

◆ $unsaved_changes

Phpcraft\Configuration::$unsaved_changes = false