php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #70062 setMulti list of expirations
Submitted: 2015-07-13 11:36 UTC Modified: 2021-06-09 11:54 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: guadenine at gmail dot com Assigned: cmb (profile)
Status: Closed Package: memcached (PECL)
PHP Version: 5.6.11 OS: CentOS 6.5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: guadenine at gmail dot com
New email:
PHP Version: OS:

 

 [2015-07-13 11:36 UTC] guadenine at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/memcached.setmulti
---

Looking for the ability to set custom expiration for every item in $items.

At the moment, you can pass multiple items but only a single expiration for all of them.

Here is how it currently works:

$items = array(
    'key1' => 'value1',
    'key2' => 'value2'
);

Memcached::setMulti($items, 3600); // Sets 1 hour for all items, no customization

I want to be able to provide an array of expiration times that each map to the expiration of the item's position.

Here is how it would work:

$items = array(
    'key1' => 'value1 long expiration',
    'key2' => 'value2 short expiration'
);

$expirations = array(
    86400,
    300
);

Memcached::setMulti($items, $expirations);

This way, you can map expiration to every item in $items, offering much more flexibility.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-09 11:54 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-06-09 11:54 UTC] cmb@php.net
The memcached bug tracker is now on Github[1].  If this is still
an issue with the current memcached version, please report there.

[1] <https://github.com/php-memcached-dev/php-memcached/issues>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 02:01:29 2024 UTC