Enlight_Config_Exception example

if (isset($options['section'])) {
            $this->setSection($options['section']);
        }
        if (isset($options['extends'])) {
            $this->setExtends($options['extends']);
        }
        if (\is_array($config)) {
            $this->setData($config);
        } elseif ($config !== null) {
            $this->setName($config);
        } else {
            throw new Enlight_Config_Exception('Please specify configuration data');
        }
    }

    /** * Supports isset() overloading on PHP 5.1 * * @param string $name * * @return bool */
    public function __isset($name)
    {

    public function __set($name$value)
    {
        if ($this->_allowModifications) {
            if (\is_array($value)) {
                $this->_data[$name] = new self($value, true);
            } else {
                $this->_data[$name] = $value;
            }
            $this->_count = \count($this->_data);
        } else {
            throw new Enlight_Config_Exception('Enlight_Config_BaseConfig is read only');
        }
    }

    /** * Deep clone of this instance to ensure that nested Enlight_Config_BaseConfigs * are also cloned. * * @return void */
    public function __clone()
    {
        


        if ($config !== null) {
            $this->setConfig($config);
        }

        if ($exclusiveLock !== null) {
            $this->setExclusiveLock($exclusiveLock);
        }

        if ($this->_filename === null) {
            throw new Enlight_Config_Exception('No filename was set');
        }

        if ($this->_config === null) {
            throw new Enlight_Config_Exception('No config was set');
        }

        $configString = $this->render();

        $flags = 0;

        if ($this->_exclusiveLock) {
            

    public function __construct($filename$section = null, $options = false)
    {
        if (empty($filename)) {
            throw new Enlight_Config_Exception('Filename is not set');
        }

        $allowModifications = false;
        if (\is_bool($options)) {
            $allowModifications = $options;
        } elseif (\is_array($options)) {
            if (isset($options['allowModifications'])) {
                $allowModifications = (bool) $options['allowModifications'];
            }
            if (isset($options['nestSeparator'])) {
                $nestSeparator = (string) $options['nestSeparator'];
                
Home | Imprint | This part of the site doesn't use cookies.