| 1 |
<?php |
| 2 |
|
| 3 |
namespace Shellbox\Command; |
| 4 |
|
| 5 |
/** |
| 6 |
* An output glob for files that are written to a local directory |
| 7 |
*/ |
| 8 |
class OutputGlobToFile extends OutputGlob { |
| 9 |
/** @var string */ |
| 10 |
private $destDir; |
| 11 |
|
| 12 |
/** |
| 13 |
* @internal |
| 14 |
* @param string $prefix |
| 15 |
* @param string $extension |
| 16 |
* @param string $destDir |
| 17 |
*/ |
| 18 |
public function __construct( $prefix, $extension, $destDir ) { |
| 19 |
parent::__construct( $prefix, $extension ); |
| 20 |
$this->destDir = $destDir; |
| 21 |
} |
| 22 |
|
| 23 |
public function getOutputFile( $boxedName ) { |
| 24 |
$instance = new OutputFileToFile( $this->destDir . '/' . basename( $boxedName ) ); |
| 25 |
$this->files[$boxedName] = $instance; |
| 26 |
return $instance; |
| 27 |
} |
| 28 |
} |