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
766fa983
Commit
766fa983
authored
Sep 22, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweaking code and adding comments.
parent
1c9798e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
50 deletions
+24
-50
exception.php
application/views/error/exception.php
+1
-24
cookie.php
laravel/cookie.php
+3
-1
file.php
laravel/file.php
+20
-25
No files found.
application/views/error/exception.php
View file @
766fa983
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<title>
Laravel -
Uncaught Exception
</title>
<title>
Laravel -
<?php
echo
$severity
;
?>
</title>
<style>
<style>
@import
url(http://fonts.googleapis.com/css?family=Ubuntu)
;
@import
url(http://fonts.googleapis.com/css?family=Ubuntu)
;
...
@@ -48,16 +48,6 @@
...
@@ -48,16 +48,6 @@
line-height
:
25px
;
line-height
:
25px
;
margin
:
10px
0
;
margin
:
10px
0
;
}
}
#main
pre
{
font-size
:
12px
;
background-color
:
#f0f0f0
;
border-left
:
1px
solid
#d8d8d8
;
border-top
:
1px
solid
#d8d8d8
;
border-radius
:
5px
;
padding
:
10px
;
white-space
:
pre-wrap
;
}
</style>
</style>
</head>
</head>
<body>
<body>
...
@@ -71,19 +61,6 @@
...
@@ -71,19 +61,6 @@
<h3>
Stack Trace
</h3>
<h3>
Stack Trace
</h3>
<pre>
<?php
echo
$exception
->
getTraceAsString
();
?>
</pre>
<pre>
<?php
echo
$exception
->
getTraceAsString
();
?>
</pre>
<h3>
Snapshot
</h3>
<?php
$lines
=
array
();
foreach
(
File
::
snapshot
(
$exception
->
getFile
(),
$exception
->
getLine
())
as
$num
=>
$context
)
{
$lines
[]
=
$num
.
': '
.
$context
;
}
?>
<pre>
<?php
echo
htmlentities
(
implode
(
"
\n
"
,
$lines
));
?>
</pre>
</div>
</div>
</body>
</body>
</html>
</html>
\ No newline at end of file
laravel/cookie.php
View file @
766fa983
...
@@ -83,7 +83,9 @@ class Cookie {
...
@@ -83,7 +83,9 @@ class Cookie {
if
(
$minutes
<
0
)
unset
(
$_COOKIE
[
$name
]);
if
(
$minutes
<
0
)
unset
(
$_COOKIE
[
$name
]);
$time
=
(
$minutes
!=
0
)
?
time
()
+
(
$minutes
*
60
)
:
0
;
// Since PHP needs the cookie lifetime in seconds, we will calculate it here.
// A "0" lifetime means the cookie expires when the browser closes.
$time
=
(
$minutes
!==
0
)
?
time
()
+
(
$minutes
*
60
)
:
0
;
return
setcookie
(
$name
,
$value
,
$time
,
$path
,
$domain
,
$secure
,
$http_only
);
return
setcookie
(
$name
,
$value
,
$time
,
$path
,
$domain
,
$secure
,
$http_only
);
}
}
...
...
laravel/file.php
View file @
766fa983
...
@@ -104,21 +104,31 @@ class File {
...
@@ -104,21 +104,31 @@ class File {
}
}
/**
/**
* Move an uploaded file to permanen
e
t storage.
* Move an uploaded file to permanent storage.
*
*
* @param string $key
* @param string $key
* @param string $path
* @param string $path
* @param array $files
* @param array $files
* @return bool
* @return bool
*/
*/
public
static
function
upload
(
$key
,
$path
,
$files
)
public
static
function
upload
(
$key
,
$path
,
$files
=
null
)
{
{
if
(
is_null
(
$files
))
$files
=
$_FILES
;
return
move_uploaded_file
(
$files
[
$key
][
'tmp_name'
],
$path
);
return
move_uploaded_file
(
$files
[
$key
][
'tmp_name'
],
$path
);
}
}
/**
/**
* Get a file MIME type by extension.
* Get a file MIME type by extension.
*
*
* <code>
* // Determine the MIME type for the .tar extension
* $mime = File::mime('tar');
*
* // Return a default value if the MIME can't be determined
* $mime = File::mime('ext', 'application/octet-stream');
* </code>
*
* @param string $extension
* @param string $extension
* @param string $default
* @param string $default
* @return string
* @return string
...
@@ -137,6 +147,14 @@ class File {
...
@@ -137,6 +147,14 @@ class File {
*
*
* The Fileinfo PHP extension will be used to determine the MIME type of the file.
* The Fileinfo PHP extension will be used to determine the MIME type of the file.
*
*
* <code>
* // Determine if a file is a JPG image
* $jpg = File::is('jpg', 'path/to/file.jpg');
*
* // Determine if a file is one of a given list of types
* $image = File::is(array('jpg', 'png', 'gif'), 'path/to/file');
* </code>
*
* @param array|string $extension
* @param array|string $extension
* @param string $path
* @param string $path
* @return bool
* @return bool
...
@@ -155,27 +173,4 @@ class File {
...
@@ -155,27 +173,4 @@ class File {
return
false
;
return
false
;
}
}
/**
* Get the lines surrounding a given line in a file.
*
* @param string $path
* @param int $line
* @param int $padding
* @return array
*/
public
static
function
snapshot
(
$path
,
$line
,
$padding
=
5
)
{
if
(
!
file_exists
(
$path
))
return
array
();
$file
=
file
(
$path
,
FILE_IGNORE_NEW_LINES
);
array_unshift
(
$file
,
''
);
if
((
$start
=
$line
-
$padding
)
<
0
)
$start
=
0
;
if
((
$length
=
(
$line
-
$start
)
+
$padding
+
1
)
<
0
)
$length
=
0
;
return
array_slice
(
$file
,
$start
,
$length
,
true
);
}
}
}
\ 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