public static function resolveConfigHandler($fileName)
    {
        $configHandler = NULL;

        preg_match("/(\.)([a-z]{3,})/", $fileName, $matches);

        $fileExtension = $matches[2];

        if (!in_array($fileExtension, ConfigConsts::getExtensions())) {
            throw new ConfigException("Not correct config file extension.");
        }

        switch ($fileExtension) {
            case(ConfigConsts::INI):
                $configHandler = new ConfigIniHandler();
                break;
            default:
                throw new ConfigException("Config handler wasn't set.");
        }

        return $configHandler;
    }
public static function resolveConfigHandler($fileName)
    {
        $configHandler = NULL;

        preg_match("/(\.)([a-z]{3,})/", $fileName, $matches);

        $fileExtension = $matches[2];

        if (!in_array($fileExtension, ConfigConsts::getExtensions())) {
            throw new ConfigException("Not correct config file extension.");
        }

        switch ($fileExtension) {
            case(ConfigConsts::INI):
                $configHandler = new ConfigIniHandler();
                break;
            default:
                throw new ConfigException("Config handler wasn't set.");
        }

        return $configHandler;
    }
public static function resolveConfigHandler ( $ fileName ) { $ configHandler = NULL ; preg_match ( "/(\.)([a-z]{3,})/" , $ fileName , $ matches ) ; $ fileExtension = $ matches [ 2 ] ; if ( ! in_array ( $ fileExtension , ConfigConsts :: getExtensions ( ) ) ) { throw new ConfigException ( "Not correct config file extension." ) ; } switch ( $ fileExtension ) { case ( ConfigConsts :: INI ) : $ configHandler = new ConfigIniHandler ( ) ; break ; default : throw new ConfigException ( "Config handler wasn't set." ) ; } return $ configHandler ; }
Resolve config handler by file extension.

@param $fileName
@return ConfigIniHandler|null
@throws ConfigException
Resolve config handler by file extension .