2017-08-26 18:08:11 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Contracts\Repository\Daemon;
|
|
|
|
|
2018-01-05 18:27:47 -06:00
|
|
|
use stdClass;
|
|
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
|
2019-09-05 20:33:27 -07:00
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2017-08-26 18:08:11 -05:00
|
|
|
interface FileRepositoryInterface extends BaseRepositoryInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Return stat information for a given file.
|
|
|
|
*
|
|
|
|
* @param string $path
|
2018-01-05 18:27:47 -06:00
|
|
|
* @return \stdClass
|
2017-09-03 16:32:52 -05:00
|
|
|
*
|
2018-08-06 23:14:13 -07:00
|
|
|
* @throws \GuzzleHttp\Exception\TransferException
|
2017-08-26 18:08:11 -05:00
|
|
|
*/
|
2018-01-05 18:27:47 -06:00
|
|
|
public function getFileStat(string $path): stdClass;
|
2017-08-26 18:08:11 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the contents of a given file if it can be edited in the Panel.
|
|
|
|
*
|
2019-09-05 21:32:57 -07:00
|
|
|
* @param string $path
|
2019-05-25 16:24:13 -07:00
|
|
|
* @param int|null $notLargerThan
|
2018-01-21 12:31:41 -06:00
|
|
|
* @return string
|
2017-08-26 18:08:11 -05:00
|
|
|
*/
|
2019-05-25 16:24:13 -07:00
|
|
|
public function getContent(string $path, int $notLargerThan = null): string;
|
2017-08-26 18:08:11 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Save new contents to a given file.
|
|
|
|
*
|
|
|
|
* @param string $path
|
|
|
|
* @param string $content
|
|
|
|
* @return \Psr\Http\Message\ResponseInterface
|
2017-09-03 16:32:52 -05:00
|
|
|
*
|
2018-08-06 23:14:13 -07:00
|
|
|
* @throws \GuzzleHttp\Exception\TransferException
|
2017-08-26 18:08:11 -05:00
|
|
|
*/
|
2018-01-05 18:27:47 -06:00
|
|
|
public function putContent(string $path, string $content): ResponseInterface;
|
2017-08-26 18:08:11 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a directory listing for a given path.
|
|
|
|
*
|
|
|
|
* @param string $path
|
|
|
|
* @return array
|
2017-09-03 16:32:52 -05:00
|
|
|
*
|
2018-08-06 23:14:13 -07:00
|
|
|
* @throws \GuzzleHttp\Exception\TransferException
|
2017-08-26 18:08:11 -05:00
|
|
|
*/
|
2018-01-05 18:27:47 -06:00
|
|
|
public function getDirectory(string $path): array;
|
2019-05-01 21:45:39 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a new directory for the server in the given $path.
|
|
|
|
*
|
|
|
|
* @param string $name
|
|
|
|
* @param string $path
|
|
|
|
* @return \Psr\Http\Message\ResponseInterface
|
|
|
|
*/
|
|
|
|
public function createDirectory(string $name, string $path): ResponseInterface;
|
2019-05-04 16:04:59 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Renames or moves a file on the remote machine.
|
|
|
|
*
|
|
|
|
* @param string $from
|
|
|
|
* @param string $to
|
|
|
|
* @return \Psr\Http\Message\ResponseInterface
|
|
|
|
*/
|
|
|
|
public function renameFile(string $from, string $to): ResponseInterface;
|
2019-05-04 17:26:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Copy a given file and give it a unique name.
|
|
|
|
*
|
|
|
|
* @param string $location
|
|
|
|
* @return \Psr\Http\Message\ResponseInterface
|
|
|
|
*/
|
|
|
|
public function copyFile(string $location): ResponseInterface;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete a file or folder for the server.
|
|
|
|
*
|
|
|
|
* @param string $location
|
|
|
|
* @return \Psr\Http\Message\ResponseInterface
|
|
|
|
*/
|
|
|
|
public function deleteFile(string $location): ResponseInterface;
|
2017-08-26 18:08:11 -05:00
|
|
|
}
|