tweaked config and lang classes.

This commit is contained in:
Taylor Otwell 2011-08-02 20:20:17 -05:00
parent f087df9bb8
commit 3583bc3b09
3 changed files with 13 additions and 13 deletions

View File

@ -61,12 +61,6 @@
.wrapper h2:first-of-type { .wrapper h2:first-of-type {
margin-top: 0; margin-top: 0;
} }
.footer {
background-color: #eee;
font-size: 12px;
text-align: right;
}
</style> </style>
</head> </head>
<body> <body>
@ -81,9 +75,5 @@
<p>Need to learn more? Peruse our <a href="http://laravel.com">wonderful documentation</a>.</p> <p>Need to learn more? Peruse our <a href="http://laravel.com">wonderful documentation</a>.</p>
</div> </div>
<div class="wrapper footer">
<?php echo Benchmark::check('laravel').'ms | '.Benchmark::memory().'mb'; ?>
</div>
</body> </body>
</html> </html>

View File

@ -110,7 +110,12 @@ public static function load($file)
$config = array_merge($config, require $path); $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]);
} }
} }

View File

@ -61,7 +61,7 @@ public static function line($key, $replacements = array())
* @param mixed $default * @param mixed $default
* @return string * @return string
*/ */
public function get($language = null, $default = '') public function get($language = null, $default = null)
{ {
if (is_null($language)) if (is_null($language))
{ {
@ -72,7 +72,12 @@ public function get($language = null, $default = '')
$this->load($file, $language); $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) foreach ($this->replacements as $key => $value)
{ {