TQ\Vcs\Repository\RepositoryInterface::writeFile PHP Method

writeFile() public method

Writes data to a file and commit the changes immediately
public writeFile ( string $path, string | array $data, string | null $commitMsg = null, integer | null $fileMode = null, integer | null $dirMode = null, boolean $recursive = true, string | null $author = null ) : string
$path string The file path
$data string | array The data to write to the file
$commitMsg string | null The commit message used when committing the changes
$fileMode integer | null The mode for creating the file
$dirMode integer | null The mode for creating the intermediate directories
$recursive boolean Create intermediate directories recursively if required
$author string | null The author
return string The current commit hash
    public function writeFile($path, $data, $commitMsg = null, $fileMode = null, $dirMode = null, $recursive = true, $author = null);

Usage Example

 /**
  * {@inheritDoc}
  */
 public function write($key, $content)
 {
     $this->repository->writeFile($key, $content);
     return true;
 }