JonathanTorres\Construct\Helpers\Filesystem::move PHP Method

move() public method

Move the given file to a new location.
public move ( string $path, string $target ) : boolean
$path string
$target string
return boolean
    public function move($path, $target)
    {
        $this->copy($path, $target);
        unlink($path);
    }

Usage Example

Example #1
0
 /**
  * Generate GitHub template files.
  *
  * @return void
  */
 protected function githubTemplates()
 {
     $this->file->makeDirectory($this->projectLower . '/.github', true);
     $templates = ['ISSUE_TEMPLATE', 'PULL_REQUEST_TEMPLATE'];
     foreach ($templates as $template) {
         $this->file->copy(__DIR__ . '/stubs/github/' . $template . '.stub', $this->projectLower . '/.github/' . $template . '.md');
     }
     $this->file->move($this->projectLower . '/CONTRIBUTING.md', $this->projectLower . '/.github/CONTRIBUTING.md');
     $index = array_search('CONTRIBUTING.md', $this->exportIgnores);
     unset($this->exportIgnores[$index]);
     $this->exportIgnores[] = '.github/';
 }