Skip to content

feat/issue core 67 modern serialization#21

Merged
TDannhauer merged 8 commits into
FRAMEWORK_6_0from
feat/issue-core-67-modern-serialization
Mar 31, 2026
Merged

feat/issue core 67 modern serialization#21
TDannhauer merged 8 commits into
FRAMEWORK_6_0from
feat/issue-core-67-modern-serialization

Conversation

@ralflang
Copy link
Copy Markdown
Member

@ralflang ralflang commented Mar 21, 2026

  • feat(activesync): add modern __serialize()/__unserialize() methods to Folder classes
  • fix(activesync): Missing property declarations to Exporter/Base

… Folder classes

See issue horde/Core#67 at url horde/Core#67

Implement the PHP 8.1 __serialize/__unserialize successor to the Serializable interface.
Keep full BC, don't drop methods or interface right now.

Needs discussion, do not merge without approval of @amulet1
@amulet1
Copy link
Copy Markdown
Member

amulet1 commented Mar 22, 2026

As I mentioned earlier, I had commits already in my fork, just did not have time to submit a PR. If you want to implement your own fixes, I will refrain from posting my commits:

git log

commit 2c110a1 (HEAD -> FRAMEWORK_6_0)
Author: Dmitry Petrov dpetrov67@gmail.com
Date: Mon Mar 16 21:29:59 2026 -0400

refactor(ActiveSync): modernize RI folder serialization

Add __serialize()/__unserialize() magic methods.

The legacy serialize() and unserialize() methods are retained for backward
compatibility with existing "C" format serialized data in persistent storage,
and now delegate to the magic methods to eliminate code duplication.

commit 6b7c742
Author: Dmitry Petrov dpetrov67@gmail.com
Date: Mon Mar 16 19:33:48 2026 -0400

refactor(ActiveSync): modernize Imap folder serialization

Add __serialize()/__unserialize() magic methods.
Add missing null guards for lsd and sd keys in __unserialize()
Simplify empty() checks to ?? where 0 and absent are equivalent sentinel values (uidnext, modseq, total_messages)

The legacy serialize() and unserialize() methods are retained for backward
compatibility with existing "C" format serialized data in persistent storage,
and now delegate to the magic methods to eliminate code duplication.

commit 6397631
Author: Dmitry Petrov dpetrov67@gmail.com
Date: Mon Mar 16 19:28:44 2026 -0400

refactor(ActiveSync): modernize Collection folder serialization

Add __serialize()/__unserialize() magic methods.

The legacy serialize() and unserialize() methods are retained for backward
compatibility with existing "C" format serialized data in persistent storage,
and now delegate to the magic methods to eliminate code duplication.

Comment thread lib/Horde/ActiveSync/Folder/Imap.php Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Time to remove ;)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right!

$decoded = @unserialize($data);
if (!is_array($decoded) || empty($decoded['v']) || $decoded['v'] != 1) {
throw new Horde_ActiveSync_Exception_StaleState('Cache version change');
}
Copy link
Copy Markdown
Member

@amulet1 amulet1 Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version 1 older data is not going to work (__unserialize will throw an exception) unless you add
$decoded['v'] = self::VERSION;

This was already in my version.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ralflang
Copy link
Copy Markdown
Member Author

I'd like to use your commits but I can't view them.
However I value the feedback and will include it.

@ralflang ralflang requested a review from TDannhauer March 31, 2026 06:05
Copy link
Copy Markdown
Contributor

@TDannhauer TDannhauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested in my local installation

@TDannhauer TDannhauer merged commit d0415a7 into FRAMEWORK_6_0 Mar 31, 2026
0 of 8 checks passed
ralflang added a commit that referenced this pull request Apr 8, 2026
Release version 3.0.0-beta2

fix: Replace deprecated call with explicit factory call.
Refactor unserialize calls to use _unserializeState
Add VERSION_SIXTEENONE constant for version 16.1
Merge pull request #22 from horde/feat/EAS_version_handling_per_user_or_device
refactor: Remove the extra logic - this is now handled in Horde_Core_ActiveSync_Driver->getUser() directly.
refactor: See also horde/Core#75 - Keep the horde specific stuff in core and apps
chore(hordeyml): Add keywords for packagist
style: php-cs-fixer
fix: #23 PHP 8.4 deprecation of implicit nullable type
Resolve user for device handling in ActiveSync
Merge pull request #21 from horde/feat/issue-core-67-modern-serialization
chore(hordeyml): Update autoloader rules
test: Modernize test suite (2 remaining test failures)
fix: serialization version upgrade
test: cover serialization issues
fix: Same version bug mentioned by @amulet1, probably fixed in his commits I cannot read.
fix: Version bug mentioned by @amulet1 in review
fix(activesync): Missing property declarations to Exporter/Base
feat(activesync): add modern __serialize()/__unserialize() methods to Folder classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants