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
6b5cccc1
Commit
6b5cccc1
authored
Jul 07, 2012
by
Franz Liedke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move get_file_size() helper function to helpers.php.
parent
94e9106b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
helpers.php
laravel/helpers.php
+12
-0
profiler.php
laravel/profiling/profiler.php
+2
-14
No files found.
laravel/helpers.php
View file @
6b5cccc1
...
@@ -581,3 +581,15 @@ function get_cli_option($option, $default = null)
...
@@ -581,3 +581,15 @@ function get_cli_option($option, $default = null)
return
value
(
$default
);
return
value
(
$default
);
}
}
/**
* Calculate the human-readable file size (with proper units).
*
* @param int $size
* @return string
*/
function
get_file_size
(
$size
)
{
$units
=
array
(
'Bytes'
,
'KiB'
,
'MiB'
,
'GiB'
,
'TiB'
,
'PiB'
,
'EiB'
);
return
@
round
(
$size
/
pow
(
1024
,
(
$i
=
floor
(
log
(
$size
,
1024
)))),
2
)
.
' '
.
$units
[
$i
];
}
\ No newline at end of file
laravel/profiling/profiler.php
View file @
6b5cccc1
...
@@ -28,25 +28,13 @@ class Profiler {
...
@@ -28,25 +28,13 @@ class Profiler {
// type applications, so we will not send anything in those scenarios.
// type applications, so we will not send anything in those scenarios.
if
(
!
Request
::
ajax
())
if
(
!
Request
::
ajax
())
{
{
static
::
$data
[
'memory'
]
=
static
::
get_file_size
(
memory_get_usage
(
true
));
static
::
$data
[
'memory'
]
=
get_file_size
(
memory_get_usage
(
true
));
static
::
$data
[
'memory_peak'
]
=
static
::
get_file_size
(
memory_get_peak_usage
(
true
));
static
::
$data
[
'memory_peak'
]
=
get_file_size
(
memory_get_peak_usage
(
true
));
static
::
$data
[
'time'
]
=
number_format
((
microtime
(
true
)
-
LARAVEL_START
)
*
1000
,
2
);
static
::
$data
[
'time'
]
=
number_format
((
microtime
(
true
)
-
LARAVEL_START
)
*
1000
,
2
);
return
render
(
'path: '
.
__DIR__
.
'/template'
.
BLADE_EXT
,
static
::
$data
);
return
render
(
'path: '
.
__DIR__
.
'/template'
.
BLADE_EXT
,
static
::
$data
);
}
}
}
}
/**
* Calculate the human-readable file size (with proper units).
*
* @param int $size
* @return string
*/
private
static
function
get_file_size
(
$size
)
{
$units
=
array
(
'Bytes'
,
'KiB'
,
'MiB'
,
'GiB'
,
'TiB'
,
'PiB'
,
'EiB'
);
return
@
round
(
$size
/
pow
(
1024
,
(
$i
=
floor
(
log
(
$size
,
1024
)))),
2
)
.
' '
.
$units
[
$i
];
}
/**
/**
* Add a log entry to the log entries array.
* Add a log entry to the log entries array.
*
*
...
...
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