|
@@ -486,6 +486,18 @@ class File extends \SplFileInfo
|
|
return $guesser->guess($this->getPathname());
|
|
return $guesser->guess($this->getPathname());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Returns the extension of the file.
|
|
|
|
+ *
|
|
|
|
+ * \SplFileInfo::getExtension() is not available before PHP 5.3.6
|
|
|
|
+ *
|
|
|
|
+ * @return string The extension
|
|
|
|
+ */
|
|
|
|
+ public function getExtension()
|
|
|
|
+ {
|
|
|
|
+ return pathinfo($this->getBasename(), PATHINFO_EXTENSION);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Moves the file to a new location.
|
|
* Moves the file to a new location.
|
|
*
|
|
*
|