Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
ee307657
Commit
ee307657
authored
Jun 17, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve error class comments.
parent
26ff78da
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
21 deletions
+16
-21
index.php
application/views/home/index.php
+1
-1
error.php
system/error.php
+15
-20
No files found.
application/views/home/index.php
View file @
ee307657
...
...
@@ -63,7 +63,7 @@
<div
id=
"content"
>
You have successfully installed Laravel.
<?php
Cache
::
driver
(
'adslkadsl'
);
?>
<br
/><br
/>
Perhaps you would like to
<a
href=
"http://laravel.com/docs"
>
peruse the documentation
</a>
or
<a
href=
"http://github.com/taylorotwell/laravel"
>
contribute on GitHub
</a>
?
...
...
system/error.php
View file @
ee307657
...
...
@@ -3,7 +3,7 @@
class
Error
{
/**
* Error levels.
* Error levels
and descriptions
.
*
* @var array
*/
...
...
@@ -32,7 +32,8 @@ class Error {
public
static
function
handle
(
$e
)
{
// -----------------------------------------------------
// Clean the output buffer.
// Clean the output buffer. We don't want any rendered
// views or text to be sent to the browser.
// -----------------------------------------------------
if
(
ob_get_level
()
>
0
)
{
...
...
@@ -40,7 +41,7 @@ class Error {
}
// -----------------------------------------------------
// Get the error severity.
// Get the error severity
in human readable format
.
// -----------------------------------------------------
$severity
=
(
array_key_exists
(
$e
->
getCode
(),
static
::
$levels
))
?
static
::
$levels
[
$e
->
getCode
()]
:
$e
->
getCode
();
...
...
@@ -57,19 +58,21 @@ class Error {
$file
=
$e
->
getFile
();
}
// -----------------------------------------------------
// Trim the period off of the error message.
// -----------------------------------------------------
$message
=
rtrim
(
$e
->
getMessage
(),
'.'
);
// -----------------------------------------------------
// Log the error.
// -----------------------------------------------------
if
(
Config
::
get
(
'error.log'
))
{
Log
::
error
(
$message
.
' in '
.
$e
->
getFile
()
.
' on line '
.
$e
->
getLine
());
}
// -----------------------------------------------------
// Detailed error view contains the file name and stack
// trace of the error. It is not wise to have details
// enabled in a production environment.
//
// The generic error view (error/500) only has a simple,
// generic error message suitable for production.
// -----------------------------------------------------
if
(
Config
::
get
(
'error.detail'
))
{
$view
=
View
::
make
(
'exception'
)
...
...
@@ -107,24 +110,16 @@ class Error {
array_unshift
(
$file
,
''
);
// -----------------------------------------------------
// Calculate the starting position.
// Calculate the starting position
of the file context
.
// -----------------------------------------------------
$start
=
$line
-
$padding
;
if
(
$start
<
0
)
{
$start
=
0
;
}
$start
=
(
$start
<
0
)
?
0
:
$start
;
// -----------------------------------------------------
// Calculate the context length.
// -----------------------------------------------------
$length
=
(
$line
-
$start
)
+
$padding
+
1
;
if
((
$start
+
$length
)
>
count
(
$file
)
-
1
)
{
$length
=
null
;
}
$length
=
((
$start
+
$length
)
>
count
(
$file
)
-
1
)
?
null
:
$length
;
return
array_slice
(
$file
,
$start
,
$length
,
true
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment