createFile() public method

Creates a file at given path
public createFile ( string $path, string $contents ) : boolean
$path string Where to put the file.
$contents string Content to put in the file.
return boolean Success
Beispiel #1
1
 /**
  * Creates a file at given path
  * @param string $path Where to put the file
  * @param string $contents Content to put in the file
  * @return bool
  */
 public function createFile($path, $contents)
 {
     //Checks if the file already exist
     if (file_exists($path)) {
         $this->verbose(__d('me_tools', 'File or directory {0} already exists', rtr($path)));
         return false;
     }
     return parent::createFile($path, $contents);
 }