Created file class with File::extension method, added File to aliases under application
This commit is contained in:
parent
5c275db6f4
commit
4d7794c2ca
|
@ -103,6 +103,7 @@
|
|||
'DB' => 'System\\DB',
|
||||
'Download' => 'System\\Download',
|
||||
'Eloquent' => 'System\\DB\\Eloquent',
|
||||
'File' => 'System\\File',
|
||||
'Form' => 'System\\Form',
|
||||
'Hash' => 'System\\Hash',
|
||||
'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