| 1 |
<?php |
| 2 |
|
| 3 |
namespace League\Flysystem\Adapter; |
| 4 |
|
| 5 |
use League\Flysystem\Adapter\Polyfill\StreamedCopyTrait; |
| 6 |
use League\Flysystem\Adapter\Polyfill\StreamedTrait; |
| 7 |
use League\Flysystem\Config; |
| 8 |
|
| 9 |
class NullAdapter extends AbstractAdapter |
| 10 |
{ |
| 11 |
use StreamedTrait; |
| 12 |
use StreamedCopyTrait; |
| 13 |
|
| 14 |
/** |
| 15 |
* Check whether a file is present. |
| 16 |
* |
| 17 |
* @param string $path |
| 18 |
* |
| 19 |
* @return bool |
| 20 |
*/ |
| 21 |
public function has($path) |
| 22 |
{ |
| 23 |
return false; |
| 24 |
} |
| 25 |
|
| 26 |
/** |
| 27 |
* @inheritdoc |
| 28 |
*/ |
| 29 |
public function write($path, $contents, Config $config) |
| 30 |
{ |
| 31 |
$type = 'file'; |
| 32 |
$result = compact('contents', 'type', 'path'); |
| 33 |
|
| 34 |
if ($visibility = $config->get('visibility')) { |
| 35 |
$result['visibility'] = $visibility; |
| 36 |
} |
| 37 |
|
| 38 |
return $result; |
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* @inheritdoc |
| 43 |
*/ |
| 44 |
public function update($path, $contents, Config $config) |
| 45 |
{ |
| 46 |
return false; |
| 47 |
} |
| 48 |
|
| 49 |
/** |
| 50 |
* @inheritdoc |
| 51 |
*/ |
| 52 |
public function read($path) |
| 53 |
{ |
| 54 |
return false; |
| 55 |
} |
| 56 |
|
| 57 |
/** |
| 58 |
* @inheritdoc |
| 59 |
*/ |
| 60 |
public function rename($path, $newpath) |
| 61 |
{ |
| 62 |
return false; |
| 63 |
} |
| 64 |
|
| 65 |
/** |
| 66 |
* @inheritdoc |
| 67 |
*/ |
| 68 |
public function delete($path) |
| 69 |
{ |
| 70 |
return false; |
| 71 |
} |
| 72 |
|
| 73 |
/** |
| 74 |
* @inheritdoc |
| 75 |
*/ |
| 76 |
public function listContents($directory = '', $recursive = false) |
| 77 |
{ |
| 78 |
return []; |
| 79 |
} |
| 80 |
|
| 81 |
/** |
| 82 |
* @inheritdoc |
| 83 |
*/ |
| 84 |
public function getMetadata($path) |
| 85 |
{ |
| 86 |
return false; |
| 87 |
} |
| 88 |
|
| 89 |
/** |
| 90 |
* @inheritdoc |
| 91 |
*/ |
| 92 |
public function getSize($path) |
| 93 |
{ |
| 94 |
return false; |
| 95 |
} |
| 96 |
|
| 97 |
/** |
| 98 |
* @inheritdoc |
| 99 |
*/ |
| 100 |
public function getMimetype($path) |
| 101 |
{ |
| 102 |
return false; |
| 103 |
} |
| 104 |
|
| 105 |
/** |
| 106 |
* @inheritdoc |
| 107 |
*/ |
| 108 |
public function getTimestamp($path) |
| 109 |
{ |
| 110 |
return false; |
| 111 |
} |
| 112 |
|
| 113 |
/** |
| 114 |
* @inheritdoc |
| 115 |
*/ |
| 116 |
public function getVisibility($path) |
| 117 |
{ |
| 118 |
return false; |
| 119 |
} |
| 120 |
|
| 121 |
/** |
| 122 |
* @inheritdoc |
| 123 |
*/ |
| 124 |
public function setVisibility($path, $visibility) |
| 125 |
{ |
| 126 |
return compact('visibility'); |
| 127 |
} |
| 128 |
|
| 129 |
/** |
| 130 |
* @inheritdoc |
| 131 |
*/ |
| 132 |
public function createDir($dirname, Config $config) |
| 133 |
{ |
| 134 |
return ['path' => $dirname, 'type' => 'dir']; |
| 135 |
} |
| 136 |
|
| 137 |
/** |
| 138 |
* @inheritdoc |
| 139 |
*/ |
| 140 |
public function deleteDir($dirname) |
| 141 |
{ |
| 142 |
return false; |
| 143 |
} |
| 144 |
} |
| 145 |
|