Skip to content

Commit e9c98dc

Browse files
committed
L4 merge
1 parent 7a97504 commit e9c98dc

File tree

66 files changed

+1086
-588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1086
-588
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build export-ignore
2+
/tests export-ignore

composer.json

Lines changed: 78 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,78 @@
1-
{
2-
"name": "laravel/framework",
3-
"description": "The Laravel Framework.",
4-
"keywords": ["framework", "laravel"],
5-
"license": "MIT",
6-
"authors": [
7-
{
8-
"name": "Taylor Otwell",
9-
"email": "taylorotwell@gmail.com"
10-
}
11-
],
12-
"require": {
13-
"php": ">=5.3.0",
14-
"monolog/monolog": "1.3.*",
15-
"swiftmailer/swiftmailer": "4.3.*",
16-
"symfony/browser-kit": "2.2.*",
17-
"symfony/console": "2.2.*",
18-
"symfony/css-selector": "2.2.*",
19-
"symfony/dom-crawler": "2.2.*",
20-
"symfony/event-dispatcher": "2.2.*",
21-
"symfony/finder": "2.2.*",
22-
"symfony/http-foundation": "2.2.*",
23-
"symfony/http-kernel": "2.2.*",
24-
"symfony/process": "2.2.*",
25-
"symfony/routing": "2.2.*",
26-
"symfony/translation": "2.2.*"
27-
},
28-
"replace": {
29-
"illuminate/auth": "self.version",
30-
"illuminate/cache": "self.version",
31-
"illuminate/config": "self.version",
32-
"illuminate/console": "self.version",
33-
"illuminate/container": "self.version",
34-
"illuminate/cookie": "self.version",
35-
"illuminate/database": "self.version",
36-
"illuminate/encryption": "self.version",
37-
"illuminate/events": "self.version",
38-
"illuminate/exception": "self.version",
39-
"illuminate/filesystem": "self.version",
40-
"illuminate/foundation": "self.version",
41-
"illuminate/hashing": "self.version",
42-
"illuminate/http": "self.version",
43-
"illuminate/log": "self.version",
44-
"illuminate/mail": "self.version",
45-
"illuminate/pagination": "self.version",
46-
"illuminate/queue": "self.version",
47-
"illuminate/redis": "self.version",
48-
"illuminate/routing": "self.version",
49-
"illuminate/session": "self.version",
50-
"illuminate/support": "self.version",
51-
"illuminate/translation": "self.version",
52-
"illuminate/validation": "self.version",
53-
"illuminate/view": "self.version",
54-
"illuminate/workbench": "self.version"
55-
},
56-
"require-dev": {
57-
"iron-io/iron_mq": "1.4.*",
58-
"mockery/mockery": "0.7.2"
59-
},
60-
"autoload": {
61-
"classmap": [
62-
"src/Illuminate/Queue/Pheanstalk"
63-
],
64-
"files": [
65-
"src/Illuminate/Support/helpers.php"
66-
],
67-
"psr-0": {
68-
"Illuminate": "src/"
69-
}
70-
},
71-
"extra": {
72-
"branch-alias": {
73-
"dev-master": "4.0-dev"
74-
}
75-
},
76-
"minimum-stability": "dev"
77-
}
1+
{
2+
"name": "laravel/framework",
3+
"description": "The Laravel Framework.",
4+
"keywords": ["framework", "laravel"],
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Taylor Otwell",
9+
"email": "taylorotwell@gmail.com"
10+
}
11+
],
12+
"require": {
13+
"php": ">=5.3.0",
14+
"ircmaxell/password-compat": "1.0.*",
15+
"monolog/monolog": "1.3.*",
16+
"swiftmailer/swiftmailer": "4.3.*",
17+
"symfony/browser-kit": "2.2.*",
18+
"symfony/console": "2.2.*",
19+
"symfony/css-selector": "2.2.*",
20+
"symfony/dom-crawler": "2.2.*",
21+
"symfony/event-dispatcher": "2.2.*",
22+
"symfony/finder": "2.2.*",
23+
"symfony/http-foundation": "2.2.*",
24+
"symfony/http-kernel": "2.2.*",
25+
"symfony/process": "2.2.*",
26+
"symfony/routing": "2.2.*",
27+
"symfony/translation": "2.2.*"
28+
},
29+
"replace": {
30+
"illuminate/auth": "self.version",
31+
"illuminate/cache": "self.version",
32+
"illuminate/config": "self.version",
33+
"illuminate/console": "self.version",
34+
"illuminate/container": "self.version",
35+
"illuminate/cookie": "self.version",
36+
"illuminate/database": "self.version",
37+
"illuminate/encryption": "self.version",
38+
"illuminate/events": "self.version",
39+
"illuminate/exception": "self.version",
40+
"illuminate/filesystem": "self.version",
41+
"illuminate/foundation": "self.version",
42+
"illuminate/hashing": "self.version",
43+
"illuminate/http": "self.version",
44+
"illuminate/log": "self.version",
45+
"illuminate/mail": "self.version",
46+
"illuminate/pagination": "self.version",
47+
"illuminate/queue": "self.version",
48+
"illuminate/redis": "self.version",
49+
"illuminate/routing": "self.version",
50+
"illuminate/session": "self.version",
51+
"illuminate/support": "self.version",
52+
"illuminate/translation": "self.version",
53+
"illuminate/validation": "self.version",
54+
"illuminate/view": "self.version",
55+
"illuminate/workbench": "self.version"
56+
},
57+
"require-dev": {
58+
"iron-io/iron_mq": "1.4.*",
59+
"mockery/mockery": "0.7.2"
60+
},
61+
"autoload": {
62+
"classmap": [
63+
"src/Illuminate/Queue/Pheanstalk"
64+
],
65+
"files": [
66+
"src/Illuminate/Support/helpers.php"
67+
],
68+
"psr-0": {
69+
"Illuminate": "src/"
70+
}
71+
},
72+
"extra": {
73+
"branch-alias": {
74+
"dev-master": "4.0-dev"
75+
}
76+
},
77+
"minimum-stability": "dev"
78+
}

readme.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Laravel 4 Beta Change Log
2+
3+
## Beta 2
4+
5+
- 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.
6+
- Inflector migrated to L4. Eloquent models now assume their table names if one is not specified. New helpers `str_plural` and `str_singular`.
7+
- Improved `Route::controller` so that `URL::action` may be used with RESTful controllers.

src/Illuminate/Auth/Guard.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,20 @@ public function login(UserInterface $user, $remember = false)
182182
$this->user = $user;
183183
}
184184

185+
/**
186+
* Log the given user ID into the application.
187+
*
188+
* @param mixed $id
189+
* @param bool $remember
190+
* @return Illuminate\Auth\UserInterface
191+
*/
192+
public function loginUsingId($id, $remember = false)
193+
{
194+
$this->session->put($this->getName(), $id);
195+
196+
return $this->login($this->user(), $remember);
197+
}
198+
185199
/**
186200
* Create a remember me cookie for a given ID.
187201
*

src/Illuminate/Cache/CacheManager.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ protected function createMemcachedDriver()
5050
return new MemcachedStore($memcached, $this->app['config']['cache.prefix']);
5151
}
5252

53+
/**
54+
* Create an instance of the WinCache cache driver.
55+
*
56+
* @return \Illuminate\Cache\WinCacheStore
57+
*/
58+
protected function createWincacheDriver()
59+
{
60+
return new WinCacheStore($this->app['config']['cache.prefix']);
61+
}
62+
5363
/**
5464
* Create an instance of the Redis cache driver.
5565
*
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?php namespace Illuminate\Cache;
2+
3+
class WinCacheStore extends Store {
4+
5+
/**
6+
* A string that should be prepended to keys.
7+
*
8+
* @var string
9+
*/
10+
protected $prefix;
11+
12+
/**
13+
* Create a new WinCache store.
14+
*
15+
* @param string $prefix
16+
* @return void
17+
*/
18+
public function __construct($prefix = '')
19+
{
20+
$this->prefix = $prefix;
21+
}
22+
23+
/**
24+
* Retrieve an item from the cache by key.
25+
*
26+
* @param string $key
27+
* @return mixed
28+
*/
29+
protected function retrieveItem($key)
30+
{
31+
$value = wincache_ucache_get($this->prefix.$key);
32+
33+
if ($value !== false)
34+
{
35+
return $value;
36+
}
37+
}
38+
39+
/**
40+
* Store an item in the cache for a given number of minutes.
41+
*
42+
* @param string $key
43+
* @param mixed $value
44+
* @param int $minutes
45+
* @return void
46+
*/
47+
protected function storeItem($key, $value, $minutes)
48+
{
49+
wincache_ucache_add($this->prefix.$key, value, $minutes * 60);
50+
}
51+
52+
/**
53+
* Store an item in the cache indefinitely.
54+
*
55+
* @param string $key
56+
* @param mixed $value
57+
* @return void
58+
*/
59+
protected function storeItemForever($key, $value)
60+
{
61+
return $this->storeItem($key, $value, 0);
62+
}
63+
64+
/**
65+
* Remove an item from the cache.
66+
*
67+
* @param string $key
68+
* @return void
69+
*/
70+
protected function removeItem($key)
71+
{
72+
wincache_ucache_delete($this->prefix.$key);
73+
}
74+
75+
/**
76+
* Remove all items from the cache.
77+
*
78+
* @return void
79+
*/
80+
protected function flushItems()
81+
{
82+
wincache_ucache_clear();
83+
}
84+
85+
}

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ public function newCollection(array $models = array())
584584
*/
585585
public function getTable()
586586
{
587-
return $this->table;
587+
return $this->table ?: snake_case(str_plural(get_class($this)));
588588
}
589589

590590
/**

src/Illuminate/Exception/Handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ protected function hints(ReflectionFunction $reflection, $exception)
107107
*/
108108
public function error(Closure $callback)
109109
{
110-
$this->handlers[] = $callback;
110+
array_unshift($this->handlers, $callback);
111111
}
112112

113113
}

src/Illuminate/Hashing/BcryptHasher.php

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,9 @@ class BcryptHasher implements HasherInterface {
1111
*/
1212
public function make($value, array $options = array())
1313
{
14-
$rounds = isset($options['rounds']) ? $options['rounds'] : 8;
14+
$cost = isset($options['rounds']) ? $options['rounds'] : 8;
1515

16-
$work = str_pad($rounds, 2, '0', STR_PAD_LEFT);
17-
18-
// Bcrypt expects the salt to be 22 base64 encoded characters including dots
19-
// and slashes. We will get rid of the plus signs included in the base64
20-
// data and replace them all with dots so it's appropriately encoded.
21-
if (function_exists('openssl_random_pseudo_bytes'))
22-
{
23-
$salt = openssl_random_pseudo_bytes(16);
24-
}
25-
else
26-
{
27-
$salt = $this->getRandomSalt();
28-
}
29-
30-
$salt = substr(strtr(base64_encode($salt), '+', '.'), 0 , 22);
31-
32-
return crypt($value, '$2a$'.$work.'$'.$salt);
16+
return password_hash($value, PASSWORD_BCRYPT, array('cost' => $cost));
3317
}
3418

3519
/**
@@ -42,19 +26,7 @@ public function make($value, array $options = array())
4226
*/
4327
public function check($value, $hashedValue, array $options = array())
4428
{
45-
return crypt($value, $hashedValue) === $hashedValue;
46-
}
47-
48-
/**
49-
* Get a random salt to use during hashing.
50-
*
51-
* @return string
52-
*/
53-
protected function getRandomSalt()
54-
{
55-
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
56-
57-
return substr(str_shuffle(str_repeat($pool, 5)), 0, 40);
29+
return password_verify($value, $hashedValue);
5830
}
5931

6032
}

src/Illuminate/Hashing/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
],
1111
"require": {
1212
"php": ">=5.3.0",
13-
"illuminate/support": "4.0.x"
13+
"illuminate/support": "4.0.x",
14+
"ircmaxell/password-compat": "1.0.*"
1415
},
1516
"autoload": {
1617
"psr-0": {

0 commit comments

Comments
 (0)