Commit graph

6 commits

Author SHA1 Message Date
Timo Tijhof
7f01755fdf CacheLRU: Simplify >0 assertion and remove verbose inline comment
* Consistently refer to above zero as '> 0', not ">= 1" or "not <= 0".

* Remove superfluous comment that say what ping() does.

Change-Id: I25d276faa555e02feb99e656eb9cb7071f8205c0
2015-10-20 03:19:17 +01:00
daniel
7081228214 Start using the Assert helper class for checking parameters.
This introduces https://github.com/wmde/Assert as a dependency,
as discussed in the RFC T91071.

This change uses assertions to check some parameters in some places,
to showcase the main intended use case for assertions in MediaWiki.

Bug: T91071
Change-Id: I93ac39b7c146f10532e37b51d973b59b9c424b2f
2015-05-11 17:54:07 +00:00
Alex Monk
156bcbec81 Mostly revert "Verify parameter for MapCacheLRU::has() can be passed to array_key_exists()"
This broke a few things, and the debug line was basically pointless.

Instead, continue to only throw an exception if $text is an object, but only
warn if it's otherwise not a string.

This reverts commit 372ded2fea.

Change-Id: I060da9191cdbd00c4873caba875bfb77c917bcd7
2015-04-07 02:08:11 +00:00
Mark A. Hershberger
372ded2fea Verify parameter for MapCacheLRU::has() can be passed to array_key_exists()
This prevents warnings from PHP from array_key_exists().

Also make sure Title::newFromText throws an exception before it can trigger this.

Bug: T76305
Change-Id: I2b36b7a3b96b37e29fe06f69c13a185b3ec592a7
2015-03-23 15:26:59 -07:00
Aaron Schulz
6417abb728 Added MapCacheLRU::getAllKeys() method
Change-Id: Idc9155bb55d37b083a6c1124721b74d4910ccec5
2014-12-25 14:02:50 -08:00
Aaron Schulz
93d2167ca6 Moved MapCacheLRU to libs/
Change-Id: Icb820787afe7298dd3124f5168d3efff19e53ab6
2014-11-10 22:51:29 +00:00
Renamed from includes/cache/MapCacheLRU.php (Browse further)