getSourceDirectory() public method

public getSourceDirectory ( ) : path
return path return source directory
Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 public function clean(Buildable $build)
 {
     return $this->make($build->getSourceDirectory(), 'clean');
 }