Config_lite interface does not allow to remove keys from section-less configs #4

DocAl opened this Issue Jun 28, 2012 · 1 comment


None yet

2 participants


It seems to be impossible to remove key from the file, that have no sections in it.

PEAR - PHP Extension and Application Repository member
pce commented Jul 2, 2012


thanks, i fixed that behaviour.

Config_Lite should throw an Exception,
if you try to remove a key of a non existing section or key, now.

// example of Config_Lite set and remove global value :
require_once '../Config/Lite.php';

$config = new Config_Lite('tipota.cfg');
$config->set(null, 'global-key', 'val');
$config->remove(null, 'global-key');

try  {
  $config->remove(null, 'catched-global-key'); // <- throws  exception 'Config_Lite_Exception_UnexpectedValue' 
} catch (Exception $ex) {
  // 'No such global Value.' 

 // throws exception 'Config_Lite_Exception_UnexpectedValue' 
// $config->remove(null, 'another-global-key');
@pce pce pushed a commit that referenced this issue Jul 2, 2012
pce #4 remove global key 6e8184e
@pce pce closed this Jul 2, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment