Yaf_Config_Abstract::readonly

Check if configuration is read-only

Description

abstract public bool Yaf_Config_Abstract::readonly()

Checks whether the configuration is read-only. This method is abstract and must be implemented by subclasses.

Parameters

This function has no parameters.

Return Values

Returns true if the configuration is read-only, false otherwise.

Examples

Example #1 Yaf_Config_Abstract::readonly example

<?php
$ini = new Yaf_Config_Ini('/etc/myapp/application.ini', 'common');
var_dump($ini->readonly()); // Yaf_Config_Ini is always read-only

$writable = new Yaf_Config_Simple(['env' => 'development']);
var_dump($writable->readonly());

$frozen = new Yaf_Config_Simple(['env' => 'development'], true);
var_dump($frozen->readonly());
?>

The above example will output something similar to:

bool(true)
bool(false)
bool(true)

See Also

  • Yaf_Config_Abstract::set
  • Yaf_Config_Ini::readonly
  • Yaf_Config_Simple::readonly