Skip to main content

UpdateSession

Struct UpdateSession 

Source
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: usize

Arena 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: String

PHP_MAJOR.MINOR.RELEASE of the probed PHP (ext-* rule of the VersionSelector).

§policy_config: PolicyConfig

The 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: bool

Installer::$devMode (--no-dev / --update-no-dev clear it): only the --no-dev warning of an unsolvable set reads it.

Implementations§

Source§

impl UpdateSession

Source

pub fn prepare( project_dir: &Path, composer_home: Option<&Path>, dev_mode: bool, ) -> Result<UpdateSession, SessionError>

Source

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.

Source

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).

Source

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).

Source

pub fn create_pool(&mut self) -> Result<Pool, SessionError>

Source

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.

Source

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.

Source

pub fn lock_json( &self, transaction: &LockTransaction, manifest_text: &str, ) -> Result<Value, SessionError>

Locker::setLockData(...): the lock JSON to write.

Source

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.

Source

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.

Source

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.

Source

pub fn create_optimized_pool( &mut self, policy: &mut DefaultPolicy, ) -> Result<Pool, SessionError>

Source

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.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more