Commit 0e4f7268 authored by Taylor Otwell's avatar Taylor Otwell

cleaning up code before release.

parent bb0967cc
......@@ -2,18 +2,6 @@
class Hash {
/**
* Determine if an unhashed value matches a given Bcrypt hash.
*
* @param string $value
* @param string $hash
* @return bool
*/
public static function check($value, $hash)
{
return crypt($value, $hash) === $hash;
}
/**
* Hash a password using the Bcrypt hashing scheme.
*
......@@ -51,4 +39,16 @@ class Hash {
return crypt($value, '$2a$'.$work.'$'.$salt);
}
/**
* Determine if an unhashed value matches a Bcrypt hash.
*
* @param string $value
* @param string $hash
* @return bool
*/
public static function check($value, $hash)
{
return crypt($value, $hash) === $hash;
}
}
\ No newline at end of file
......@@ -183,20 +183,35 @@ class Lang {
// Language files can belongs to the application or to any bundle
// that is installed for the application. So, we'll need to use
// the bundle's path when checking for the file.
//
// This is similar to the loading method for configuration files,
// but we do not need to cascade across directories since most
// likely language files are static across environments.
$path = Bundle::path($bundle)."language/{$language}/{$file}".EXT;
// the bundle's path when looking for the file.
$path = static::path($bundle, $language, $file);
if (file_exists($path)) $lines = require $path;
if (file_exists($path))
{
$lines = require $path;
}
// All of the language lines are cached in an array so we can
// quickly look them up on subsequent reqwuests for the line.
// This keeps us from loading files each time.
static::$lines[$bundle][$language][$file] = $lines;
return count($lines) > 0;
}
/**
* Get the path to a bundle's language file.
*
* @param string $bundle
* @param string $language
* @param string $file
* @return string
*/
protected static function path($bundle, $language, $file)
{
return Bundle::path($bundle)."language/{$language}/{$file}".EXT;
}
/**
* Get the string content of the language line.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment