$DEFAULTS = [ 'language' => 'en', 'timezone' => 'America/New_York', 'currency' => 'USD', ]; $context_system = new \context_system($DEFAULTS);
$cache_handler = new SomeCacheHandler(); $context_system = new \context_system([], $cache_handler);In this example, all instances of the context_system object created throughout the application will share the same cache handler. The context_system library is part of Moodle, an open-source learning management system.