2017-08-26 23:08:11 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Contracts\Repository\Daemon;
|
|
|
|
|
2018-01-06 00:27:47 +00:00
|
|
|
use stdClass;
|
|
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
|
2017-08-26 23:08:11 +00:00
|
|
|
interface FileRepositoryInterface extends BaseRepositoryInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Return stat information for a given file.
|
|
|
|
*
|
|
|
|
* @param string $path
|
2018-01-06 00:27:47 +00:00
|
|
|
* @return \stdClass
|
2017-09-03 21:32:52 +00:00
|
|
|
*
|
2018-08-07 06:14:13 +00:00
|
|
|
* @throws \GuzzleHttp\Exception\TransferException
|
2017-08-26 23:08:11 +00:00
|
|
|
*/
|
2018-01-06 00:27:47 +00:00
|
|
|
public function getFileStat(string $path): stdClass;
|
2017-08-26 23:08:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the contents of a given file if it can be edited in the Panel.
|
|
|
|
*
|
|
|
|
* @param string $path
|
2018-01-21 18:31:41 +00:00
|
|
|
* @return string
|
2017-09-03 21:32:52 +00:00
|
|
|
*
|
2018-08-07 06:14:13 +00:00
|
|
|
* @throws \GuzzleHttp\Exception\TransferException
|
2017-08-26 23:08:11 +00:00
|
|
|
*/
|
2018-01-21 18:31:41 +00:00
|
|
|
public function getContent(string $path): string;
|
2017-08-26 23:08:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Save new contents to a given file.
|
|
|
|
*
|
|
|
|
* @param string $path
|
|
|
|
* @param string $content
|
|
|
|
* @return \Psr\Http\Message\ResponseInterface
|
2017-09-03 21:32:52 +00:00
|
|
|
*
|
2018-08-07 06:14:13 +00:00
|
|
|
* @throws \GuzzleHttp\Exception\TransferException
|
2017-08-26 23:08:11 +00:00
|
|
|
*/
|
2018-01-06 00:27:47 +00:00
|
|
|
public function putContent(string $path, string $content): ResponseInterface;
|
2017-08-26 23:08:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a directory listing for a given path.
|
|
|
|
*
|
|
|
|
* @param string $path
|
|
|
|
* @return array
|
2017-09-03 21:32:52 +00:00
|
|
|
*
|
2018-08-07 06:14:13 +00:00
|
|
|
* @throws \GuzzleHttp\Exception\TransferException
|
2017-08-26 23:08:11 +00:00
|
|
|
*/
|
2018-01-06 00:27:47 +00:00
|
|
|
public function getDirectory(string $path): array;
|
2017-08-26 23:08:11 +00:00
|
|
|
}
|