Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Sep 2, 2012
2 parents 1b475d8 + cfe5fa1 commit 8a9acbc
Show file tree
Hide file tree
Showing 29 changed files with 254 additions and 192 deletions.
10 changes: 5 additions & 5 deletions application/language/de/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
"alpha" => ":attribute darf nur Buchstaben beinhalten.",
"alpha_dash" => ":attribute sollte nur aus Buchstaben, Nummern und Bindestrichen bestehen.",
"alpha_num" => ":attribute sollte nur aus Buchstaben und Nummern bestehen.",
"array" => "The :attribute must have selected elements.",
"array" => ":attribute muss ausgewählte Elemente haben.",
"before" => ":attribute muss ein Datum vor dem :date sein.",
"between" => array(
"numeric" => ":attribute muss zwischen :min und :max liegen.",
"file" => ":attribute muss zwischen :min und :max Kilobytes groß sein.",
"string" => ":attribute muss zwischen :min und :max Zeichen lang sein.",
),
"confirmed" => ":attribute stimmt nicht mit der Bestätigung überein.",
"count" => "The :attribute must have exactly :count selected elements.",
"countbetween" => "The :attribute must have between :min and :max selected elements.",
"countmax" => "The :attribute must have less than :max selected elements.",
"countmin" => "The :attribute must have at least :min selected elements.",
"count" => ":attribute muss genau :count ausgewählte Elemente haben.",
"countbetween" => ":attribute muss zwischen :min und :max ausgewählte Elemente haben.",
"countmax" => ":attribute muss weniger als :max ausgewählte Elemente haben.",
"countmin" => ":attribute muss mindestens :min ausgewählte Elemente haben.",
"different" => ":attribute und :other müssen verschieden sein.",
"email" => ":attribute ist keine gültige Email-Adresse.",
"exists" => "Der gewählte Wert für :attribute ist ungültig.",
Expand Down
2 changes: 1 addition & 1 deletion artisan
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @version 3.2.6
* @version 3.2.7
* @author Taylor Otwell <[email protected]>
* @link http://laravel.com
*/
Expand Down
14 changes: 10 additions & 4 deletions laravel/auth/drivers/eloquent.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ class Eloquent extends Driver {
*
* If the user is a guest, null should be returned.
*
* @param int $id
* @param int|object $token
* @return mixed|null
*/
public function retrieve($id)
public function retrieve($token)
{
if (filter_var($id, FILTER_VALIDATE_INT) !== false)
// We return an object here either if the passed token is an integer (ID)
// or if we are passed a model object of the correct type
if (filter_var($token, FILTER_VALIDATE_INT) !== false)
{
return $this->model()->find($id);
return $this->model()->find($token);
}
else if (get_class($token) == Config::get('auth.model'))
{
return $token;
}
}

Expand Down
2 changes: 1 addition & 1 deletion laravel/bundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public static function handles($uri)

foreach (static::$bundles as $key => $value)
{
if (isset($value['handles']) and starts_with($uri, $value['handles'].'/'))
if (isset($value['handles']) and starts_with($uri, $value['handles'].'/') or $value['handles'] == '/')
{
return $key;
}
Expand Down
6 changes: 3 additions & 3 deletions laravel/cli/tasks/route.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Route extends Task {
*/
public function call($arguments = array())
{
if ( ! count($arguments) == 2)
if ( count($arguments) != 2)
{
throw new \Exception("Please specify a request method and URI.");
}
Expand All @@ -41,7 +41,7 @@ protected function route()
// We'll call the router using the method and URI specified by
// the developer on the CLI. If a route is found, we will not
// run the filters, but simply dump the result.
$route = Router::route(Request::method(), URI::current());
$route = Router::route(Request::method(), $_SERVER['REQUEST_URI']);

if ( ! is_null($route))
{
Expand All @@ -53,4 +53,4 @@ protected function route()
}
}

}
}
12 changes: 10 additions & 2 deletions laravel/database/connectors/sqlserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@ public function connect($config)
// also be used to connect to Azure SQL Server databases. The port is defined
// directly after the server name, so we'll create that first.
$port = (isset($port)) ? ','.$port : '';

$dsn = "sqlsrv:Server={$host}{$port};Database={$database}";

//check for dblib for mac users connecting to mssql (utilizes freetds)
if (!empty($dsn_type) and $dsn_type == 'dblib')
{
$dsn = "dblib:host={$host}{$port};dbname={$database}";
}
else
{
$dsn = "sqlsrv:Server={$host}{$port};Database={$database}";
}

return new PDO($dsn, $username, $password, $this->options($config));
}
Expand Down
4 changes: 3 additions & 1 deletion laravel/database/eloquent/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public function delete()
*
* @return void
*/
protected function timestamp()
public function timestamp()
{
$this->updated_at = new \DateTime;

Expand Down Expand Up @@ -617,6 +617,8 @@ public function to_array()
// to_array method, keying them both by name and ID.
elseif (is_array($models))
{
$attributes[$name] = array();

foreach ($models as $id => $model)
{
$attributes[$name][$id] = $model->to_array();
Expand Down
12 changes: 1 addition & 11 deletions laravel/database/eloquent/pivot.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Pivot extends Model {
public function __construct($table, $connection = null)
{
$this->pivot_table = $table;
$this->connection = $connection;
static::$connection = $connection;

parent::__construct(array(), true);
}
Expand All @@ -41,14 +41,4 @@ public function table()
return $this->pivot_table;
}

/**
* Get the connection used by the pivot table.
*
* @return string
*/
public function connection()
{
return $this->connection;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ public function results()
/**
* Insert a new record into the joining table of the association.
*
* @param int $id
* @param array $joining
* @param Model|int $id
* @param array $attributes
* @return bool
*/
public function attach($id, $attributes = array())
{
if ($id instanceof Model) $id = $id->get_key();

$joining = array_merge($this->join_record($id), $attributes);

return $this->insert_joining($joining);
Expand All @@ -99,12 +101,13 @@ public function attach($id, $attributes = array())
/**
* Detach a record from the joining table of the association.
*
* @param int $ids
* @param array|Model|int $ids
* @return bool
*/
public function detach($ids)
{
if ( ! is_array($ids)) $ids = array($ids);
if ($ids instanceof Model) $ids = array($ids->get_key());
elseif ( ! is_array($ids)) $ids = array($ids);

return $this->pivot()->where_in($this->other_key(), $ids)->delete();
}
Expand Down
19 changes: 14 additions & 5 deletions laravel/database/eloquent/relationships/has_one_or_many.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,25 @@ class Has_One_Or_Many extends Relationship {
/**
* Insert a new record for the association.
*
* If save is successful, the model will be returned, otherwise false.
*
* @param Model|array $attributes
* @return bool
* @return Model|false
*/
public function insert($attributes)
{
$attributes = ($attributes instanceof Model) ? $attributes->attributes : $attributes;

$attributes[$this->foreign_key()] = $this->base->get_key();
if ($attributes instanceof Model)
{
$attributes->set_attribute($this->foreign_key(), $this->base->get_key());

return $attributes->save() ? $attributes : false;
}
else
{
$attributes[$this->foreign_key()] = $this->base->get_key();

return $this->model->create($attributes);
return $this->model->create($attributes);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion laravel/database/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ public function lists($column, $key = null)
// set the keys on the array of values using the array_combine
// function provided by PHP, which should give us the proper
// array form to return from the method.
if ( ! is_null($key))
if ( ! is_null($key) && count($results))
{
return array_combine(array_map(function($row) use ($key)
{
Expand Down
12 changes: 12 additions & 0 deletions laravel/database/schema/grammars/grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ public function foreign(Table $table, Fluent $command)
return $sql;
}

/**
* Generate the SQL statement for a drop table command.
*
* @param Table $table
* @param Fluent $command
* @return string
*/
public function drop(Table $table, Fluent $command)
{
return 'DROP TABLE '.$this->wrap($table);
}

/**
* Drop a constraint from the table.
*
Expand Down
12 changes: 0 additions & 12 deletions laravel/database/schema/grammars/mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,6 @@ public function rename(Table $table, Fluent $command)
return 'RENAME TABLE '.$this->wrap($table).' TO '.$this->wrap($command->name);
}

/**
* Generate the SQL statement for a drop table command.
*
* @param Table $table
* @param Fluent $command
* @return string
*/
public function drop(Table $table, Fluent $command)
{
return 'DROP TABLE '.$this->wrap($table);
}

/**
* Generate the SQL statement for a drop column command.
*
Expand Down
12 changes: 0 additions & 12 deletions laravel/database/schema/grammars/postgres.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,6 @@ public function rename(Table $table, Fluent $command)
return 'ALTER TABLE '.$this->wrap($table).' RENAME TO '.$this->wrap($command->name);
}

/**
* Generate the SQL statement for a drop table command.
*
* @param Table $table
* @param Fluent $command
* @return string
*/
public function drop(Table $table, Fluent $command)
{
return 'DROP TABLE '.$this->wrap($table);
}

/**
* Generate the SQL statement for a drop column command.
*
Expand Down
12 changes: 0 additions & 12 deletions laravel/database/schema/grammars/sqlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,6 @@ public function rename(Table $table, Fluent $command)
return 'ALTER TABLE '.$this->wrap($table).' RENAME TO '.$this->wrap($command->name);
}

/**
* Generate the SQL statement for a drop table command.
*
* @param Table $table
* @param Fluent $command
* @return string
*/
public function drop(Table $table, Fluent $command)
{
return 'DROP TABLE '.$this->wrap($table);
}

/**
* Generate the SQL statement for a drop unique key command.
*
Expand Down
12 changes: 0 additions & 12 deletions laravel/database/schema/grammars/sqlserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,6 @@ public function rename(Table $table, Fluent $command)
return 'ALTER TABLE '.$this->wrap($table).' RENAME TO '.$this->wrap($command->name);
}

/**
* Generate the SQL statement for a drop table command.
*
* @param Table $table
* @param Fluent $command
* @return string
*/
public function drop(Table $table, Fluent $command)
{
return 'DROP TABLE '.$this->wrap($table);
}

/**
* Generate the SQL statement for a drop column command.
*
Expand Down
13 changes: 13 additions & 0 deletions laravel/documentation/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Contents

- [Laravel 3.2.7](#3.2.7)
- [Upgrading From 3.2.6](#upgrade-3.2.7)
- [Laravel 3.2.6](#3.2.6)
- [Upgrading From 3.2.5](#upgrade-3.2.6)
- [Laravel 3.2.5](#3.2.5)
Expand Down Expand Up @@ -37,6 +39,17 @@
- [Laravel 3.1](#3.1)
- [Upgrading From 3.0](#upgrade-3.1)

<a name="3.2.7"></a>
## Laravel 3.2.7

- Fix bug in Eloquent `to_array` method.
- Fix bug in displaying of generic error page.

<a name="upgrade-3.2.7"></a>
### Upgrading From 3.2.6

- Replace the **laravel** folder.

<a name="3.2.6"></a>
## Laravel 3.2.6

Expand Down
Loading

0 comments on commit 8a9acbc

Please sign in to comment.