Skip to content

Commit

Permalink
Composer internally calls the paths url so let's follow
Browse files Browse the repository at this point in the history
  • Loading branch information
ralflang committed Jan 13, 2024
1 parent 82b392d commit 939c9db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/Composer/PathRepositoryDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

class PathRepositoryDefinition implements RepositoryDefinition
{
public readonly string $path;
public readonly string $url;

public function __construct(string|Stringable $path, public readonly stdClass $repositoryOptions = new stdClass)
public function __construct(string|Stringable $url, public readonly stdClass $repositoryOptions = new stdClass)
{
// Cast to string once rather than everywhere.
$this->path = (string) $path;
$this->url = (string) $url;
}

public function getType(): string
Expand All @@ -22,15 +22,15 @@ public function getType(): string

public function getUrl(): string
{
return $this->path;
return $this->url;
}

public function dumpStdClass()
{
return (object) [
'type' => 'path',
'options' => $this->repositoryOptions,
'url' => $this->path
'url' => $this->url
];
}
}
2 changes: 1 addition & 1 deletion src/Composer/RepositoryDefinitionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RepositoryDefinitionFactory
public static function create(stdClass $input): RepositoryDefinition
{
if ($input->type == 'path') {
return new PathRepositoryDefinition($input->path, $input->options ?? new stdClass);
return new PathRepositoryDefinition($input->url, $input->options ?? new stdClass);
}
}
}
5 changes: 5 additions & 0 deletions src/Runner/InstallRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Horde\Components\Config;
use Horde\Components\RuntimeContext\GitCheckoutDirectory;
use Horde\Components\Output;
use Horde\Components\Wrapper\HordeYml;
use stdClass;

class InstallRunner
Expand Down Expand Up @@ -58,8 +59,12 @@ public function run(Config $config)
// Inject all horde apps as local sources.
$composerJson = $this->installationDirectory->getComposerJson();
foreach ($this->gitCheckoutDirectory->getHordeYmlDirs() as $hordeYmlDir) {
// Load HordeYml to get the ComponentVersion
$hordeYml = new HordeYml($hordeYmlDir);

$composerJson->getRepositoryList()->ensurePresent(new PathRepositoryDefinition($hordeYmlDir));
}
$composerJson->writeFile($this->installationDirectory->getComposerJsonPath());
//
}
}

0 comments on commit 939c9db

Please sign in to comment.