8000 Merge pull request #1 from laravel/master · atinder-snippets/laravel@f742cc3 · GitHub
[go: up one dir, main page]

Skip to content

Commit f742cc3

Browse files
committed
Merge pull request laravel#1 from laravel/master
merge
2 parents 2e8b557 + b9cf8df commit f742cc3

Some content is hidden

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

70 files changed

+1530
-278
lines changed

application/config/application.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
'Blade' => 'Laravel\\Blade',
160160
'Bundle' => 'Laravel\\Bundle',
161161
'Cache' => 'Laravel\\Cache',
162+
'Command' => 'Laravel\\CLI\\Command',
162163
'Config' => 'Laravel\\Config',
163164
'Controller' => 'Laravel\\Routing\\Controller',
164165
'Cookie' => 'Laravel\\Cookie',
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
return array(
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Pagination Language Lines
8+
|--------------------------------------------------------------------------
9+
|
10+
| The following language lines are used by the paginator library to build
11+
| the pagination links. You're free to change them to anything you want.
12+
| If you come up with something more exciting, let us know.
13+
|
14+
*/
15+
16+
'previous' => '&laquo; Inapoi',
17+
'next' => 'Inainte &raquo;',
18+
19+
);
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?php
2+
3+
return array(
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Validation Language Lines
8+
|--------------------------------------------------------------------------
9+
|
10+
| The following language lines contain the default error messages used
11+
| by the validator class. Some of the rules contain multiple versions,
12+
| such as the size (max, min, between) rules. These versions are used
13+
| for different input types such as strings and files.
14+
|
15+
| These language lines may be easily changed to provide custom error
16+
| messages in your application. Error messages for custom validation
17+
| rules may also be added to this file.
18+
|
19+
*/
20+
21+
"accepted" => "Campul :attribute trebuie sa fie acceptat.",
22+
"active_url" => "Campul :attribute nu este un URL valid.",
23+
"after" => "Campul :attribute trebuie sa fie o data dupa :date.",
24+
"alpha" => "Campul :attribute poate contine numai litere.",
25+
"alpha_dash" => "Campul :attribute poate contine numai litere, numere si liniute.",
26+
"alpha_num" => "Campul :attribute poate contine numai litere si numere.",
27+
"array" => "Campul :attribute trebuie sa aiba elemente selectate.",
28+
"before" => "Campul :attribute trebuie sa fie o data inainte de :date.",
29+
"between" => array(
30+
"numeric" => "Campul :attribute trebuie sa fie intre :min si :max.",
31+
"file" => "Campul :attribute trebuie sa fie intre :min si :max kilobytes.",
32+
"string" => "Campul :attribute trebuie sa fie intre :min si :max caractere.",
33+
),
34+
"confirmed" => "Confirmarea :attribute nu se potriveste.",
35+
"count" => "Campul :attribute trebuie sa aiba exact :count elemente selectate.",
36+
"countbetween" => "Campul :attribute trebuie sa aiba intre :min si :max elemente selectate.",
37+
"countmax" => "Campul :attribute trebuie sa aiba mai putin de :max elemente selectate.",
38+
"countmin" => "Campul :attribute trebuie sa aiba cel putin :min elemente selectate.",
39+
"date_format" => "Campul :attribute trebuie sa fie intr-un format valid.",
40+
"different" => "Campurile :attribute si :other trebuie sa fie diferite.",
41+
"email" => "Formatul campului :attribute este invalid.",
42+
"exists" => "Campul :attribute selectat este invalid.",
43+
"image" => "Campul :attribute trebuie sa fie o imagine.",
44+
"in" => "Campul :attribute selectat este invalid.",
45+
"integer" => "Campul :attribute trebuie sa fie un numar intreg.",
46+
"ip" => "Campul :attribute trebuie sa fie o adresa IP valida.",
47+
"match" => "Formatul campului :attribute este invalid.",
48+
"max" => array(
49+
"numeric" => "Campul :attribute trebuie sa fie mai mic de :max.",
50+
"file" => "Campul :attribute trebuie sa fie mai mic de :max kilobytes.",
51+
"string" => "Campul :attribute trebuie sa fie mai mic de :max caractere.",
52+
),
53+
"mimes" => "Campul :attribute trebuie sa fie un fisier de tipul: :values.",
54+
"min" => array(
55+
"numeric" => "Campul :attribute trebuie sa fie cel putin :min.",
56+
"file" => "Campul :attribute trebuie sa aiba cel putin :min kilobytes.",
57+
"string" => "Campul :attribute trebuie sa aiba cel putin :min caractere.",
58+
),
59+
"not_in" => "Campul :attribute selectat este invalid.",
60+
"numeric" => "Campul :attribute trebuie sa fie un numar.",
61+
"required" => "Campul :attribute este obligatoriu.",
62+
"required_with" => "Campul :attribute este obligatoriu cu :field",
63+
"same" => "Campul :attribute si :other trebuie sa fie identice.",
64+
"size" => array(
65+
"numeric" => "Campul :attribute trebuie sa fie :size.",
66+
"file" => "Campul :attribute trebuie sa aiba :size kilobyte.",
67+
"string" => "Campul :attribute trebuie sa aiba :size caractere.",
68+
),
69+
"unique" => "Campul :attribute a fost deja folosit.",
70+
"url" => "Campul :attribute nu este intr-un format valid.",
71+
72+
/*
73+
|--------------------------------------------------------------------------
74+
| Custom Validation Language Lines
75+
|--------------------------------------------------------------------------
76+
|
77+
| Here you may specify custom validation messages for attributes using the
78+
| convention "attribute_rule" to name the lines. This helps keep your
79+
| custom validation clean and tidy.
80+
|
81+
| So, say you want to use a custom validation message when validating that
82+
| the "email" attribute is unique. Just add "email_unique" to this array
83+
| with your custom message. The Validator will handle the rest!
84+
|
85+
*/
86+
87+
'custom' => array(),
88+
89+
/*
90+
|--------------------------------------------------------------------------
91+
| Validation Attributes
92+
|--------------------------------------------------------------------------
93+
|
94+
| The following language lines are used to swap attribute place-holders
95+
| with something more reader friendly such as "E-Mail Address" instead
96+
| of "email". Your users will thank you.
97+
|
98+
| The Validator class will automatically search this array of lines it
99+
| is attempting to replace the :attribute place-holder in messages.
100+
| It's pretty slick. We think you'll like it.
101+
|
102+
*/
103+
104+
'attributes' => array(),
105+
106+
);

application/routes.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
|
4949
| Similarly, we use an event to handle the display of 500 level errors
5050
| within the application. These errors are fired when there is an
51-
| uncaught exception thrown in the application.
51+
| uncaught exception thrown in the application. The exception object
52+
| that is captured during execution is then passed to the 500 listener.
5253
|
5354
*/
5455

@@ -57,7 +58,7 @@
5758
return Response::error('404');
5859
});
5960

60-
Event::listen('500', function()
61+
Event::listen('500', function($exception)
6162
{
6263
return Response::error('500');
6364
});

artisan

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Laravel - A PHP Framework For Web Artisans
44
*
55
* @package Laravel
6-
* @version 3.2.13
6+
* @version 3.2.14
77
* @author Taylor Otwell <taylorotwell@gmail.com>
88
* @link http://laravel.com
99
*/

laravel/auth/drivers/driver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ protected function token()
215215
*/
216216
protected function recaller()
217217
{
218-
return $this->name().'_remember';
218+
return Config::get('auth.cookie', $this->name().'_remember');
219219
}
220220

221221
/**
@@ -228,4 +228,4 @@ protected function name()
228228
return strtolower(str_replace('\\', '_', get_class($this)));
229229
}
230230

231-
}
231+
}

laravel/cache/drivers/file.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,14 @@ public function forget($key)
9797
if (file_exists($this->path.$key)) @unlink($this->path.$key);
9898
}
9999

100-
}
100+
/**
101+
* Flush the entire cache.
102+
*
103+
* @return void
104+
*/
105+
public function flush()
106+
{
107+
array_map('unlink', glob($this->path.'*'));
108+
}
109+
110+
}

laravel/cache/drivers/redis.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,14 @@ public function forget($key)
8888
$this->redis->del($key);
8989
}
9090

91-
}
91+
/**
92+
* Flush the entire cache.
93+
*
94+
* @return void
95+
*/
96+
public function flush()
97+
{
98+
$this->redis->flushdb();
99+
}
100+
101+
}

laravel/cli/artisan.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
}
4444
catch (\Exception $e)
4545
{
46-
echo $e->getMessage();
46+
echo $e->getMessage().PHP_EOL;
47+
exit(1);
4748
}
4849

49-
echo PHP_EOL;
50+
echo PHP_EOL;

laravel/cli/tasks/test/runner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function test()
8888
// strings with spaces inside should be wrapped in quotes.
8989
$esc_path = escapeshellarg($path);
9090

91-
passthru('phpunit --configuration '.$esc_path, $status);
91+
passthru('LARAVEL_ENV='.Request::env().' phpunit --configuration '.$esc_path, $status);
9292

9393
@unlink($path);
9494

laravel/cookie.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ public static function put($name, $value, $expiration = 0, $path = '/', $domain
8282

8383
$value = static::hash($value).'+'.$value;
8484

85+
// If the developer has explicitly disabled SLL, then we shouldn't force
86+
// this cookie over SSL.
87+
$secure = $secure && Config::get('application.ssl');
88+
8589
// If the secure option is set to true, yet the request is not over HTTPS
8690
// we'll throw an exception to let the developer know that they are
8791
// attempting to send a secure cookie over the insecure HTTP.

laravel/crypter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ protected static function unpad($value)
138138
$pad = ord(substr($value, -1));
139139
}
140140

141-
if ($pad and $pad < static::$block)
141+
if ($pad and $pad <= static::$block)
142142
{
143143
// If the correct padding is present on the string, we will remove
144144
// it and return the value. Otherwise, we'll throw an exception

laravel/database/connection.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ protected function grammar()
7575

7676
if (isset(\Laravel\Database::$registrar[$this->driver()]))
7777
{
78-
return $this->grammar = \Laravel\Database::$registrar[$this->driver()]['query']();
78+
$resolver = \Laravel\Database::$registrar[$this->driver()]['query'];
79+
return $this->grammar = $resolver($this);
7980
}
8081

8182
switch ($this->driver())
@@ -308,7 +309,7 @@ protected function fetch($statement, $style)
308309
*/
309310
protected function log($sql, $bindings, $start)
310311
{
311-
$time = number_format((microtime(true) - $start) * 1000, 2);
312+
$time = (microtime(true) - $start) * 1000;
312313

313314
Event::fire('laravel.query', array($sql, $bindings, $time));
314315

laravel/database/eloquent/model.php

Lines changed: 2 additions & 2 deletions
< 10000 /tbody>
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ public function get_dirty()
517517

518518
foreach ($this->attributes as $key => $value)
519519
{
520-
if ( ! array_key_exists($key, $this->original) or $value != $this->original[$key])
520+
if ( ! array_key_exists($key, $this->original) or $value !== $this->original[$key])
521521
{
522522
$dirty[$key] = $value;
523523
}
@@ -795,4 +795,4 @@ public static function __callStatic($method, $parameters)
795795
return call_user_func_array(array(new $model, $method), $parameters);
796796
}
797797

798-
}
798+
}

laravel/database/query.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,9 @@ public function insert_get_id($values, $column = 'id')
829829
}
830830
else if ($this->grammar instanceof Postgres)
831831
{
832-
return (int) $result[0]->$column;
832+
$row = (array) $result[0];
833+
834+
return (int) $row[$column];
833835
}
834836
else
835837
{

laravel/database/schema/table.php

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,25 @@ class Table {
3939
*/
4040
public $commands = array();
4141

42+
/**
43+
* The registered custom macros.
44+
*
45+
* @var array
46+
*/
47+
public static $macros = array();
48+
49+
/**
50+
* Registers a custom macro.
51+
*
52+
* @param string $name
53+
* @param Closure $macro
54+
* @return void
55+
*/
56+
public static function macro($name, $macro)
57+
{
58+
static::$macros[$name] = $macro;
59+
}
60+
4261
/**
4362
* Create a new schema table instance.
4463
*
@@ -422,4 +441,22 @@ protected function column($type, $parameters = array())
422441
return $this->columns[] = new Fluent($parameters);
423442
}
424443

425-
}
444+
/**
445+
* Dynamically handle calls to custom macros.
446+
*
447+
* @param string $method
448+
* @param array $parameters
449+
* @return mixed
450+
*/
451+
public function __call($method, $parameters)
452+
{
453+
if (isset(static::$macros[$method]))
454+
{
455+
array_unshift($parameters, $this);
456+
return call_user_func_array(static::$macros[$method], $parameters);
457+
}
458+
459+
throw new \Exception("Method [$method] does not exist.");
460+
}
461+
462+
}

laravel/documentation/changes.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Contents
44

5+
- [Laravel 3.2.14](#3.2.14)
6+
- [Upgrading From 3.2.13](#upgrade-3.2.14)
57
- [Laravel 3.2.13](#3.2.13)
68
- [Upgrading From 3.2.12](#upgrade-3.2.13)
79
- [Laravel 3.2.12](#3.2.12)
@@ -51,6 +53,17 @@
5153
- [Laravel 3.1](#3.1)
5254
- [Upgrading From 3.0](#upgrade-3.1)
5355

56+
<a name="3.2.14"></a>
57+
## Laravel 3.2.14
58+
59+
- IoC can now resolve default parameters.
60+
- Fix bug in Postgres insert_get_id when using FETCH_ASSOC.
61+
62+
<a name="upgrade-3.2.14"></a>
63+
### Upgrading From 3.2.13
64+
65+
- Replace the **laravel** folder.
66+
5467
<a name="3.2.13"></a>
5568
## Laravel 3.2.13
5669

laravel/documentation/contrib/command-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Next, commit the changes to the repository:
8888

8989
# git commit -s -m "I added some more stuff to the Localization documentation."
9090

91-
- **-s** means that you are signing-off on your commit with your name. This tells the Laravel team know that you personally agree to your code being added to the Laravel core.
91+
- **-s** means that you are signing-off on your commit with your name. This lets the Laravel team know that you personally agree to your code being added to the Laravel core.
9292
- **-m** is the message that goes with your commit. Provide a brief explanation of what you added or changed.
9393

9494
<a name="pushing-to-your-fork"></a>

laravel/documentation/contrib/tortoisegit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Now that you have finished coding and testing your changes, it's time to commit
7676
- Right-click the Laravel directory and goto **Git Commit -> "feature/localization-docs"…**
7777
- Commit
7878
- **Message:** Provide a brief explaination of what you added or changed
79-
- Click **Sign** - This tells the Laravel team know that you personally agree to your code being added to the Laravel core
79+
- Click **Sign** - This lets the Laravel team know that you personally agree to your code being added to the Laravel core
8080
- **Changes made:** Check all changed/added files
8181
- Click **OK**
8282

0 commit comments

Comments
 (0)
0