src/Expose/Config.php
public function set($path, $value)
    {
        $p = explode('.', $path);
        $cfg = &$this->config;
        $count = 1;

        foreach ($p as $part) {
            if ($count == count($p)) {
                $cfg[$part] = $value;
                continue;
            }
            if (array_key_exists($part, $cfg)) {
                $cfg = &$cfg[$part];
            } else {
                // create the path
                $cfg[$part] = array();
                $cfg = &$cfg[$part];
            }
            $count++;
        }
    }
public function set($path, $value)
    {
        $p = explode('.', $path);
        $cfg = &$this->config;
        $count = 1;

        foreach ($p as $part) {
            if ($count == count($p)) {
                $cfg[$part] = $value;
                continue;
            }
            if (array_key_exists($part, $cfg)) {
                $cfg = &$cfg[$part];
            } else {
                // create the path
                $cfg[$part] = array();
                $cfg = &$cfg[$part];
            }
            $count++;
        }
    }
public function set ( $ path , $ value ) { $ p = explode ( '.' , $ path ) ; $ cfg = & $ this -> config ; $ count = 1 ; foreach ( $ p as $ part ) { if ( $ count == count ( $ p ) ) { $ cfg [ $ part ] = $ value ; continue ; } if ( array_key_exists ( $ part , $ cfg ) ) { $ cfg = & $ cfg [ $ part ] ; } else { // create the path $ cfg [ $ part ] = array ( ) ; $ cfg = & $ cfg [ $ part ] ; } $ count ++ ; } }
Set the configuration option based on the "path"

@param string $path Config "path" (Ex. "foo.bar.baz")
@param mixed $value Value of config
Set the configuration option based on the path