Merge pull request #12 from mikelbring/develop

Created file class with File::extension method
This commit is contained in:
Taylor Otwell 2011-06-16 22:07:36 -07:00
commit c4639524d0
2 changed files with 17 additions and 0 deletions

View File

@ -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',

16
system/file.php Normal file
View File

@ -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);
}
}