<?php // vim:set et ts=4 sw=4 sts=4:
# Copyright (C) 2003-2014 hipplay Inc.
#
# This is UNPUBLISHED PROPRIETARY SOURCE CODE OF hipplay Inc.
# The copyright notice above does not evidence any actual or intended
# publication of such source code. The contents of this file may not
# be disclosed to third parties, copied or duplicated in any form, in
# whole or in part, without the prior written permission of
# hipplay Inc.
#

namespace HipPlayConnect\Configuration;

class AxBranding extends AxConfigurationFile {

    const CONFIG_FILE = '/etc/branding.conf';
    const CONFIG_FORMAT = AxConfigurationFile::EQUALS_SEPARATED;

    protected static $INSTANCE = NULL;

    /**
     * Retrieve the value of the specified key from the Branding configuration.
     *
     * @param string $key     The configuration value to retrieve.
     * @param mixed  $default Value to return if the configured value
     *                        does not exist or is empty.
     *
     * @return string The configured value, or the supplied default.
     */
    public static function get ($key, $default = NULL) {
        return self::getInstance()->getKey($key, $default);
    }

    private static function getInstance() {
        if (self::$INSTANCE === NULL)
            self::$INSTANCE = new AxConfigurationFile(
                    self::CONFIG_FILE,
                    self::CONFIG_FORMAT
                );

        return self::$INSTANCE;
    }
}
