mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-05 22:14:59 +02:00
[ticket/11912] Introduce guesser_interface
This will contain proper documentation of the required methods if anyone would implement a newer guesser. PHPBB3-11912
This commit is contained in:
parent
bc7ff47537
commit
d25ab02ef3
@ -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 = '')
|
||||
{
|
||||
|
41
phpBB/phpbb/mimetype/guesser_interface.php
Normal file
41
phpBB/phpbb/mimetype/guesser_interface.php
Normal file
@ -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 = '');
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user