fixed bug in input class causing entire array to not be returned.
This commit is contained in:
parent
5475048749
commit
ad824341a6
|
@ -34,7 +34,7 @@ public static function get($key = null, $default = null)
|
||||||
static::hydrate();
|
static::hydrate();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (array_key_exists($key, static::$input)) ? static::$input[$key] : $default;
|
return Arr::get(static::$input, $key, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,7 +62,7 @@ public static function old($key = null, $default = null)
|
||||||
throw new \Exception("Sessions must be enabled to retrieve old input data.");
|
throw new \Exception("Sessions must be enabled to retrieve old input data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return (array_key_exists($key, $old = Session::get('laravel_old_input', array()))) ? $old[$key] : $default;
|
return Arr::get(Session::get('laravel_old_input', array()), $key, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,7 +81,7 @@ public static function file($key = null, $default = null)
|
||||||
return (isset($_FILES[$file][$key])) ? $_FILES[$file][$key] : $default;
|
return (isset($_FILES[$file][$key])) ? $_FILES[$file][$key] : $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (array_key_exists($key, $_FILES)) ? $_FILES[$key] : $default;
|
return Arr::get($_FILES, $key, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -20,7 +20,7 @@ public static function route($method, $uri)
|
||||||
{
|
{
|
||||||
if (is_null(static::$routes))
|
if (is_null(static::$routes))
|
||||||
{
|
{
|
||||||
static::$routes = (is_dir(APP_PATH.'routes')) ? static::load($uri) : require APP_PATH.'routes'.EXT;
|
static::$routes = static::load($uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put the request method and URI in route form. Routes begin with the request method and a forward slash.
|
// Put the request method and URI in route form. Routes begin with the request method and a forward slash.
|
||||||
|
@ -58,6 +58,11 @@ public static function route($method, $uri)
|
||||||
*/
|
*/
|
||||||
public static function load($uri)
|
public static function load($uri)
|
||||||
{
|
{
|
||||||
|
if ( ! is_dir(APP_PATH.'routes'))
|
||||||
|
{
|
||||||
|
return require APP_PATH.'routes'.EXT;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! file_exists(APP_PATH.'routes/home'.EXT))
|
if ( ! file_exists(APP_PATH.'routes/home'.EXT))
|
||||||
{
|
{
|
||||||
throw new \Exception("A [home] route file is required when using a route directory.");
|
throw new \Exception("A [home] route file is required when using a route directory.");
|
||||||
|
@ -89,7 +94,7 @@ public static function load($uri)
|
||||||
* @param string $route
|
* @param string $route
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private static function parameters($uri, $route)
|
public static function parameters($uri, $route)
|
||||||
{
|
{
|
||||||
return array_values(array_intersect_key(explode('/', $uri), preg_grep('/\(.+\)/', explode('/', $route))));
|
return array_values(array_intersect_key(explode('/', $uri), preg_grep('/\(.+\)/', explode('/', $route))));
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,14 @@ class Session {
|
||||||
*
|
*
|
||||||
* @var Session\Driver
|
* @var Session\Driver
|
||||||
*/
|
*/
|
||||||
private static $driver;
|
public static $driver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The session.
|
* The session.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private static $session = array();
|
public static $session = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the session driver.
|
* Get the session driver.
|
||||||
|
|
Loading…
Reference in New Issue