mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/15553] Add method to get direct link
PHPBB3-15553
This commit is contained in:
@@ -57,6 +57,11 @@ class local implements adapter_interface, stream_interface
|
||||
*/
|
||||
protected $root_path;
|
||||
|
||||
/**
|
||||
* @var string path
|
||||
*/
|
||||
protected $path;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -73,12 +78,13 @@ class local implements adapter_interface, stream_interface
|
||||
*/
|
||||
public function configure($options)
|
||||
{
|
||||
$this->root_path = $this->phpbb_root_path . $options['path'];
|
||||
|
||||
if (substr($this->root_path, -1, 1) !== DIRECTORY_SEPARATOR)
|
||||
if (substr($options['path'], -1, 1) !== DIRECTORY_SEPARATOR)
|
||||
{
|
||||
$this->root_path = $this->root_path . DIRECTORY_SEPARATOR;
|
||||
$options['path'] = $options['path'] . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
|
||||
$this->path = $options['path'];
|
||||
$this->root_path = $this->phpbb_root_path . $options['path'];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -331,4 +337,12 @@ class local implements adapter_interface, stream_interface
|
||||
{
|
||||
return $this->image_dimensions($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_link($path)
|
||||
{
|
||||
return generate_board_url() . $this->root_path . $path;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user