Added API for an install path in installable repository #2424
Conversation
throw new \InvalidArgumentException('The package "'.$package.'" is not in the repository.'); | ||
} | ||
|
||
$this->packageData[$package->getUniqueName()] = $extra; |
stof
Nov 14, 2013
Contributor
is it intended to overwrite the install path here ? As there is a separate interface to set it, people might not expect it to be stored as package data
is it intended to overwrite the install path here ? As there is a separate interface to set it, people might not expect it to be stored as package data
* | ||
* @author Martin Hasoň <martin.hason@gmail.com> | ||
*/ | ||
interface DataRepositoryInterface |
stof
Nov 14, 2013
Contributor
The methods in this interface are only used internally in your implementation of InstalledFilesystemRepository. What is the use case for a new interface ?
The methods in this interface are only used internally in your implementation of InstalledFilesystemRepository. What is the use case for a new interface ?
Just a note that #2773 might need to be updated after merging this. |
I'll get that done. |
At which place to find the |
This is the key part of how to access the install path for a package instance, I am not sure at which level you are working, but I don't think they persist to the installed.json in this PR.
|
I'm consuming |
This PR is updated. |
$path = $this->getInstallPath($package); | ||
$data[] = array( | ||
'package' => $dumper->dump($package), | ||
'install-path' => null !== $path ? $this->fs->findShortestPath($fileDir, $path, true) : null, |
gossi
May 7, 2015
This would break the functionality of tools that rely on the current structure of the dump. It would be better to put the install-path into the $package
and dump it the way it currently is.
// some pseudo-code:
foreach ($this->getCanonicalPackages() as $package) {
$path = $this->getInstallPath($package);
$package['installPath'] = null !== $path ? $this->fs->findShortestPath($fileDir, $path, true) : null;
$data[] = $dumper->dump($package);
}
And then let the dumper transform installPath
into install-path
.
This would break the functionality of tools that rely on the current structure of the dump. It would be better to put the install-path into the $package
and dump it the way it currently is.
// some pseudo-code:
foreach ($this->getCanonicalPackages() as $package) {
$path = $this->getInstallPath($package);
$package['installPath'] = null !== $path ? $this->fs->findShortestPath($fileDir, $path, true) : null;
$data[] = $dumper->dump($package);
}
And then let the dumper transform installPath
into install-path
.
…-installed * github-composer/2.0: (48 commits) Fix missing use/undefined var Split up steps on VCS downloaders to allow doing network operations before touching the filesystem on GitDownloader, fixes composer#7903 Fix use statement Deduplicate findHeaderValue code Add install-path to the installed.json for every package, fixes composer#2174, closes composer#2424 Remove unnecessary config from phpstan Make sure the directory exists and will not block installation later when downloading Avoid wiping the whole target package if download of the new one fails, refs composer#7929 Only empty dir before actually installing packages, fixes composer#7929 Improve output when installing packages Show best possible version in diagnose command Remove extra arg Allow path repos to point to their own source dir as install target, resulting in noop, fixes composer#8254 Fix use of decodeJson Fix update mirrors to also update transport-options, fixes composer#7672 Fix updating or URLs to include dist type and shasum, fixes composer#8216 Fix origin computation Improve handling of non-standard ports for GitLab and GitHub installs, fixes composer#8173 Load packages from the lock file for check-platform-reqs if no dependencies have been installed yet, fixes composer#8058 Fix error_handler return type declaration ...
Fixes #2174