pub struct UpdateSession {Show 18 fields
pub flex: Option<FlexSession>,
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,
}Fields§
§flex: Option<FlexSession>None: no Flex filter at PRE_POOL_CREATE.
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.
With Flex active, COMPOSER_PREFER_DEV_OVER_PRERELEASE is what Flex
sets before Composer builds the policy.
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.
Auto Trait Implementations§
impl !RefUnwindSafe for UpdateSession
impl !Send for UpdateSession
impl !Sync for UpdateSession
impl !UnwindSafe for UpdateSession
impl Freeze for UpdateSession
impl Unpin for UpdateSession
impl UnsafeUnpin for UpdateSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more