8000 Merge branch 'develop' of github.com:laravel/laravel into develop · laravel/laravel@d9c0dc0 · GitHub
[go: up one dir, main page]

Skip to content

Commit d9c0dc0

Browse files
committed
Merge branch 'develop' of github.com:laravel/laravel into develop
2 parents 1ac911f + 930a3e8 commit d9c0dc0

File tree

5 files changed

+29
-11
lines changed

5 files changed

+29
-11
lines changed

application/views/home/index.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</header>
1919
<div role="main" class="main">
2020
<div class="home">
21-
<h2>Learn the terrain.</h3>
21+
<h2>Learn the terrain.</h2>
2222

2323
<p>
2424
You've landed yourself on our default home page. The route that
@@ -34,7 +34,7 @@
3434
<h2>Grow in knowledge.</h2>
3535

3636
<p>
37-
Leaning to use Laravel is amazingly simple thanks to
37+
Learning to use Laravel is amazingly simple thanks to
3838
its {{ HTML::link('docs', 'wonderful documentation') }}.
3939
</p>
4040

laravel/core.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,19 @@
148148
|--------------------------------------------------------------------------
149149
|
150150
| Next we're ready to determine the application environment. This may be
151-
| set either via the command line options, or, if the request is from
152-
| the web, via the mapping of URIs to environments that lives in
153-
| the "paths.php" file for the application and is parsed.
151+
| set either via the command line options or via the mapping of URIs to
152+
| environments that lives in the "paths.php" file for the application and
153+
| is parsed. When determining the CLI environment, the "--env" CLI option
154+
| overrides the mapping in "paths.php".
154155
|
155156
*/
156-
157157
if (Request::cli())
158158
{
159159
$environment = get_cli_option('env');
160+
161+
if (! isset($environment)) {
162+
$environment = Request::detect_env($environments, gethostname());
163+
}
160164
}
161165
else
162166
{

laravel/database/eloquent/model.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,9 @@ public static function update($id, $attributes)
230230
* @param array $columns
231231
* @return Model
232232
*/
233-
public static function find($id, $columns = array('*'))
233+
public function _find($id, $columns = array('*'))
234234
{
235-
$model = new static;
236-
237-
return $model->query()->where(static::$key, '=', $id)->first($columns);
235+
return $this->query()->where(static::$key, '=', $id)->first($columns);
238236
}
239237

240238
/**
@@ -746,10 +744,12 @@ public function __call($method, $parameters)
746744
return static::$$method;
747745
}
748746

747+
$underscored = array('with', 'find');
748+
749749
// Some methods need to be accessed both staticly and non-staticly so we'll
750750
// keep underscored methods of those methods and intercept calls to them
751751
// here so they can be called either way on the model instance.
752-
if (in_array($method, array('with')))
752+
if (in_array($method, $underscored))
753753
{
754754
return call_user_func_array(array($this, '_'.$method), $parameters);
755755
}

laravel/documentation/routing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ This routing convention may not be desirable for every situation, so you may als
307307

308308
Route::get('welcome', array('after' => 'log', 'uses' => 'home@index'));
309309

310+
#### Registering a named route that points to a controller action:
311+
312+
Route::get('welcome', array('as' => 'home.welcome', 'uses' => 'home@index'));
313+
310314
<a name="cli-route-testing"></a>
311315
## CLI Route Testing
312316

laravel/response.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,4 +334,14 @@ public function status($status = null)
334334
}
335335
}
336336

337+
/**
338+
* Render the response when cast to string
339+
*
340+
* @return string
341+
*/
342+
public function __toString()
343+
{
344+
return $this->render();
345+
}
346+
337347
}

0 commit comments

Comments
 (0)
0