Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Yaf_Config_Ini::rewindYaf_Config_Ini::toArray>
^Yaf_Config_IniLast updated: Mon, 26 Oct 2026

Yaf_Config_Ini::set

(Yaf >=1.0.0)

Yaf_Config_Ini::set — Set a configuration value

Description

public function Yaf_Config_Ini::set(string $name, mixed $value): bool

Attempts to set a configuration value. Since Yaf_Config_Ini is always read-only, this method always fails and emits a warning.

Parameters

name

The configuration key to set.

value

The value to assign.

Return Values

Always returns false and emits a warning, because Yaf_Config_Ini is read-only.

Examples

Example #1 Yaf_Config_Ini::set() example

<?php
/**
 * Assume /etc/myapp/application.ini contains:
 * [common]
 * application.name = "MyApp"
 * database.host    = "localhost"
 * database.port    = 3306
 */
$config = new Yaf_Config_Ini('/etc/myapp/application.ini', 'common');

// Read-only: the assignment always fails, and a warning is emitted
var_dump($config->set('database.host', '192.0.2.10'));

echo $config->get('database.host'), "\n";
?>

The above example will output something similar to:

bool(false)
localhost

See Also


<Yaf_Config_Ini::rewindYaf_Config_Ini::toArray>
^Yaf_Config_IniLast updated: Mon, 26 Oct 2026