docs icon indicating copy to clipboard operation
docs copied to clipboard

"Creating your Own Configuration Engines" section to be rewritten

Open antograssiot opened this issue 12 years ago • 1 comments

the "Creating your Own Configuration Engines" in configuration need to be updated as the following code seems outdated.

 // In app/Lib/Configure/Engine/XmlConfig.php
    use Cake\\Utility\\Xml;

    class XmlConfig implements ConfigEngineInterface {
        public function __construct($path = null) {
            if (!$path) {
                $path = APP . 'Config' . DS;
            }
            $this->_path = $path;
        }

        public function read($key) {
            $xml = Xml::build($this->_path . $key . '.xml');
            return Xml::toArray($xml);
        }

        // As of 2.3 a dump() method is also required
        public function dump($key, $data) {
            // Code to dump data to file
        }
    }

I'll try to update this later

antograssiot avatar Aug 30 '14 09:08 antograssiot

closing as #1674 is open for that

antograssiot avatar Aug 31 '14 08:08 antograssiot