src/Component.php
public function settings($name = null, $value = null)
    {
        switch (func_num_args()) {
            case 0: // they want it all
                return $this->info('settings');
                break;
            case 1: // they want to retrieve a specific setting
                return $this->info('settings', func_get_arg(0));
                break;
            case 2: // they want to establish a setting
                $update = false;
                list($name, $value) = func_get_args();
                $current = $this->info('settings', $name);
                if (is_null($value)) {
                    // then we don't want this in the database as "null" is the default value
                    if (!is_null($current)) {
                        unset($this->info['settings'][$name]);
                        $update = true;
                    }
                } elseif ($current !== $value) {
                    $this->info['settings'][$name] = $value;
                    $update = true;
                }
                if ($update) {
                    $this->exec('UPDATE config SET settings = ?', serialize($this->info['settings']));
                }
                break;
        }
    }
public function settings($name = null, $value = null)
    {
        switch (func_num_args()) {
            case 0: // they want it all
                return $this->info('settings');
                break;
            case 1: // they want to retrieve a specific setting
                return $this->info('settings', func_get_arg(0));
                break;
            case 2: // they want to establish a setting
                $update = false;
                list($name, $value) = func_get_args();
                $current = $this->info('settings', $name);
                if (is_null($value)) {
                    // then we don't want this in the database as "null" is the default value
                    if (!is_null($current)) {
                        unset($this->info['settings'][$name]);
                        $update = true;
                    }
                } elseif ($current !== $value) {
                    $this->info['settings'][$name] = $value;
                    $update = true;
                }
                if ($update) {
                    $this->exec('UPDATE config SET settings = ?', serialize($this->info['settings']));
                }
                break;
        }
    }
Create and retrieve database settings.

@param string $name  What you want to either set or return.
@param mixed  $value The setting's value. If you want to remove the setting, then set this explicitly to ``null``.

@return mixed An array of all the settings (if no parameters are given), or the setting's value (if no value is given).

@example

```php
$db->settings('version', '1.2');

echo $db->settings('version'); // 1.2
```