protected function readConfiguration()
    {
        // Return if already loaded
        if (is_array($this->config)) {
            return;
        }
        
        $fileName = $this->dir . static::CONFIG_FILE;
        
        // Abort if the file doesn't exist
        if (!file_exists($fileName)) {
            $this->config = $this->validateConfiguration();
            return;
        }
        
        $modifyTime = filemtime($fileName);
        if (false === $modifyTime) {
            throw new \RuntimeException("Unable to get mtime of the configuration file.");
        }
        
        // Check if the configuration is in cache
        $cacheKey = md5($fileName);
        if ($this->cache->has($cacheKey)) {
            $this->config=$this->cache->get($cacheKey);
            
            // Cached file is up to date
            if ($this->config["_mtime"] === $modifyTime) {
                return;
            }
        }

        if (($yaml = self::readFile($fileName)) !== false) {
            $config = \Symfony\Component\Yaml\Yaml::parse($yaml);
            $this->config = $this->validateConfiguration($config);
        } else {
            throw new \RuntimeException("Unable to read configuration file.");
        }
        
        // Save to cache with updated modify-time
        $storedConfig = $this->config;
        $storedConfig["_mtime"]= $modifyTime;
        $this->cache->set($cacheKey, $storedConfig);
    }