Fixing bugs.

This commit is contained in:
Taylor Otwell
2012-04-20 11:35:47 -05:00
parent 98ea9ac41f
commit a92ab1ca30
5 changed files with 42 additions and 24 deletions

View File

@@ -504,4 +504,24 @@ function render_each($partial, array $data, $iterator, $empty = 'raw|')
function yield($section)
{
return Laravel\Section::yield($section);
}
/**
* Get a CLI option from the argv $_SERVER variable.
*
* @param string $option
* @param mixed $default
* @return string
*/
function get_cli_option($option, $default = null)
{
foreach (Laravel\Request::foundation()->server->get('argv') as $argument)
{
if (starts_with($argument, "--{$option}="))
{
return substr($argument, strlen($option) + 3);
}
}
return value($default);
}