Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Storage format for serialized data #619

Closed
borekb opened this issue Jan 11, 2016 · 2 comments
Closed

Storage format for serialized data #619

borekb opened this issue Jan 11, 2016 · 2 comments
Assignees
Labels
feature New feature. See "improvement" for updates of existing functionality. major Use only for bugs to mark the big ones noteworthy Significant issue or PR, to be highlighted in release notes scope: core Core VersionPress functionality like tracking actions, creating Git commits, etc.
Milestone

Comments

@borekb
Copy link
Member

borekb commented Jan 11, 2016

Currently, we store serialized data as they are, i.e., serialized. For example, this is how we store the active_plugins option:

[active_plugins]
option_value = "a:1:{i:0;s:29:\"versionpress/versionpress.php\";}"
autoload = "yes"

This was simple to implement but degrades the data inside serialized arrays / objects to something that cannot easily be ignored (#607), diffed, will cause merge conflicts, etc. WordPress, and especially some plugins, heavily use serialized data so we really need to support this better.

One initial idea is to convert the serialized data into some INI subset that would be hierarchical and friendly to diffing. For example, the above could be stored as something like:

[active_plugins]
option_value = <<serialized>>
option_value.0 = versionpress/versionpress.php
autoload = "yes"

If the first index contained an object with properties a and b, the keys would be something like:

option_value.0.a = ...
option_value.0.b = ...

Etc. This is pseudocode, I haven't put much thought into the format yet.

@borekb borekb added feature New feature. See "improvement" for updates of existing functionality. major Use only for bugs to mark the big ones scope: core Core VersionPress functionality like tracking actions, creating Git commits, etc. noteworthy Significant issue or PR, to be highlighted in release notes labels Jan 11, 2016
@borekb borekb added this to the 4.0 milestone Jan 11, 2016
@borekb
Copy link
Member Author

borekb commented Mar 9, 2016

Moving this to 3.0 where it feels more at home. Let's see if it can make it to the release as it's quite late in the release cycle.. but I have no doubts @JanVoracek :)

@borekb borekb modified the milestones: 4.0, 3.0 Mar 9, 2016
@JanVoracek JanVoracek self-assigned this Mar 11, 2016
JanVoracek added a commit that referenced this issue Mar 21, 2016
JanVoracek added a commit that referenced this issue Mar 21, 2016
… saving serialized data to just string operations.
JanVoracek added a commit that referenced this issue Mar 21, 2016
JanVoracek added a commit that referenced this issue Mar 22, 2016
JanVoracek added a commit that referenced this issue Mar 22, 2016
JanVoracek added a commit that referenced this issue Mar 22, 2016
JanVoracek added a commit that referenced this issue Mar 24, 2016
JanVoracek added a commit that referenced this issue Mar 24, 2016
JanVoracek added a commit that referenced this issue Mar 24, 2016
…d '*pointer*' because of possible conflicts with class names
@JanVoracek
Copy link
Member

Reopening. DB rows containing string false are missing after re-saving entity.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature. See "improvement" for updates of existing functionality. major Use only for bugs to mark the big ones noteworthy Significant issue or PR, to be highlighted in release notes scope: core Core VersionPress functionality like tracking actions, creating Git commits, etc.
Projects
None yet
Development

No branches or pull requests

2 participants