- count() can only be called on arrays or Countable, it can not be called on null
- recordset is neither so iterator_count() should be used
- instanceof or get_class() can not be applied to non-objects
- class methods must have the same arguments as methods in parent class
If the store is shared and the getAllKeys function is broken due to an
incompatability between libmemcached and memcached >= 1.4.23, then it is
not possible to purge the cache, and we cannot support the plugin.
This patch adjusts the isready check to additionally check if the
combination of libmemcached and memcached is affected by this issue.
In unit test, we write cache file often and
opcache might fail to detect changes. It will
be nice to invalidate opcode cache to ensure
we have the correct file_exists status
It is now safe to cache a reference to a cache and expect consistent results.
Changing identifiers altered cache results where a reference was
held to the cache. Identifiers have been set to be cached with
identifiers included so the caches are separate.
As a consequence of this it was identified that invalidation events
and identifiers don't easily work together as an event can't determine
which identifiers should be used for cache invalidation. So invalidation
events have been made incompatible with identifiers being set. No core
code used this combination as it's not possible to understand any expected
behaviour.
Event invalidation for application and session caches was centralised to the same
location. The only difference was the name of the lastinvalidation variable. This
improves support and consistency of invalidation code.
This unit test is not really verifying that internally igbinary
in being used but just igbinary availability and, by double
serializing, that it works for a semi-complex object.
The test will be skipped if igbinary is not available.
Previously a purge_store was only purging caches but it was leaving a
reference to the store instance for the cache definition.
As a result, the cache was never cleared away correctly and, in cases
where the cache store makes a TCP connection to a backend system, the
number of open sockets was increasing for each store instance.
After a complete purge, as found in the unit test reset, the cache
definitions should be both purged and removed.
This change should also lead to a drop in memory consumption for unit
tests as there will no longer be references to unused definition stores.
Ensure that the cache store requirements are met prior to attempting
to instantiate a class. Many of the constructors create connections
to external services requiring the installation and availability of
classes that are specified in are_requirements_met(). If they are
not checked properly you end up with PHP Fatal errors rather than
falling back to a different store that is capabable without the
the extra classes loaded.
purge_all() and purge_by_definition() look in the configuration
for which caches are available and then creates them to purge them.
The configuration stores the values used by initialise(), not
initialise_unit_test_instance() and would therefore fail to purge
all caches if they were not purged by another means.
In the case of filestore, it's purged by unit tests, in the case
of memcache(d), it purges the whole store when a single definition
is requested.
Therefore all configuration was moved into the configuration file
during unit tests and does not have any special override codes in
the unit test infrastructure.