| 1 |
<?php |
| 2 |
|
| 3 |
namespace League\Flysystem; |
| 4 |
|
| 5 |
interface AdapterInterface extends ReadInterface |
| 6 |
{ |
| 7 |
/** |
| 8 |
* @const VISIBILITY_PUBLIC public visibility |
| 9 |
*/ |
| 10 |
const VISIBILITY_PUBLIC = 'public'; |
| 11 |
|
| 12 |
/** |
| 13 |
* @const VISIBILITY_PRIVATE private visibility |
| 14 |
*/ |
| 15 |
const VISIBILITY_PRIVATE = 'private'; |
| 16 |
|
| 17 |
/** |
| 18 |
* Write a new file. |
| 19 |
* |
| 20 |
* @param string $path |
| 21 |
* @param string $contents |
| 22 |
* @param Config $config Config object |
| 23 |
* |
| 24 |
* @return array|false false on failure file meta data on success |
| 25 |
*/ |
| 26 |
public function write($path, $contents, Config $config); |
| 27 |
|
| 28 |
/** |
| 29 |
* Write a new file using a stream. |
| 30 |
* |
| 31 |
* @param string $path |
| 32 |
* @param resource $resource |
| 33 |
* @param Config $config Config object |
| 34 |
* |
| 35 |
* @return array|false false on failure file meta data on success |
| 36 |
*/ |
| 37 |
public function writeStream($path, $resource, Config $config); |
| 38 |
|
| 39 |
/** |
| 40 |
* Update a file. |
| 41 |
* |
| 42 |
* @param string $path |
| 43 |
* @param string $contents |
| 44 |
* @param Config $config Config object |
| 45 |
* |
| 46 |
* @return array|false false on failure file meta data on success |
| 47 |
*/ |
| 48 |
public function update($path, $contents, Config $config); |
| 49 |
|
| 50 |
/** |
| 51 |
* Update a file using a stream. |
| 52 |
* |
| 53 |
* @param string $path |
| 54 |
* @param resource $resource |
| 55 |
* @param Config $config Config object |
| 56 |
* |
| 57 |
* @return array|false false on failure file meta data on success |
| 58 |
*/ |
| 59 |
public function updateStream($path, $resource, Config $config); |
| 60 |
|
| 61 |
/** |
| 62 |
* Rename a file. |
| 63 |
* |
| 64 |
* @param string $path |
| 65 |
* @param string $newpath |
| 66 |
* |
| 67 |
* @return bool |
| 68 |
*/ |
| 69 |
public function rename($path, $newpath); |
| 70 |
|
| 71 |
/** |
| 72 |
* Copy a file. |
| 73 |
* |
| 74 |
* @param string $path |
| 75 |
* @param string $newpath |
| 76 |
* |
| 77 |
* @return bool |
| 78 |
*/ |
| 79 |
public function copy($path, $newpath); |
| 80 |
|
| 81 |
/** |
| 82 |
* Delete a file. |
| 83 |
* |
| 84 |
* @param string $path |
| 85 |
* |
| 86 |
* @return bool |
| 87 |
*/ |
| 88 |
public function delete($path); |
| 89 |
|
| 90 |
/** |
| 91 |
* Delete a directory. |
| 92 |
* |
| 93 |
* @param string $dirname |
| 94 |
* |
| 95 |
* @return bool |
| 96 |
*/ |
| 97 |
public function deleteDir($dirname); |
| 98 |
|
| 99 |
/** |
| 100 |
* Create a directory. |
| 101 |
* |
| 102 |
* @param string $dirname directory name |
| 103 |
* @param Config $config |
| 104 |
* |
| 105 |
* @return array|false |
| 106 |
*/ |
| 107 |
public function createDir($dirname, Config $config); |
| 108 |
|
| 109 |
/** |
| 110 |
* Set the visibility for a file. |
| 111 |
* |
| 112 |
* @param string $path |
| 113 |
* @param string $visibility |
| 114 |
* |
| 115 |
* @return array|false file meta data |
| 116 |
*/ |
| 117 |
public function setVisibility($path, $visibility); |
| 118 |
} |
| 119 |
|