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 27, 2012
2 parents 439f9c8 + 4de8e2d commit ae5331b
Show file tree
Hide file tree
Showing 13 changed files with 380 additions and 31 deletions.
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.8
* @version 3.2.9
* @author Taylor Otwell <[email protected]>
* @link http://laravel.com
*/
Expand Down
2 changes: 2 additions & 0 deletions laravel/auth/drivers/driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ public function logout()
$this->cookie($this->recaller(), null, -2000);

Session::forget($this->token());

$this->token = null;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions laravel/database/eloquent/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public function get_dirty()

foreach ($this->attributes as $key => $value)
{
if ( ! isset($this->original[$key]) or $value !== $this->original[$key])
if ( ! array_key_exists($key, $this->original) or $value != $this->original[$key])
{
$dirty[$key] = $value;
}
Expand All @@ -544,7 +544,7 @@ public function get_dirty()
*/
public function get_key()
{
return $this->get_attribute(static::$key);
return array_get($this->original, static::$key);
}

/**
Expand Down Expand Up @@ -721,7 +721,7 @@ public function __isset($key)
{
if (array_key_exists($key, $this->$source)) return true;
}

if (method_exists($this, $key)) return true;
}

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.9](#3.2.9)
- [Upgrading From 3.2.8](#upgrade-3.2.9)
- [Laravel 3.2.8](#3.2.8)
- [Upgrading From 3.2.7](#upgrade-3.2.8)
- [Laravel 3.2.7](#3.2.7)
Expand Down Expand Up @@ -41,6 +43,17 @@
- [Laravel 3.1](#3.1)
- [Upgrading From 3.0](#upgrade-3.1)

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

- Always log exceptions even when there are "logger" event listeners.
- Fix nasty view exception messages.

<a name="upgrade-3.2.9"></a>
### Upgrading From 3.2.8

- Replace the **laravel** folder.

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

Expand Down
16 changes: 14 additions & 2 deletions laravel/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,28 @@ public static function exception($exception, $trace = true)

ob_get_level() and ob_end_clean();

$message = $exception->getMessage();

// For Laravel view errors we want to show a prettier error:
$file = $exception->getFile();

if (str_contains($exception->getFile(), 'eval()') and str_contains($exception->getFile(), 'laravel/view.php'))
{
$message = 'Error rendering view: ['.View::$last['name'].']'.PHP_EOL.PHP_EOL.$message;

$file = View::$last['path'];
}

// If detailed errors are enabled, we'll just format the exception into
// a simple error message and display it on the screen. We don't use a
// View in case the problem is in the View class.
if (Config::get('error.detail'))
{
echo "<html><h2>Unhandled Exception</h2>
<h3>Message:</h3>
<pre>".$exception->getMessage()."</pre>
<pre>".$message."</pre>
<h3>Location:</h3>
<pre>".$exception->getFile()." on line ".$exception->getLine()."</pre>";
<pre>".$file." on line ".$exception->getLine()."</pre>";

if ($trace)
{
Expand Down
2 changes: 1 addition & 1 deletion laravel/laravel.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@

foreach ($languages as $language)
{
if (starts_with($uri, $language))
if (preg_match("#^{$language}(?:$|/)#i", $uri))
{
Config::set('application.language', $language);

Expand Down
10 changes: 2 additions & 8 deletions laravel/log.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,9 @@ public static function write($type, $message)
Event::fire('laravel.log', array($type, $message));
}

// If there aren't listeners on the log event, we'll just write to the
// log files using the default conventions, writing one log file per
// day so the files don't get too crowded.
else
{
$message = static::format($type, $message);
$message = static::format($type, $message);

File::append(path('storage').'logs/'.date('Y-m-d').'.log', $message);
}
File::append(path('storage').'logs/'.date('Y-m-d').'.log', $message);
}

/**
Expand Down
27 changes: 16 additions & 11 deletions laravel/str.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@ class Str {
*/
public static $pluralizer;

/**
* Get the default string encoding for the application.
*
* This method is simply a short-cut to Config::get('application.encoding').
*
* @return string
*/
public static function encoding()
{
return Config::get('application.encoding');
}
/**
* Cache application encoding locally to save expensive calls to Config::get().
*
* @var string
*/
public static $encoding = null;

/**
* Get the appliction.encoding without needing to request it from Config::get() each time.
*
* @return string
*/
protected static function encoding()
{
return static::$encoding ?: static::$encoding = Config::get('application.encoding');
}

/**
* Get the length of a string.
Expand Down
15 changes: 15 additions & 0 deletions laravel/tests/application/models/model.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

class Model extends Laravel\Database\Eloquent\Model {

public function set_setter($setter)
{
$this->set_attribute('setter', 'setter: '.$setter);
}

public function get_getter()
{
return 'getter: '.$this->get_attribute('getter');
}

}
3 changes: 0 additions & 3 deletions laravel/tests/cases/auth.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,6 @@ public function testLogoutMethodLogsOutUser()

Auth::logout();

// A workaround since Cookie will is only stored in memory, until Response class is called.
Auth::driver()->token = null;

$this->assertNull(Auth::user());

$this->assertFalse(isset(Session::$instance->session['data']['laravel_auth_drivers_fluent_login']));
Expand Down
Loading

0 comments on commit ae5331b

Please sign in to comment.