8000 Update PHPDocs for IDE support. by PATROMO · Pull Request #72 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

Update PHPDocs for IDE support. #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
L4 merge
  • Loading branch information
PATROMO committed Jan 18, 2013
commit e9c98dce31cd72ff8d60884cba37084625d382a7
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build export-ignore
/tests export-ignore
155 changes: 78 additions & 77 deletions composer.json
F438
Original file line number Diff line number Diff line change
@@ -1,77 +1,78 @@
{
"name": "laravel/framework",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"authors": [
{
"name": "Taylor Otwell",
"email": "taylorotwell@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"monolog/monolog": "1.3.*",
"swiftmailer/swiftmailer": "4.3.*",
"symfony/browser-kit": "2.2.*",
"symfony/console": "2.2.*",
"symfony/css-selector": "2.2.*",
"symfony/dom-crawler": "2.2.*",
"symfony/event-dispatcher": "2.2.*",
"symfony/finder": "2.2.*",
"symfony/http-foundation": "2.2.*",
"symfony/http-kernel": "2.2.*",
"symfony/process": "2.2.*",
"symfony/routing": "2.2.*",
"symfony/translation": "2.2.*"
},
"replace": {
"illuminate/auth": "self.version",
"illuminate/cache": "self.version",
"illuminate/config": "self.version",
"illuminate/console": "self.version",
"illuminate/container": "self.version",
"illuminate/cookie": "self.version",
"illuminate/database": "self.version",
"illuminate/encryption": "self.version",
"illuminate/events": "self.version",
"illuminate/exception": "self.version",
"illuminate/filesystem": "self.version",
"illuminate/foundation": "self.version",
"illuminate/hashing": "self.version",
"illuminate/http": "self.version",
"illuminate/log": "self.version",
"illuminate/mail": "self.version",
"illuminate/pagination": "self.version",
"illuminate/queue": "self.version",
"illuminate/redis": "self.version",
"illuminate/routing": "self.version",
"illuminate/session": "self.version",
"illuminate/support": "self.version",
"illuminate/translation": "self.version",
"illuminate/validation": "self.version",
"illuminate/view": "self.version",
"illuminate/workbench": "self.version"
},
"require-dev": {
"iron-io/iron_mq": "1.4.*",
"mockery/mockery": "0.7.2"
},
"autoload": {
"classmap": [
"src/Illuminate/Queue/Pheanstalk"
],
"files": [
"src/Illuminate/Support/helpers.php"
],
"psr-0": {
"Illuminate": "src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
}
},
"minimum-stability": "dev"
}
{
"name": "laravel/framework",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"authors": [
{
"name": "Taylor Otwell",
"email": "taylorotwell@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"ircmaxell/password-compat": "1.0.*",
"monolog/monolog": "1.3.*",
"swiftmailer/swiftmailer": "4.3.*",
"symfony/browser-kit": "2.2.*",
"symfony/console": "2.2.*",
"symfony/css-selector": "2.2.*",
"symfony/dom-crawler": "2.2.*",
"symfony/event-dispatcher": "2.2.*",
"symfony/finder": "2.2.*",
"symfony/http-foundation": "2.2.*",
"symfony/http-kernel": "2.2.*",
"symfony/process": "2.2.*",
"symfony/routing": "2.2.*",
"symfony/translation": "2.2.*"
},
"replace": {
"illuminate/auth": "self.version",
"illuminate/cache": "self.version",
"illuminate/config": "self.version",
"illuminate/console": "self.version",
"illuminate/container": "self.version",
"illuminate/cookie": "self.version",
"illuminate/database": "self.version",
"illuminate/encryption": "self.version",
"illuminate/events": "self.version",
"illuminate/exception": "self.version",
"illuminate/filesystem": "self.version",
"illuminate/foundation": "self.version",
"illuminate/hashing": "self.version",
"illuminate/http": "self.version",
"illuminate/log": "self.version",
"illuminate/mail": "self.version",
"illuminate/pagination": "self.version",
"illuminate/queue": "self.version",
"illuminate/redis": "self.version",
"illuminate/routing": "self.version",
"illuminate/session": "self.version",
"illuminate/support": "self.version",
"illuminate/translation": "self.version",
"illuminate/validation": "self.version",
"illuminate/view": "self.version",
"illuminate/workbench": "self.version"
},
"require-dev": {
"iron-io/iron_mq": "1.4.*",
"mockery/mockery": "0.7.2"
},
"autoload": {
"classmap": [
"src/Illuminate/Queue/Pheanstalk"
],
"files": [
"src/Illuminate/Support/helpers.php"
],
"psr-0": {
"Illuminate": "src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
}
},
"minimum-stability": "dev"
}
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Laravel 4 Beta Change Log

## Beta 2

- Migrated to ircmaxell's [password-compat](http://github.com/ircmaxell/password_compat) library for PHP 5.5 forward compatibility on hashes. No backward compatibility breaks.
- Inflector migrated to L4. Eloquent models now assume their table names if one is not specified. New helpers `str_plural` and `str_singular`.
- Improved `Route::controller` so that `URL::action` may be used with RESTful controllers.
14 changes: 14 additions & 0 deletions src/Illuminate/Auth/Guard.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,20 @@ public function login(UserInterface $user, $remember = false)
$this->user = $user;
}

/**
* Log the given user ID into the application.
*
* @param mixed $id
* @param bool $remember
* @return Illuminate\Auth\UserInterface
*/
public function loginUsingId($id, $remember = false)
{
$this->session->put($this->getName(), $id);

return $this->login($this->user(), $remember);
}

/**
* Create a remember me cookie for a given ID.
*
Expand Down
10 changes: 10 additions & 0 deletions src/Illuminate/Cache/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ protected function createMemcachedDriver()
return new MemcachedStore($memcached, $this->app['config']['cache.prefix']);
}

/**
* Create an instance of the WinCache cache driver.
*
* @return \Illuminate\Cache\WinCacheStore
*/
protected function createWincacheDriver()
{
return new WinCacheStore($this->app['config']['cache.prefix']);
}

/**
* Create an instance of the Redis cache driver.
*
Expand Down
85 changes: 85 additions & 0 deletions src/Illuminate/Cache/WinCacheStore.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php namespace Illuminate\Cache;

class WinCacheStore extends Store {

/**
* A string that should be prepended to keys.
*
* @var string
*/
protected $prefix;

/**
* Create a new WinCache store.
*
* @param string $prefix
* @return void
*/
public function __construct($prefix = '')
{
$this->prefix = $prefix;
}

/**
* Retrieve an item from the cache by key.
*
* @param string $key
* @return mixed
*/
protected function retrieveItem($key)
{
$value = wincache_ucache_get($this->prefix.$key);

if ($value !== false)
{
return $value;
}
}

/**
* Store an item in the cache for a given number of minutes.
*
* @param string $key
* @param mixed $value
* @param int $minutes
* @return void
*/
protected function storeItem($key, $value, $minutes)
{
wincache_ucache_add($this->prefix.$key, value, $minutes * 60);
}

/**
* Store an item in the cache indefinitely.
*
* @param string $key
* @param mixed $value
* @return void
*/
protected function storeItemForever($key, $value)
{
return $this->storeItem($key, $value, 0);
}

/**
* Remove an item from the cache.
*
* @param string $key
* @return void
*/
protected function removeItem($key)
{
wincache_ucache_delete($this->prefix.$key);
}

/**
* Remove all items from the cache.
*
* @return void
*/
protected function flushItems()
{
wincache_ucache_clear();
}

}
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ public function newCollection(array $models = array())
*/
public function getTable()
{
return $this->table;
return $this->table ?: snake_case(str_plural(get_class($this)));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Exception/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function hints(ReflectionFunction $reflection, $exception)
*/
public function error(Closure $callback)
{
$this->handlers[] = $callback;
array_unshift($this->handlers, $callback);
}

}
34 changes: 3 additions & 31 deletions src/Illuminate/Hashing/BcryptHasher.php
F438
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,9 @@ class BcryptHasher implements HasherInterface {
*/
public function make($value, array $options = array())
{
$rounds = isset($options['rounds']) ? $options['rounds'] : 8;
$cost = isset($options['rounds']) ? $options['rounds'] : 8;

$work = str_pad($rounds, 2, '0', STR_PAD_LEFT);

// Bcrypt expects the salt to be 22 base64 encoded characters including dots
// and slashes. We will get rid of the plus signs included in the base64
// data and replace them all with dots so it's appropriately encoded.
if (function_exists('openssl_random_pseudo_bytes'))
{
$salt = openssl_random_pseudo_bytes(16);
}
else
{
$salt = $this->getRandomSalt();
}

$salt = substr(strtr(base64_encode($salt), '+', '.'), 0 , 22);

return crypt($value, '$2a$'.$work.'$'.$salt);
return password_hash($value, PASSWORD_BCRYPT, array('cost' => $cost));
}

/**
Expand All @@ -42,19 +26,7 @@ public function make($value, array $options = array())
*/
public function check($value, $hashedValue, array $options = array())
{
return crypt($value, $hashedValue) === $hashedValue;
}

/**
* Get a random salt to use during hashing.
*
* @return string
*/
protected function getRandomSalt()
{
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';

return substr(str_shuffle(str_repeat($pool, 5)), 0, 40);
return password_verify($value, $hashedValue);
}

}
3 changes: 2 additions & 1 deletion src/Illuminate/Hashing/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
],
"require": {
"php": ">=5.3.0",
"illuminate/support": "4.0.x"
"illuminate/support": "4.0.x",
"ircmaxell/password-compat": "1.0.*"
},
"autoload": {
"psr-0": {
Expand Down
Loading
0