Merge pull request #12 from mikelbring/develop
Created file class with File::extension method
This commit is contained in:
commit
c4639524d0
|
@ -103,6 +103,7 @@
|
||||||
'DB' => 'System\\DB',
|
'DB' => 'System\\DB',
|
||||||
'Download' => 'System\\Download',
|
'Download' => 'System\\Download',
|
||||||
'Eloquent' => 'System\\DB\\Eloquent',
|
'Eloquent' => 'System\\DB\\Eloquent',
|
||||||
|
'File' => 'System\\File',
|
||||||
'Form' => 'System\\Form',
|
'Form' => 'System\\Form',
|
||||||
'Hash' => 'System\\Hash',
|
'Hash' => 'System\\Hash',
|
||||||
'HTML' => 'System\\HTML',
|
'HTML' => 'System\\HTML',
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php namespace System;
|
||||||
|
|
||||||
|
class File {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a file's extension.
|
||||||
|
*
|
||||||
|
* @param string $path
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function extension($path)
|
||||||
|
{
|
||||||
|
return pathinfo($path, PATHINFO_EXTENSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue