public getSourceDirectory ( ) : path | ||
Résultat | path | return source directory |
public function apply() { foreach ($this->paths as $relativePath) { $absolutePath = $this->build->getSourceDirectory() . DIRECTORY_SEPARATOR . $relativePath; $contents = $this->read($absolutePath); $this->backup($absolutePath, $contents); $newContents = $this->applyRules($contents); $this->write($absolutePath, $newContents); } }
public function apply(Buildable $build, Logger $logger) { $patched = 0; foreach ($this->files as $file) { $path = $build->getSourceDirectory() . DIRECTORY_SEPARATOR . $file; if (!file_exists($path)) { $logger->error("file {$path} doesn't exist in the build directory."); continue; } if ($content = file_get_contents($path)) { $content = $this->applyTextContent($content, $patched); if (false === file_put_contents($path, $content)) { $logger->error("Patch on {$path} write failed."); } } } return $patched; }
public function clean(Buildable $build) { return $this->make($build->getSourceDirectory(), 'clean'); }