copy() public static method

Copies a file. Uses Symfony's copy but actually honors the third parameter.
public static copy ( string $origin, string $target, boolean $override = false )
$origin string
$target string
$override boolean
 public function saveDefinitionForPlugin($pluginFile)
 {
     $pluginSlug = basename(dirname($pluginFile));
     $actionsFile = WP_PLUGIN_DIR . '/' . $pluginSlug . '/.versionpress/actions.yml';
     if (!is_file($actionsFile)) {
         return;
     }
     $targetFile = $this->getDefinitionFileName($pluginSlug);
     FileSystem::copy($actionsFile, $targetFile);
 }
Ejemplo n.º 2
0
 /**
  * Installs Gitignore to the repository root, or does nothing if the file already exists.
  */
 private function installGitignore()
 {
     FileSystem::copy(__DIR__ . '/.gitignore.tpl', ABSPATH . '.gitignore', false);
 }