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
15043348
Commit
15043348
authored
Aug 23, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring file class.
parent
0a2ce4e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
file.php
laravel/file.php
+18
-3
No files found.
laravel/file.php
View file @
15043348
...
@@ -74,6 +74,13 @@ class File {
...
@@ -74,6 +74,13 @@ class File {
/**
/**
* Get a file MIME type by extension.
* Get a file MIME type by extension.
*
*
* Any extension in the MIMEs configuration file may be passed to the method.
*
* <code>
* // Returns "application/x-tar"
* $mime = File::mime('tar');
* </code>
*
* @param string $extension
* @param string $extension
* @param string $default
* @param string $default
* @return string
* @return string
...
@@ -93,9 +100,17 @@ class File {
...
@@ -93,9 +100,17 @@ class File {
/**
/**
* Determine if a file is a given type.
* Determine if a file is a given type.
*
*
* The Fileinfo PHP extension will be used to determine the MIME type
* The Fileinfo PHP extension will be used to determine the MIME type of the file. Any extension
* of the file. Any extension in the mimes configuration array may
* in the MIMEs configuration file may be passed as a type.
* be passed as a type.
*
* <code>
* // Determine if the file is a JPG image
* $image = File::is('jpg', 'path/to/image.jpg');
* </code>
*
* @param string $extension
* @param string $path
* @return bool
*/
*/
public
static
function
is
(
$extension
,
$path
)
public
static
function
is
(
$extension
,
$path
)
{
{
...
...
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