elFinder\elFinderVolumeDriver::putContents PHP Метод

putContents() публичный Метод

Put content in text file and return file info.
Автор: Dmitry (dio) Levashov
public putContents ( string $hash, string $content ) : array
$hash string file hash
$content string new file content
Результат array
    public function putContents($hash, $content)
    {
        if ($this->commandDisabled('edit')) {
            return $this->setError(elFinder::ERROR_PERM_DENIED);
        }
        $path = $this->decode($hash);
        if (!($file = $this->file($hash))) {
            return $this->setError(elFinder::ERROR_FILE_NOT_FOUND);
        }
        if (!$file['write']) {
            return $this->setError(elFinder::ERROR_PERM_DENIED);
        }
        $this->clearcache();
        return $this->_filePutContents($path, $content) ? $this->stat($path) : false;
    }