pub struct UpdateSession {Show 17 fields
pub arena: Vec<Package>,
pub root: RootPackage,
pub fixed_root: usize,
pub fixed_root_alias: Option<usize>,
pub platform: Vec<usize>,
pub locked: Option<Vec<usize>>,
pub set: RepositorySet,
pub request: Request,
pub config: MergedConfig,
pub dev_mode: bool,
pub prefer_stable: bool,
pub prefer_lowest: bool,
pub php_version: String,
pub policy_config: PolicyConfig,
pub ini_files: Vec<String>,
pub loaded_extensions: BTreeSet<String>,
pub installer_dev_mode: bool,
}Expand description
Everything Installer::doUpdate has at hand right before createPool.
Fields§
§arena: Vec<Package>§root: RootPackage§fixed_root: usizeArena indices of the fixed root (requires emptied) and of its alias.
fixed_root_alias: Option<usize>§platform: Vec<usize>§locked: Option<Vec<usize>>§set: RepositorySet§request: Request§config: MergedConfig§dev_mode: bool§prefer_stable: bool--prefer-stable / --prefer-lowest from the command line.
prefer_lowest: bool§php_version: StringPHP_MAJOR.MINOR.RELEASE of the probed PHP (ext-* rule of the
VersionSelector).
policy_config: PolicyConfigThe pool blocking policies (createPolicyConfig).
ini_files: Vec<String>XdebugHandler::getAllIniFiles() of the probed PHP (extension hint
of an unsolvable set).
loaded_extensions: BTreeSet<String>ext-* loaded by the probed PHP, before config.platform.
installer_dev_mode: boolInstaller::$devMode (--no-dev / --update-no-dev clear it):
only the --no-dev warning of an unsolvable set reads it.
Implementations§
Source§impl UpdateSession
impl UpdateSession
pub fn prepare( project_dir: &Path, composer_home: Option<&Path>, dev_mode: bool, ) -> Result<UpdateSession, SessionError>
Sourcepub fn prepare_with(
project_dir: &Path,
composer_home: Option<&Path>,
dev_mode: bool,
http: Option<HttpTransports>,
) -> Result<UpdateSession, SessionError>
pub fn prepare_with( project_dir: &Path, composer_home: Option<&Path>, dev_mode: bool, http: Option<HttpTransports>, ) -> Result<UpdateSession, SessionError>
Like prepare, with a network transport for https:// repositories.
Sourcepub fn prepare_full(
project_dir: &Path,
composer_home: Option<&Path>,
dev_mode: bool,
http: Option<HttpTransports>,
cache_repo_dir: Option<&Path>,
) -> Result<UpdateSession, SessionError>
pub fn prepare_full( project_dir: &Path, composer_home: Option<&Path>, dev_mode: bool, http: Option<HttpTransports>, cache_repo_dir: Option<&Path>, ) -> Result<UpdateSession, SessionError>
Like prepare_with, with Composer’s cache-repo-dir directory for
the metadata cache (read and written in Composer’s format).
Sourcepub fn prepare_update(
project_dir: &Path,
composer_home: Option<&Path>,
dev_mode: bool,
http: Option<HttpTransports>,
cache_repo_dir: Option<&Path>,
options: &UpdateOptions,
) -> Result<UpdateSession, SessionError>
pub fn prepare_update( project_dir: &Path, composer_home: Option<&Path>, dev_mode: bool, http: Option<HttpTransports>, cache_repo_dir: Option<&Path>, options: &UpdateOptions, ) -> Result<UpdateSession, SessionError>
Like prepare_full, with the allow list of a partial update
(composer update a/b).
pub fn create_pool(&mut self) -> Result<Pool, SessionError>
Sourcepub fn policy(&self) -> DefaultPolicy
pub fn policy(&self) -> DefaultPolicy
Installer::createPolicy(true, ...) without --minimal-changes.
Sourcepub fn extract_dev_packages(
&mut self,
transaction: &mut LockTransaction,
policy: &mut DefaultPolicy,
filter: &PlatformRequirementFilter,
) -> Result<(), SessionError>
pub fn extract_dev_packages( &mut self, transaction: &mut LockTransaction, policy: &mut DefaultPolicy, filter: &PlatformRequirementFilter, ) -> Result<(), SessionError>
Installer::extractDevPackages: second solve without the
require-dev, on only the packages kept by the first, to classify
packages / packages-dev.
Sourcepub fn lock_json(
&self,
transaction: &LockTransaction,
manifest_text: &str,
) -> Result<Value, SessionError>
pub fn lock_json( &self, transaction: &LockTransaction, manifest_text: &str, ) -> Result<Value, SessionError>
Locker::setLockData(...): the lock JSON to write.
Sourcepub fn update(
&mut self,
manifest_text: &str,
filter: &PlatformRequirementFilter,
) -> Result<(Value, SolveReport), SessionError>
pub fn update( &mut self, manifest_text: &str, filter: &PlatformRequirementFilter, ) -> Result<(Value, SolveReport), SessionError>
Full composer update --no-install: solve, dev package extraction,
lock data. Returns the lock JSON and the report of the first solve.
Sourcepub fn pretty_problems(
&mut self,
pool: &Pool,
problems: &[SolvedProblem],
is_dev_extraction: bool,
) -> String
pub fn pretty_problems( &mut self, pool: &Pool, problems: &[SolvedProblem], is_dev_extraction: bool, ) -> String
SolverProblemsException::getPrettyString for problems found on
pool with this session’s request.
Sourcepub fn find_packages_for_require(
&mut self,
name: &str,
ignore_stability: bool,
) -> Result<Vec<usize>, SessionError>
pub fn find_packages_for_require( &mut self, name: &str, ignore_stability: bool, ) -> Result<Vec<usize>, SessionError>
createPool with the PoolOptimizer (unless COMPOSER_POOL_OPTIMIZER=0),
like Installer::doUpdate.
RepositorySet::findPackages($name) on the CompositeRepository of
require (platform then project repositories, all merged) with a
RepositorySet reduced to minimum-stability (no flags);
ignore_stability means ALLOW_UNACCEPTABLE_STABILITIES.
pub fn create_optimized_pool( &mut self, policy: &mut DefaultPolicy, ) -> Result<Pool, SessionError>
Sourcepub fn create_filtered_pool(&mut self) -> Result<Pool, SessionError>
pub fn create_filtered_pool(&mut self) -> Result<Pool, SessionError>
buildPool up to the policy filters (advisories, lists), without the
optimizer; their warnings go into pool.warnings.
Sourcepub fn solve(
&self,
pool: &Pool,
policy: &mut DefaultPolicy,
filter: &PlatformRequirementFilter,
) -> Result<SolveReport, SolveError>
pub fn solve( &self, pool: &Pool, policy: &mut DefaultPolicy, filter: &PlatformRequirementFilter, ) -> Result<SolveReport, SolveError>
Solver::solve on this pool; returns the transaction and the
decisions (pool literals, in order) with the rule set size.