123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Framework\Filesystem\Directory;
- /**
- * Interface \Magento\Framework\Filesystem\Directory\WriteInterface
- * @api
- * @since 100.0.2
- */
- interface WriteInterface extends ReadInterface
- {
- /**
- * Create directory if it does not exists
- *
- * @param string $path [optional]
- * @return bool
- * @throws \Magento\Framework\Exception\FileSystemException
- */
- public function create($path = null);
- /**
- * Delete given path
- *
- * @param string $path [optional]
- * @return bool
- * @throws \Magento\Framework\Exception\FileSystemException
- */
- public function delete($path = null);
- /**
- * Rename a file
- *
- * @param string $path
- * @param string $newPath
- * @param WriteInterface $targetDirectory [optional]
- * @return bool
- * @throws \Magento\Framework\Exception\FileSystemException
- */
- public function renameFile($path, $newPath, WriteInterface $targetDirectory = null);
- /**
- * Copy a file
- *
- * @param string $path
- * @param string $destination
- * @param WriteInterface $targetDirectory [optional]
- * @return bool
- * @throws \Magento\Framework\Exception\FileSystemException
- */
- public function copyFile($path, $destination, WriteInterface $targetDirectory = null);
- /**
- * Creates symlink on a file or directory and places it to destination
- *
- * @param string $path
- * @param string $destination
- * @param WriteInterface $targetDirectory [optional]
- * @return bool
- * @throws \Magento\Framework\Exception\FileSystemException
- */
- public function createSymlink($path, $destination, WriteInterface $targetDirectory = null);
- /**
- * Change permissions of given path
- *
- * @param string $path
- * @param int $permissions
- * @return bool
- * @throws \Magento\Framework\Exception\FileSystemException
- */
- public function changePermissions($path, $permissions);
- /**
- * Change permissions of given path
- *
- * @param string $path
- * @param int $dirPermissions
- * @param int $filePermissions
- * @return bool
- * @throws \Magento\Framework\Exception\FileSystemException
- */
- public function changePermissionsRecursively($path, $dirPermissions, $filePermissions);
- /**
- * Sets access and modification time of file.
- *
- * @param string $path
- * @param int $modificationTime [optional]
- * @return bool
- * @throws \Magento\Framework\Exception\FileSystemException
- */
- public function touch($path, $modificationTime = null);
- /**
- * Check if given path is writable
- *
- * @param string $path [optional]
- * @return bool
- */
- public function isWritable($path = null);
- /**
- * Open file in given mode
- *
- * @param string $path
- * @param string $mode
- * @return \Magento\Framework\Filesystem\File\WriteInterface
- */
- public function openFile($path, $mode = 'w');
- /**
- * Open file in given path
- *
- * @param string $path
- * @param string $content
- * @param string $mode [optional]
- * @return int The number of bytes that were written.
- * @throws \Magento\Framework\Exception\FileSystemException
- */
- public function writeFile($path, $content, $mode = null);
- /**
- * Get driver
- *
- * @return \Magento\Framework\Filesystem\DriverInterface
- */
- public function getDriver();
- }
|