Skip to content

Commit c826424

Browse files
authored
Merge pull request #1 from php-etl/feature/composer-auth
Added composer auth command
2 parents 7fa8207 + 1326939 commit c826424

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Kiboko\Component\Dockerfile\PHP;
6+
7+
use Kiboko\Component\Dockerfile\Dockerfile;
8+
9+
final class ComposerAddComposerRepository implements Dockerfile\LayerInterface
10+
{
11+
public function __construct(
12+
private string $name,
13+
private string $url
14+
) {}
15+
16+
public function __toString()
17+
{
18+
return (string) new Dockerfile\Run(sprintf(<<<RUN
19+
set -ex \\
20+
&& composer config repositories.%s composer %s
21+
RUN, $this->name, $this->url));
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Kiboko\Component\Dockerfile\PHP;
6+
7+
use Kiboko\Component\Dockerfile\Dockerfile;
8+
9+
final class ComposerAuthenticationToken implements Dockerfile\LayerInterface
10+
{
11+
public function __construct(
12+
private string $url,
13+
private string $token,
14+
) {}
15+
16+
public function __toString()
17+
{
18+
return (string) new Dockerfile\Run(sprintf(<<<RUN
19+
set -ex \\
20+
&& composer config --auth %s token %s
21+
RUN, $this->url, $this->token));
22+
}
23+
}

0 commit comments

Comments
 (0)