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
6a77a98f
Commit
6a77a98f
authored
Jul 08, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored error and file classes.
parent
4b063ac0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
14 deletions
+10
-14
error.php
system/error.php
+9
-8
file.php
system/file.php
+1
-6
No files found.
system/error.php
View file @
6a77a98f
...
...
@@ -31,7 +31,7 @@ class Error {
*/
public
static
function
handle
(
$e
)
{
// Clean the output buffer
. We don't want any rendered views or text
sent to the browser.
// Clean the output buffer
so no previously rendered views or text is
sent to the browser.
if
(
ob_get_level
()
>
0
)
{
ob_clean
();
...
...
@@ -40,7 +40,8 @@ class Error {
// Get the error severity in human readable format.
$severity
=
(
array_key_exists
(
$e
->
getCode
(),
static
::
$levels
))
?
static
::
$levels
[
$e
->
getCode
()]
:
$e
->
getCode
();
// Get the error file. Views require special handling since view errors occur in eval'd code.
// Get the file in which the error occured.
// Views require special handling since view errors occur in eval'd code.
if
(
strpos
(
$e
->
getFile
(),
'view.php'
)
!==
false
and
strpos
(
$e
->
getFile
(),
"eval()'d code"
)
!==
false
)
{
$file
=
APP_PATH
.
'views/'
.
View
::
$last
.
EXT
;
...
...
@@ -60,12 +61,12 @@ class Error {
if
(
Config
::
get
(
'error.detail'
))
{
$view
=
View
::
make
(
'exception'
)
->
bind
(
'severity'
,
$severity
)
->
bind
(
'message'
,
$message
)
->
bind
(
'file'
,
$file
)
->
bind
(
'line'
,
$e
->
getLine
())
->
bind
(
'trace'
,
$e
->
getTraceAsString
())
->
bind
(
'contexts'
,
static
::
context
(
$file
,
$e
->
getLine
()));
->
bind
(
'severity'
,
$severity
)
->
bind
(
'message'
,
$message
)
->
bind
(
'file'
,
$file
)
->
bind
(
'line'
,
$e
->
getLine
())
->
bind
(
'trace'
,
$e
->
getTraceAsString
())
->
bind
(
'contexts'
,
static
::
context
(
$file
,
$e
->
getLine
()));
Response
::
make
(
$view
,
500
)
->
send
();
}
...
...
system/file.php
View file @
6a77a98f
...
...
@@ -125,11 +125,6 @@ class File {
*/
public
static
function
upload
(
$key
,
$path
)
{
if
(
!
array_key_exists
(
$key
,
$_FILES
))
{
return
false
;
}
return
move_uploaded_file
(
$_FILES
[
$key
][
'tmp_name'
],
$path
);
return
array_key_exists
(
$key
,
$_FILES
)
?
move_uploaded_file
(
$_FILES
[
$key
][
'tmp_name'
],
$path
)
:
false
;
}
}
\ 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