forked from jolicode/castor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
$phar = new Phar(__DIR__ . '/../examples/run.phar'); | ||
$phar['index.php'] = '<?php array_shift($_SERVER["argv"]); var_dump($_SERVER["argv"]); exit(0);'; | ||
$phar->setDefaultStub('index.php', 'index.php'); | ||
$phar->stopBuffering(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace run; | ||
|
||
use Castor\Attribute\AsTask; | ||
|
||
use function Castor\run_phar; | ||
|
||
#[AsTask(description: 'Run a phar in a sub process')] | ||
function phar(): void | ||
{ | ||
run_phar('examples/run.phar', 'a', 'list', 'of', 'arguments'); | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Number of PHP files: 31 | ||
Number of PHP files: 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Castor\Tests\Generated; | ||
|
||
use Castor\Tests\TaskTestCase; | ||
use Symfony\Component\Process\Exception\ProcessFailedException; | ||
|
||
class RunPharTest extends TaskTestCase | ||
{ | ||
// run:phar | ||
public function test(): void | ||
{ | ||
$process = $this->runTask(['run:phar']); | ||
|
||
if (0 !== $process->getExitCode()) { | ||
throw new ProcessFailedException($process); | ||
} | ||
|
||
$this->assertStringEqualsFile(__FILE__ . '.output.txt', $process->getOutput()); | ||
$this->assertSame('', $process->getErrorOutput()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
array(4) { | ||
[0]=> | ||
string(3) "'a'" | ||
[1]=> | ||
string(6) "'list'" | ||
[2]=> | ||
string(4) "'of'" | ||
[3]=> | ||
string(11) "'arguments'" | ||
} |