Skip to content

Could some way be available to prevent reseting styles when initiate a PhpWord instance ? #2747

Open
@warmbook

Description

@warmbook

Describe the problem

Style settings are cached in static property Style::$styles, in 'Resident Process Mode' such as Swoole, that may cause to some unexpected problems. For example, set different style values with same name in two concurrent coroutines, the latter would overwrite or use the former's value.
In my programs, I can set each different value to a unique name. But now that every style name is unique, why not set them after the Resident Process be started and use them in each coroutine latter? Set and reset same values is a waste of computer resources.
So I need some way to prevent reseting styles in PhpWord's __construct method, for example, provide a boolean static property Style::$notReset to control whether to clear Style::$styles.

Describe the expected behavior

Provide some way to prevent reseting styles when initiate a PhpWord instance. Another thorough suggestion is cache style settings in Style's instance property rather than it's static property.

Priority

  • I want to crowdfund the feature (with @algora-io) and fund a community developer.
  • I want to pay the feature and fund a maintainer for that. (Contact @Progi1984)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions