| Age | Commit message (Collapse) | Author |
|
PHP shares a single PlatformRepository by reference across the RepositorySet,
createRequest, VersionSelector, and (in show) the installed repository. The
port worked with owned values / &mut, so it could not share: create_repository_set
silently dropped the platform repo from the pool (PlatformRepository is not
Clone), show rebuilt a fresh PlatformRepository per use, and the package
discovery / show version selectors were stubbed because VersionSelector wanted
an owned RepositorySet.
Thread the existing PlatformRepositoryHandle (Rc<RefCell<PlatformRepository>>)
through installer.rs and show, restoring the RootPackageRepository + platform
repo registration and implementing same_repository via RepositoryInterfaceHandle
ptr_eq. Hold package-discovery repos as a shared RepositoryInterfaceHandle, and
share RepositorySet as Rc<RefCell<RepositorySet>> in the set caches and
VersionSelector (which only reads it), unblocking both stubbed selector sites
and dropping show's placeholder set.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace TODO(phase-b) placeholders (todo!() and commented-out code)
with real implementations:
- Share JsonFile via Rc<RefCell<JsonFile>> so JsonConfigSource and the
owning command can hold the same instance (base_config_command,
config_command, repository_command, require_command, create_project,
remove_command, factory)
- Change InstallerInterface methods (is_installed, download, prepare,
cleanup, get_install_path) to &mut self so initialize_vendor_dir can
run, propagated to all installer implementations
- Pass io/config/filesystem/process by clone instead of moving or
stubbing (auth_helper, svn_driver, curl_downloader, library_installer)
- Make TransportException Clone and store it by value in VcsRepository
- Clone operations in Transaction sort, root_aliases/temporary_constraints
in RepositorySet::create_pool, and share CompletePackage via handle in
PlatformRepository
- Wire up set_option, set_requires/set_dev_requires, installation manager
setters, BumpCommand::set_composer, and clean_backups/set_local_phar
|
|
The execute call was stubbed out during Phase B, so getVersion never
ran git --version and always reported no version. Wire it to
ProcessExecutor::execute_args.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Reconcile the VcsDriverInterface trait with the concrete drivers so every
driver implements it as in PHP, where each driver extends VcsDriver.
- Make cache-mutating getters take &mut self in the trait, matching the
inherent methods' lazy-cache semantics; update vcs_repository consumers.
- Change supports() to take Rc<RefCell<Config>> and return Result<bool>,
completing GitDriver::supports deep ls-remote and its config wiring.
- Add base get_composer_information to Git/Hg/Fossil/Perforce and an
impl VcsDriverInterface block to every driver, delegating to inherent
methods and absorbing type differences in the impl.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Add file_get_contents5 shim supporting use_include_path/context/offset/
length, and wire it into BinaryInstaller to read the first 500 bytes of
the bin file, replacing the offset-less stub and its phase-b TODO.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Composer does not use its own deprecated APIs internally, so drop their
Rust ports: whole deprecated classes, methods, constants, and field.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the phase-b TODOs in DownloadManager::download with the actual
package.set_installation_source call, enabled by the interior mutability
of PackageInterfaceHandle. Drop the stale recursive-closure comments now
that the loop expresses the PHP $download($retry) flow.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Resolve the phase-b TODO by passing composer.get_package() to
Locker::get_missing_requirement_info. The package is an Rc-backed
handle and the locker is borrowed from a separate Rc, so there is no
borrow conflict.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Resolve the two phase-b borrow-conflict TODOs by cloning each Composer
subsystem handle out before borrowing, so the missing-dependency loop and
AutoloadGenerator::dump can hold their independent RefCell borrows.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the phase-b todo!() with the real ArchiveManager.archive
invocation by taking the manager via mutable borrow (borrow_mut for the
composer-owned RefCell, &mut for the locally created one). Also drop the
stale get_io clone_box TODOs in archive and search commands, reusing the
already-fetched io handle in search.
|
|
The OnceLock already emulates PHP's function-local `static $p4Executable;`
(compute once, cache for the process lifetime, shared across instances).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Response only ever reads the url out of the request array, so accept it
as a String directly. With url always present the 'url key missing'
LogicException can no longer fire, so Response::new and CurlResponse::new
return Self instead of a double Result. Also drops the unused
from_php_mixed/to_php_mixed stubs and the request_to_map helper.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
RecursiveDirectoryIterator construction can throw UnexpectedValueException;
the shim now returns a Result so remove_directory_php can re-create the
iterator once after clearstatcache()/usleep, mirroring Composer's retry
for the spurious failures in composer/composer#4009.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implement the self-recursion in filterRequiredPackages so that
packages required transitively are collected, matching the PHP
source. BasePackageHandle is a type alias for PackageInterfaceHandle,
so no cast is needed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implement the previously stubbed phase-b TODO so getSecurityAdvisories
skips advisories whose affected_versions do not match the requested
package constraint. Share the package VersionParser with
PartialSecurityAdvisory::create across both PackageRepository and
ComposerRepository instead of a separate semver parser instance.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The repository type check was an internal invariant, not a recoverable
error condition. Replace the Result-returning validation with an
assert!, matching Composer's design where add_repository throws only on
a programming error, and drop the now-unneeded error handling at call
sites.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Resolve the phase-b TODO by adding an as_writable_repository_interface_mut
downcast helper on RepositoryInterface, mirroring PHP's instanceof
WritableRepositoryInterface check, and propagate inner errors.
|
|
Convert InputInterface and OutputInterface parameters from &dyn/&mut dyn
references to Rc<RefCell<dyn ...>> shared ownership across the command,
console, and IO layers, matching the Phase C shared-ownership approach
already used for IOInterface.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Mirror PHP's "new ArrayLoader($parser)" by passing the existing parser
instead of None. VersionParser is stateless, so behavior is unchanged;
this drops the phase-b TODO.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
|
|
The Phase B stub discarded the decoded PhpMixed and handed an empty
IndexMap to LoaderInterface::load, so nothing was actually loaded.
Unbox PhpMixed::Array into the map; mirror PHP's array $config type
juggling by raising a TypeError for non-array decode results.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Move __toString ports to std::fmt::Display: convert Link's inherent
to_string() and make OperationInterface require Display instead of a
to_string() method, with each operation implementing Display.
Also fix the operation __toString output to use show(false), matching
SolverOperation::__toString() (was show(true)).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Link is an immutable value object and is never compared by reference
identity, so cloning its fields is faithful to PHP. The shared-ownership
TODO does not apply.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Resolve the phase-b TODO that left the supported-link-types loop as dead
code (links were always an empty Vec), so requires/conflicts/provides/
replaces/require-dev are dumped again via
PackageInterface::get_links_for_type, matching the PHP magic-call loop.
Every Link in production is constructed with a pretty constraint (all
ArrayLoader/AliasPackage/PlatformRepository/InstalledRepository sites
pass one), so make Link::pretty_constraint a required String instead of
Option<String>. get_pretty_constraint() now returns &str directly rather
than anyhow::Result<&str>, dropping the unreachable
UnexpectedValueException guard, and all call sites are updated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
PHP BasePackage::equals uses === (reference identity), unwrapping
AliasPackage on both sides first. A plain &self / &dyn PackageInterface
cannot express this, so implement it on the shared handle where the
Rc-based identity infrastructure (as_alias, get_alias_of, ptr_eq)
already lives, and drop the unimplementable trait stub.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Migrate ArchivableFilesFinder off Symfony's SplFileInfo onto Path/PathBuf,
resolving the phar_archiver TODO(phase-b) that required a .map() adapter to
bridge SplFileInfo -> PathBuf.
- ArchivableFilesFinder now yields PathBuf; accept() takes &Path; the exclude
closure receives &Path and uses Path::canonicalize / is_symlink. The
SplFileInfo -> PathBuf conversion happens once at the symfony get_iterator
boundary (get_iterator stays SplFileInfo for cache.rs).
- symfony Finder::filter callback changed to FnMut(&Path) (sole caller is the
finder).
- PharArchiver passes the finder straight into ArchivableFilesFilter, mirroring
PHP's new ArchivableFilesFilter($files).
- ZipArchiver consumes PathBuf items, computing the relative path via
strip_prefix(sources) in place of SplFileInfo::getRelativePathname.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
- Add Display for SplFileInfo (PHP (string) cast -> getPathname) and use it
in clean_backups instead of a debug-format placeholder.
- Generalize iterator_to_array's signature to preserve the element type so
get_last_backup_version collects real SplFileInfo and returns the last
basename, instead of mapping every entry to PhpMixed::Null.
- Drop the stale builder-restructure TODO in get_old_installation_finder.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Add a Finder::filter(Box<dyn FnMut(&SplFileInfo) -> bool>) stub method and
route the exclude closure through it, matching PHP's ->in()->filter() chain.
FnMut faithfully represents PHP's stateful \Closure.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
The VcsDownloaderBase::clean_changes stub returned Ok(None), silently
swallowing the abort that PHP's parent::cleanChanges() raises when the
working copy has uncommitted changes. Drop the stub and give Git/Svn a
private fail_on_local_changes helper that performs the getLocalChanges
check and throws, matching the default VcsDownloader::clean_changes().
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
get_extension_problems
PHP's getExtensionProblems receives getReasons() directly; match that
instead of materializing an intermediate Vec<Vec<...>> with Rc clones.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Resolve the phase-b stub by threading repository set, request and a
mutable pool into Rule::getPrettyString, mirroring PHP's default empty
installedMap/learnedPool arguments.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
mark_package_for_removal's LogicException can only fire on a bug since
both callers pre-filter irremovable packages, so port it as an assert!
rather than a recoverable Result. This unwinds the Result chain through
optimize and drops the pool_builder match that silently returned the
unoptimized pool on error, matching PHP's fatal-error propagation.
|
|
* Config::merge called array_merge_recursive where PHP uses plain
array_merge (string-key overwrite); switch those six sites to
array_merge.
* provides/replaces merges that may carry an AliasPackage's
self.version numeric keys ("0","1",...) were collapsing under naive
chain/insert/or_insert; route them through a new array_merge_map().
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Mirror PHP's array_merge semantics in AliasPackage so self.version
provide/replace/conflict links are appended under numeric keys ("0",
"1", ...) instead of collapsing onto the target-name key. This keeps
both the original and alias-version links and makes Pool::match's
contains_key("0") check (= PHP isset($x[0])) work as intended.
replace_self_version_dependencies now takes and returns
IndexMap<String, Link>, dropping the lossy re-key-by-target in the
AliasPackage/RootAliasPackage constructors.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Resolve TODO(phase-b) in LocalRepoTransaction.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Resolve TODO(phase-b): mirror PHP's parent::__construct(true, $styles)
by extending the base OutputFormatter::new to accept a style map.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
LicensesCommand now renders the root package version via
get_full_pretty_version, matching PHP getFullPrettyVersion, and holds
the root package handle directly instead of snapshotting fields. Also
align update/mark-alias operations on get_full_pretty_version and remove
the now-stale phase-b TODO markers in status and licenses commands.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
initialize_repos now appends the local repository and remote
repositories from the repository manager after the root package repo,
matching PHP HomeCommand::initializeRepos.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Register the selected binary as a Callable::String listener for the
__exec_command event, matching PHP ExecCommand's addListener call.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Change RepositoryInterface and WritableRepositoryInterface read methods
(find_package, find_packages, get_packages, load_packages, search,
get_providers, get_canonical_packages) to take &mut self and return
anyhow::Result, so lazy-loading repositories such as ComposerRepository
can perform fallible I/O and mutate internal state on access. Update all
implementors and call sites to propagate the Result and pass mutable
references.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Forward execute() to BaseDependencyCommand::do_execute, mirroring the
PHP commands that delegate to parent::doExecute (inverted=true for
prohibits). Add the missing BaseDependencyCommand impl on DependsCommand.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Composer\Autoload\ClassMapGenerator has been deprecated since Composer
2.4.0 and is no longer referenced by Composer itself, which uses the
composer/class-map-generator package directly. Remove its dump/createMap
port (and the unwired scanned_files TODO), keeping only the type with a
#[deprecated] attribute and a TODO(plugin) note so it can be implemented
later for plugins that may still rely on it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the todo!() placeholder in PartialSecurityAdvisory::create with
a real conversion of the PhpMixed sources list into
Vec<IndexMap<String, String>>, so the full advisory path no longer
panics.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Change json_encode/json_encode_ex and JsonFile::encode/encode_with_options
to take a generic serde::Serialize value instead of &PhpMixed, implement
Serialize for PhpMixed/ArrayObject, and drop the PhpMixed::String wrapping
at JsonManipulator call sites in favor of passing raw values.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the i64 bitmask + encode_with_indent split with a JsonEncodeOptions
struct (Default = JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE,
default indent). encode/write each get a default form plus an explicit
encode_with_options/write_with_options variant, mirroring PHP's optional
$options argument. write_with_options always encodes with self.indent, matching
PHP write().
Also reconcile call sites with the PHP sources: most ported sites passed 0 where
Composer omits the argument (= default flags), so JsonManipulator/ShowCommand and
JsonConfigSource now use the default options; only ComposerRepository and Locker
genuinely pass 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the Phase B stub that discarded ParsingException details with a
dedicated ParsingExceptionDetails struct (text/token/line/loc/expected),
modeling the PHP string|int token union as a ParsingExceptionToken enum.
Wire JsonFile::validate_syntax to forward the source details and let
Application read the error line from the typed accessor.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
OperationInterface::clone_box (a todo!() trait-object clone stub) is
removed in favor of Rc<dyn OperationInterface> shared ownership. All its
methods are &self, so operations are immutable value objects that Rc can
share; pushing the same operation into multiple lists (installer's
install/uninstall splits) becomes a cheap Rc clone instead of clone_box.
Box<dyn OperationInterface> is replaced with Rc<dyn ...> across
Transaction (and its Lock/LocalRepo wrappers), Installer, PackageEvent,
InstallationManager and EventDispatcher; Box::new operation constructions
become Rc::new.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PlatformRequirementFilterInterface::clone_box (a todo!() trait-object
clone stub) is removed in favor of Rc<dyn ...> shared ownership, matching
PHP's by-reference sharing of the single filter object. Box<dyn ...> is
replaced with Rc<dyn ...> across the factory, Solver/RuleSetGenerator,
VersionSelector, AutoloadGenerator, Installer and the command layer
(BaseCommand/PackageDiscoveryTrait and their impls); clone_box call
sites become Rc clones.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PolicyInterface::clone_box (a todo!() trait-object clone stub) is removed
in favor of Rc<dyn PolicyInterface> shared ownership, matching PHP's
by-reference sharing of the single $policy object across Solver,
RuleSetGenerator and PoolOptimizer. With PoolOptimizer::new now taking an
Rc, Installer::create_pool_optimizer is implemented faithfully
(return new PoolOptimizer($policy)); create_policy returns the shared Rc.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Add as_binary_presence_interface and as_plugin_installer_mut to
InstallerInterface following the downloader marker-trait downcast
pattern, so InstallationManager can model the PHP instanceof checks in
ensureBinariesPresence and disablePlugins. Make BinaryPresenceInterface
take &mut self, resolving LibraryInstaller's stubbed trait impl.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
PHP's viewDiff returns void but throws RuntimeException when git diff
fails. Model it as Result<()> and propagate via ? at the single caller
instead of panicking.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|