mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/15253] Add storage abstraction
PHPBB3-15253
This commit is contained in:
66
phpBB/phpbb/storage/storage.php
Normal file
66
phpBB/phpbb/storage/storage.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\storage;
|
||||
|
||||
use phpbb\storage\exception\exception;
|
||||
|
||||
class storage
|
||||
{
|
||||
protected $adapter;
|
||||
|
||||
public function __construct($adapter)
|
||||
{
|
||||
$this->adapter = $adapter;
|
||||
}
|
||||
|
||||
public function put_contents($path, $content)
|
||||
{
|
||||
$this->adapter->put_contents($path, $content);
|
||||
}
|
||||
|
||||
public function get_contents($path)
|
||||
{
|
||||
$this->adapter->put_contents($path);
|
||||
}
|
||||
|
||||
public function exists($path)
|
||||
{
|
||||
return $this->adapter->exists($path);
|
||||
}
|
||||
|
||||
public function delete($path)
|
||||
{
|
||||
$this->adapter->delete($path);
|
||||
}
|
||||
|
||||
public function rename($path_orig, $path_dest)
|
||||
{
|
||||
$this->adapter->rename($path_orig, $path_dest);
|
||||
}
|
||||
|
||||
public function copy($path_orig, $path_dest)
|
||||
{
|
||||
$this->adapter->copy($path_orig, $path_dest);
|
||||
}
|
||||
|
||||
public function create_dir($path)
|
||||
{
|
||||
$this->adapter->create_dir($path);
|
||||
}
|
||||
|
||||
public function delete_dir($path)
|
||||
{
|
||||
$this->adapter->delete_dir($path);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user