Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New functionalities for Cache & MessageQueue #90

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

awohsen
Copy link
Contributor

@awohsen awohsen commented Jul 18, 2023

There are descriptions in commit messages, fixes #61.

If you think there is a better approach to these, please feel free to modify:

array_is_list in ZanzaraCache.php:79 (changes php version requirement) :

private function resolveKeys($dataType, $id, $keys): array
{
    if (array_is_list($keys)) {
        return array_map(fn($key) => $this->resolveKey($dataType, $id, $key), $keys);
    }

    return array_combine(
        array_map(fn($key) => $this->resolveKey($dataType, $id, $key), array_keys($keys)),
        array_values($keys)
    );
}

using explode in ZanzaraCache.php:91 :

public function resolveGetItems($result)
{
    return resolve(array_combine(
        array_map(
            function ($key) {
                $ex = explode('@', $key, 3);
                // there is no @$id in global data
                if ($ex[0] === 'GLOBAL_DATA') {
                    return $ex[1];
                }

                return $ex[2];
            },
            array_keys($result)),
        array_values($result)
    ));
}

There was no need for php-http/discovery, plus it was adding another dependency(Nyholm/psr7).
since we are using array_is_list() in resolveKeys(), we should switch to php8.1
@awohsen awohsen changed the title Get, set and delete multiple keys in cache and etc New functionalities for Cache & MessageQueue Nov 8, 2023
@awohsen
Copy link
Contributor Author

awohsen commented Nov 8, 2023

Support for parameterized onCbQueryData listener without breaking changes.

fixes #66

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.

how can i get some data from the session
1 participant