8000 Merge branch 'staging' · allforweb/laravel@8a9acbc · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a9acbc

Browse files
committed
Merge branch 'staging'
2 parents 1b475d8 + cfe5fa1 commit 8a9acbc

File tree

29 files changed

+254
-192
lines changed

29 files changed

+254
-192
lines changed

application/language/de/validation.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@
2424
"alpha" => ":attribute darf nur Buchstaben beinhalten.",
2525
"alpha_dash" => ":attribute sollte nur aus Buchstaben, Nummern und Bindestrichen bestehen.",
2626
"alpha_num" => ":attribute sollte nur aus Buchstaben und Nummern bestehen.",
27-
"array" => "The :attribute must have selected elements.",
27+
"array" => ":attribute muss ausgewählte Elemente haben.",
2828
"before" => ":attribute muss ein Datum vor dem :date sein.",
2929
"between" => array(
3030
"numeric" => ":attribute muss zwischen :min und :max liegen.",
3131
"file" => ":attribute muss zwischen :min und :max Kilobytes groß sein.",
3232
"string" => ":attribute muss zwischen :min und :max Zeichen lang sein.",
3333
),
3434
"confirmed" => ":attribute stimmt nicht mit der Bestätigung überein.",
35-
"count" => "The :attribute must have exactly :count selected elements.",
36-
"countbetween" => "The :attribute must have between :min and :max selected elements.",
37-
"countmax" => "The :attribute must have less than :max selected elements.",
38-
"countmin" => "The :attribute must have at least :min selected elements.",
35+
"count" => ":attribute muss genau :count ausgewählte Elemente haben.",
36+
"countbetween" => ":attribute muss zwischen :min und :max ausgewählte Elemente haben.",
37+
"countmax" => ":attribute muss weniger als :max ausgewählte Elemente haben.",
38+
"countmin" => ":attribute muss mindestens :min ausgewählte Elemente haben.",
3939
"different" => ":attribute und :other müssen verschieden sein.",
4040
"email" => ":attribute ist keine gültige Email-Adresse.",
4141
"exists" => "Der gewählte Wert für :attribute ist ungültig.",

artisan

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

laravel/auth/drivers/eloquent.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@ class Eloquent extends Driver {
77
*
88
* If the user is a guest, null should be returned.
99
*
10-
* @param int $id
10+
* @param int|object $token
1111
* @return mixed|null
1212
*/
13-
public function retrieve($id)
13+
public function retrieve($token)
1414
{
15-
if (filter_var($id, FILTER_VALIDATE_INT) !== false)
15+
// We return an object here either if the passed token is an integer (ID)
16+
// or if we are passed a model object of the correct type
17+
if (filter_var($token, FILTER_VALIDATE_INT) !== false)
1618
{
17-
return $this->model()->find($id);
19+
return $this->model()->find($token);
20+
}
21+
else if (get_class($token) == Config::get('auth.model'))
22+
{
23+
return $token;
1824
}
1925
}
2026

laravel/bundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public static function handles($uri)
191191

192192
foreach (static::$bundles as $key => $value)
193193
{
194-
if (isset($value['handles']) and starts_with($uri, $value['handles'].'/'))
194+
if (isset($value['handles']) and starts_with($uri, $value['handles'].'/') or $value['handles'] == '/')
195195
{
196196
return $key;
197197
}

laravel/cli/tasks/route.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Route extends Task {
1414
*/
1515
public function call($arguments = array())
1616
{
17-
if ( ! count($arguments) == 2)
17+
if ( count($arguments) != 2)
1818
{
1919
throw new \Exception("Please specify a request method and URI.");
2020
}
@@ -41,7 +41,7 @@ protected function route()
4141
// We'll call the router using the method and URI specified by
4242
// the developer on the CLI. If a route is found, we will not
4343
// run the filters, but simply dump the result.
44-
$route = Router::route(Request::method(), URI::current());
44+
$route = Router::route(Request::method(), $_SERVER['REQUEST_URI']);
4545

4646
if ( ! is_null($route))
4747
{
@@ -53,4 +53,4 @@ protected function route()
5353
}
5454
}
5555

56-
}
56+
}

laravel/database/connectors/sqlserver.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,16 @@ public function connect($config)
2828
// also be used to connect to Azure SQL Server databases. The port is defined
2929
// directly after the server name, so we'll create that first.
3030
$port = (isset($port)) ? ','.$port : '';
31-
32-
$dsn = "sqlsrv:Server={$host}{$port};Database={$database}";
31+
32+
//check for dblib for mac users connecting to mssql (utilizes freetds)
33+
if (!empty($dsn_type) and $dsn_type == 'dblib')
34+
{
35+
$dsn = "dblib:host={$host}{$port};dbname={$database}";
36+
}
37+
else
38+
{
39+
$dsn = "sqlsrv:Server={$host}{$port};Database={$database}";
40+
}
3341

3442
return new PDO($dsn, $username, $password, $this->options($config));
3543
}

laravel/database/eloquent/model.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ public function delete()
445445
*
446446
* @return void
447447
*/
448-
protected function timestamp()
448+
public function timestamp()
449449
{
450450
$this->updated_at = new \DateTime;
451451

@@ -617,6 +617,8 @@ public function to_array()
617617
// to_array method, keying them both by name and ID.
618618
elseif (is_array($models))
619619
{
620+
$attributes[$name] = array();
621+
620622
foreach ($models as $id => $model)
621623
{
622624
$attributes[$name][$id] = $model->to_array();

laravel/database/eloquent/pivot.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Pivot extends Model {
2626
public function __construct($table, $connection = null)
2727
{
2828
$this->pivot_table = $table;
29-
$this< 179B /span>->connection = $connection;
29+
static::$connection = $connection;
3030

3131
parent::__construct(array(), true);
3232
}
@@ -41,14 +41,4 @@ public function table()
4141
return $this->pivot_table;
4242
}
4343

44-
/**
45-
* Get the connection used by the pivot table.
46-
*
47-
* @return string
48-
*/
49-
public function connection()
50-
{
51-
return $this->connection;
52-
}
53-
5444
}

laravel/database/eloquent/relationships/has_many_and_belongs_to.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,14 @@ public function results()
8585
/**
8686
* Insert a new record into the joining table of the association.
8787
*
88-
* @param int $id
89-
* @param array $joining
88+
* @param Model|int $id
89+
* @param array $attributes
9090
* @return bool
9191
*/
9292
public function attach($id, $attributes = array())
9393
{
94+
if ($id instanceof Model) $id = $id->get_key();
95+
9496
$joining = array_merge($this->join_record($id), $attributes);
9597

9698
return $this->insert_joining($joining);
@@ -99,12 +101,13 @@ public function attach($id, $attributes = array())
99101
/**
100102
* Detach a record from the joining table of the association.
101103
*
102-
* @param int $ids
104+
* @param array|Model|int $ids
103105
* @return bool
104106
*/
105107
public function detach($ids)
106108
{
107-
if ( ! is_array($ids)) $ids = array($ids);
109+
if ($ids instanceof Model) $ids = array($ids->get_key());
110+
elseif ( ! is_array($ids)) $ids = array($ids);
108111

109112
return $this->pivot()->where_in($this->other_key(), $ids)->delete();
110113
}

laravel/database/eloquent/relationships/has_one_or_many.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,25 @@ class Has_One_Or_Many extends Relationship {
77
/**
88
* Insert a new record for the association.
99
*
10+
* If save is successful, the model will be returned, otherwise false.
11+
*
1012
* @param Model|array $attributes
11-
* @return bool
13+
* @return Model|false
1214
*/
1315
public function insert($attributes)
1416
{
15-
$attributes = ($attributes instanceof Model) ? $attributes->attributes : $attributes;
16-
17-
$attributes[$this->foreign_key()] = $this->base->get_key();
17+
if ($attributes instanceof Model)
18+
{
19+
$attributes->set_attribute($this->foreign_key(), $this->base->get_key());
20+
21+
return $attributes->save() ? $attributes : false;
22+
}
23+
else
24+
{
25+
$attributes[$this->foreign_key()] = $this->base->get_key();
1826

19-
return $this->model->create($attributes);
27+
return $this->model->create($attributes);
28+
}
2029
}
2130

2231
/**

laravel/database/query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ public function lists($column, $key = null)
621621
// set the keys on the array of values using the array_combine
622622
// function provided by PHP, which should give us the proper
623623
// array form to return from the method.
624-
if ( ! is_null($key))
624+
if ( ! is_null($key) && count($results))
625625
{
626626
return array_combine(array_map(function($row) use ($key)
627627
{

laravel/database/schema/grammars/grammar.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ public function foreign(Table $table, Fluent $command)
5050
return $sql;
5151
}
5252

53+
/**
54+
* Generate the SQL statement for a drop table command.
55+
*
56+
* @param Table $table
57+
* @param Fluent $command
58+
* @return string
59+
*/
60+
public function drop(Table $table, Fluent $command)
61+
{
62+
return 'DROP TABLE '.$this->wrap($table);
63+
}
64+
5365
/**
5466
* Drop a constraint from the table.
5567
*

laravel/database/schema/grammars/mysql.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,6 @@ public function rename(Table $table, Fluent $command)
224224
return 'RENAME TABLE '.$this->wrap($table).' TO '.$this->wrap($command->name);
225225
}
226226

227-
/**
228-
* Generate the SQL statement for a drop table command.
229-
*
230-
* @param Table $table
231-
* @param Fluent $command
232-
* @return string
233-
*/
234-
public function drop(Table $table, Fluent $command)
235-
{
236-
return 'DROP TABLE '.$this->wrap($table);
237-
}
238-
239227
/**
240228
* Generate the SQL statement for a drop column command.
241229
*

laravel/database/schema/grammars/postgres.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -210,18 +210,6 @@ public function rename(Table $table, Fluent $command)
210210
return 'ALTER TABLE '.$this->wrap($table).' RENAME TO '.$this->wrap($command->name);
211211
}
212212

213-
/**
214-
* Generate the SQL statement for a drop table command.
215-
*
216-
* @param Table $table
217-
* @param Fluent $command
218-
* @return string
219-
*/
220-
public function drop(Table $table, Fluent $command)
221-
{
222-
return 'DROP TABLE '.$this->wrap($table);
223-
}
224-
225213
/**
226214
* Generate the SQL statement for a drop column command.
227215
*

laravel/database/schema/grammars/sqlite.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,6 @@ public function rename(Table $table, Fluent $command)
213213
return 'ALTER TABLE '.$this->wrap($table).' RENAME TO '.$this->wrap($command->name);
214214
}
215215

216-
/**
217-
* Generate the SQL statement for a drop table command.
218-
*
219-
* @param Table $table
220-
* @param Fluent $command
221-
* @return string
222-
*/
223-
public function drop(Table $table, Fluent $command)
224-
{
225-
return 'DROP TABLE '.$this->wrap($table);
226-
}
227-
228216
/**
229217
* Generate the SQL statement for a drop unique key command.
230218
*

laravel/database/schema/grammars/sqlserver.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,6 @@ public function rename(Table $table, Fluent $command)
224224
return 'ALTER TABLE '.$this->wrap($table).' RENAME TO '.$this->wrap($command->name);
225225
}
226226

227-
/**
228-
* Generate the SQL statement for a drop table command.
229-
*
230-
* @param Table $table
231-
* @param Fluent $command
232-
* @return string
233-
*/
234-
public function drop(Table $table, Fluent $command)
235-
{
236-
return 'DROP TABLE '.$this->wrap($table);
237-
}
238-
239227
/**
240228
* Generate the SQL statement for a drop column command.
241229
*

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.7](#3.2.7)
6+
- [Upgrading From 3.2.6](#upgrade-3.2.7)
57
- [Laravel 3.2.6](#3.2.6)
68
- [Upgrading From 3.2.5](#upgrade-3.2.6)
79
- [Laravel 3.2.5](#3.2.5)
@@ -37,6 +39,17 @@
3739
- [Laravel 3.1](#3.1)
3840
- [Upgrading From 3.0](#upgrade-3.1)
3941

42+
<a name="3.2.7"></a>
43+
## Laravel 3.2.7
44+
45+
- Fix bug in Eloquent `to_array` method.
46+
- Fix bug in displaying of generic error page.
47+
48+
<a name="upgrade-3.2.7"></a>
49+
### Upgrading From 3.2.6
50+
51+
- Replace the **laravel** folder.
52+
4053
<a name="3.2.6"></a>
4154
## Laravel 3.2.6
4255

0 commit comments

Comments
 (0)
0