public static function getSetting($key, $secondLevel = null, $defaultValue = null)
    {
        $settings = self::$settings;

        //Work with arrays
        if (is_object($settings)) {
            $settings = (array)$settings;
        }

        //Use default value if setting is not defined
        if (!array_key_exists($key, $settings)) {
            return $defaultValue;
        }

        //If second level setting access is set
        if ($secondLevel !== null) {
            //Work with arrays
            if (is_object($settings[$key])) {
                $settings[$key] = (array)$settings[$key];
            }

            if (!array_key_exists($secondLevel, $settings[$key])) {
                return $defaultValue;
            }

            return $settings[$key][$secondLevel];
        }

        return $settings[$key];
    }