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
063cde50
Commit
063cde50
authored
Jul 11, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed file context from error messages.
parent
46b0a7d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
45 deletions
+1
-45
error.php
system/error.php
+1
-31
exception.php
system/views/exception.php
+0
-14
No files found.
system/error.php
View file @
063cde50
...
@@ -51,6 +51,7 @@ class Error {
...
@@ -51,6 +51,7 @@ class Error {
$file
=
$e
->
getFile
();
$file
=
$e
->
getFile
();
}
}
// Trim the period off the error message since we will be formatting it oursevles.
$message
=
rtrim
(
$e
->
getMessage
(),
'.'
);
$message
=
rtrim
(
$e
->
getMessage
(),
'.'
);
if
(
Config
::
get
(
'error.log'
))
if
(
Config
::
get
(
'error.log'
))
...
@@ -66,7 +67,6 @@ class Error {
...
@@ -66,7 +67,6 @@ class Error {
->
bind
(
'file'
,
$file
)
->
bind
(
'file'
,
$file
)
->
bind
(
'line'
,
$e
->
getLine
())
->
bind
(
'line'
,
$e
->
getLine
())
->
bind
(
'trace'
,
$e
->
getTraceAsString
())
->
bind
(
'trace'
,
$e
->
getTraceAsString
())
->
bind
(
'contexts'
,
static
::
context
(
$file
,
$e
->
getLine
()));
Response
::
make
(
$view
,
500
)
->
send
();
Response
::
make
(
$view
,
500
)
->
send
();
}
}
...
@@ -78,34 +78,4 @@ class Error {
...
@@ -78,34 +78,4 @@ class Error {
exit
(
1
);
exit
(
1
);
}
}
/**
* Get the file context of an exception.
*
* @param string $path
* @param int $line
* @param int $padding
* @return array
*/
private
static
function
context
(
$path
,
$line
,
$padding
=
5
)
{
if
(
file_exists
(
$path
))
{
$file
=
file
(
$path
,
FILE_IGNORE_NEW_LINES
);
array_unshift
(
$file
,
''
);
// Calculate the starting position of the file context.
$start
=
$line
-
$padding
;
$start
=
(
$start
<
0
)
?
0
:
$start
;
// Calculate the context length.
$length
=
(
$line
-
$start
)
+
$padding
+
1
;
$length
=
((
$start
+
$length
)
>
count
(
$file
)
-
1
)
?
null
:
$length
;
return
array_slice
(
$file
,
$start
,
$length
,
true
);
}
return
array
();
}
}
}
\ No newline at end of file
system/views/exception.php
View file @
063cde50
...
@@ -60,20 +60,6 @@
...
@@ -60,20 +60,6 @@
<pre>
<?php
echo
$trace
;
?>
</pre>
<pre>
<?php
echo
$trace
;
?>
</pre>
</div>
</div>
<div
class=
"content"
>
<h3>
Context:
</h3>
<?php
if
(
count
(
$contexts
)
>
0
)
{
?>
<?php
foreach
(
$contexts
as
$num
=>
$context
)
{
?>
<pre>
<?php
echo
htmlentities
(
$num
.
' '
.
$context
);
?>
</pre>
<?php
}
?>
<?php
}
else
{
?>
Context unavailable.
<?php
}
?>
</div>
</div>
</div>
</body>
</body>
</html>
</html>
\ No newline at end of file
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