diff options
author | Marc Alexander <admin@m-a-styles.de> | 2013-10-24 12:07:26 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2013-10-24 12:07:26 +0200 |
commit | d25ab02ef34c5e20deb278e4379a6a3a365a93a0 (patch) | |
tree | 216fb6aa1f461f3375f0197c600f746f80eb9e11 /phpBB/phpbb | |
parent | bc7ff47537bae4f6db9de781cf8ba3487e28a30b (diff) | |
download | forums-d25ab02ef34c5e20deb278e4379a6a3a365a93a0.tar forums-d25ab02ef34c5e20deb278e4379a6a3a365a93a0.tar.gz forums-d25ab02ef34c5e20deb278e4379a6a3a365a93a0.tar.bz2 forums-d25ab02ef34c5e20deb278e4379a6a3a365a93a0.tar.xz forums-d25ab02ef34c5e20deb278e4379a6a3a365a93a0.zip |
[ticket/11912] Introduce guesser_interface
This will contain proper documentation of the required methods if anyone
would implement a newer guesser.
PHPBB3-11912
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/mimetype/content_guesser.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/mimetype/guesser_interface.php | 41 |
2 files changed, 43 insertions, 6 deletions
diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index 6326bf73fa..f5be9cd44b 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -21,7 +21,7 @@ if (!defined('IN_PHPBB')) * @package mimetype */ -class content_guesser +class content_guesser implements guesser_interface { /** * @var file extension map @@ -486,11 +486,7 @@ class content_guesser } /** - * Guess mimetype of supplied file - * - * @param string $file Path to file - * - * @return string Guess for mimetype of file + * @inheritdoc */ public function guess($file, $file_name = '') { diff --git a/phpBB/phpbb/mimetype/guesser_interface.php b/phpBB/phpbb/mimetype/guesser_interface.php new file mode 100644 index 0000000000..a9b238d7aa --- /dev/null +++ b/phpBB/phpbb/mimetype/guesser_interface.php @@ -0,0 +1,41 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +namespace phpbb\mimetype; + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* @package mimetype +*/ + +interface guesser_interface +{ + /** + * Returns whether this guesser is supported on the current OS + * + * @return bool True if guesser is supported, false if not + */ + public function is_supported(); + + /** + * Guess mimetype of supplied file + * + * @param string $file Path to file + * + * @return string Guess for mimetype of file + */ + public function guess($file, $file_name = ''); +} |