123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <?php
- namespace League\Flysystem\Adapter;
- use League\Flysystem\Adapter\Polyfill\StreamedCopyTrait;
- use League\Flysystem\Adapter\Polyfill\StreamedTrait;
- use League\Flysystem\Config;
- class NullAdapter extends AbstractAdapter
- {
- use StreamedTrait;
- use StreamedCopyTrait;
- /**
- * Check whether a file is present.
- *
- * @param string $path
- *
- * @return bool
- */
- public function has($path)
- {
- return false;
- }
- /**
- * @inheritdoc
- */
- public function write($path, $contents, Config $config)
- {
- $type = 'file';
- $result = compact('contents', 'type', 'path');
- if ($visibility = $config->get('visibility')) {
- $result['visibility'] = $visibility;
- }
- return $result;
- }
- /**
- * @inheritdoc
- */
- public function update($path, $contents, Config $config)
- {
- return false;
- }
- /**
- * @inheritdoc
- */
- public function read($path)
- {
- return false;
- }
- /**
- * @inheritdoc
- */
- public function rename($path, $newpath)
- {
- return false;
- }
- /**
- * @inheritdoc
- */
- public function delete($path)
- {
- return false;
- }
- /**
- * @inheritdoc
- */
- public function listContents($directory = '', $recursive = false)
- {
- return [];
- }
- /**
- * @inheritdoc
- */
- public function getMetadata($path)
- {
- return false;
- }
- /**
- * @inheritdoc
- */
- public function getSize($path)
- {
- return false;
- }
- /**
- * @inheritdoc
- */
- public function getMimetype($path)
- {
- return false;
- }
- /**
- * @inheritdoc
- */
- public function getTimestamp($path)
- {
- return false;
- }
- /**
- * @inheritdoc
- */
- public function getVisibility($path)
- {
- return false;
- }
- /**
- * @inheritdoc
- */
- public function setVisibility($path, $visibility)
- {
- return compact('visibility');
- }
- /**
- * @inheritdoc
- */
- public function createDir($dirname, Config $config)
- {
- return ['path' => $dirname, 'type' => 'dir'];
- }
- /**
- * @inheritdoc
- */
- public function deleteDir($dirname)
- {
- return false;
- }
- }
|