From 3583bc3b0902882ca75220188bbad56f06c5e01c Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 2 Aug 2011 20:20:17 -0500 Subject: [PATCH] tweaked config and lang classes. --- application/views/home/index.php | 10 ---------- system/config.php | 7 ++++++- system/lang.php | 9 +++++++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/application/views/home/index.php b/application/views/home/index.php index cfef252d..6f8a0371 100644 --- a/application/views/home/index.php +++ b/application/views/home/index.php @@ -61,12 +61,6 @@ .wrapper h2:first-of-type { margin-top: 0; } - - .footer { - background-color: #eee; - font-size: 12px; - text-align: right; - } @@ -81,9 +75,5 @@

Need to learn more? Peruse our wonderful documentation.

- - \ No newline at end of file diff --git a/system/config.php b/system/config.php index cce28dce..a4bb7708 100644 --- a/system/config.php +++ b/system/config.php @@ -110,7 +110,12 @@ public static function load($file) $config = array_merge($config, require $path); } - return (count(static::$items[$file] = $config) > 0); + if (count($config) > 0) + { + static::$items[$file] = $config; + } + + return isset(static::$items[$file]); } } \ No newline at end of file diff --git a/system/lang.php b/system/lang.php index c20e3ec1..7a0b177e 100644 --- a/system/lang.php +++ b/system/lang.php @@ -61,7 +61,7 @@ public static function line($key, $replacements = array()) * @param mixed $default * @return string */ - public function get($language = null, $default = '') + public function get($language = null, $default = null) { if (is_null($language)) { @@ -72,7 +72,12 @@ public function get($language = null, $default = '') $this->load($file, $language); - $line = Arr::get(static::$lines[$language.$file], $line, $default); + if ( ! isset(static::$lines[$language.$file][$line])) + { + return is_callable($default) ? call_user_func($default) : $default; + } + + $line = static::$lines[$language.$file][$line]; foreach ($this->replacements as $key => $value) {