Jump to main content Jump to doc navigation

xPDOCacheManager::replace

Заменяет пару ключ-значение в поставщике кэша.

Синтаксис

API Docs: http://api.modxcms.com/xpdo/cache/xPDOCacheManager.html#replace

boolean replace (string $key, mixed &$var, [integer $lifetime = 0], [array $options = array()])

Пример

Заменить ключ новым значением, срок действия которого истекает через 2 часа:

$str = 'A new value for the cache.';
$xpdo->cacheManager->replace('mystuff',$str,7200);

Смотрите также

  1. xPDOCacheManager.copyFile
  2. xPDOCacheManager.copyTree
  3. xPDOCacheManager.delete
  4. xPDOCacheManager.deleteTree
  5. xPDOCacheManager.endsWith
  6. xPDOCacheManager.escapeSingleQuotes
  7. xPDOCacheManager.get
  8. xPDOCacheManager.getCachePath
  9. xPDOCacheManager.getCacheProvider
  10. xPDOCacheManager.matches
  11. xPDOCacheManager.replace
  12. xPDOCacheManager.writeFile
  13. xPDOCacheManager.set
  14. xPDOCacheManager.writeTree
  15. xPDOCacheManager

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • modmore
  • Jens Wittmann – Gestaltung & Entwicklung
  • Raffy
  • eydolan
  • Digital Penguin
  • Fabian Christen
  • Dannevang Digital
  • deJaya
  • Sepia River Studios
  • Following Sea
  • Anton Tarasov
  • Lefthandmedia
  • Nick Clark
  • Chris Fickling
  • Murray Wood
  • YJ
  • CrewMark
  • Richard

Budget

$305 per month—let's make that $500!

Learn more