Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Improved update operations #3

Merged
merged 1 commit into from
Aug 12, 2016

Conversation

weierophinney
Copy link
Member

Evidently, the package is available via the operation instance composed in the event, and both the operation and the event are immutable. As such, this requires a different approach to updating:

  • We need to grab the operation from the provided PackageEvent
  • We need to retrieve the initial and target packages from the operation
  • We need to build a new package event for the uninstall operation that includes a new UninstallOperation instance composing the initial package.
  • We need to build a new package event for the install operation that includes a new InstallOperation instance composing the target package.

This patch adds a method for creating a new PackageEvent based on the original, but containing the new operation provided, and updates the onPostPackageUpdate() method to call on this method, providing an appropriate operation composing the appropriate package instance.

The results have been integration tested in an existing application, and I have verified that the assets were updated.

Evidently, the package is available via the operation instance composed
in the event, and both the operation and the event are immutable. As
such, this requires a different approach to updating:

- We need to grab the operation from the provided PackageEvent
- We need to retrieve the initial and target packages from the operation
- We need to build a new package event for the uninstall operation that
  includes a new UninstallOperation instance composing the initial
  package.
- We need to build a new package event for the install operation that
  includes a new InstallOperation instance composing the target
  package.

This patch adds a method for creating a new PackageEvent based on the
original, but containing the new operation provided, and updates the
`onPostPackageUpdate()` method to call on this method, providing an
appropriate operation composing the appropriate package instance.

The results have been integration tested in an existing application, and
I have verified that the assets were updated.
@weierophinney weierophinney added this to the 1.1.1 milestone Aug 12, 2016
@weierophinney weierophinney self-assigned this Aug 12, 2016
@weierophinney weierophinney merged commit 0f65cbd into zfcampus:master Aug 12, 2016
weierophinney added a commit that referenced this pull request Aug 12, 2016
weierophinney added a commit that referenced this pull request Aug 12, 2016
weierophinney added a commit that referenced this pull request Aug 12, 2016
Forward port #3

Conflicts:
	CHANGELOG.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant