CRM-15578 - Add Civi\Core\Resolver. Fix loading of Angular content after updating...
authorTim Otten <totten@civicrm.org>
Fri, 30 Jan 2015 08:40:22 +0000 (00:40 -0800)
committerTim Otten <totten@civicrm.org>
Sat, 31 Jan 2015 05:42:31 +0000 (21:42 -0800)
commitc8074a93613820d1880ad325d2bf83caa9d19887
treea675e3035abdb79f388d99d3086a6bf1a6c8ef3c
parentcb113651a5082c4a9054d7b5aa9d6ef0543ac3dc
CRM-15578 - Add Civi\Core\Resolver. Fix loading of Angular content after updating components.

After enabling or disabling components, the Angular content may have
changed, so we must call CRM_Core_Resources::singleton()->resetCacheCode.
This commit does so in a few pieces:

 * It updates the admin UI so that it uses the API for saving changes to
   "enable_components". (This resolves a split where UI+API were different.)
 * It updates the "enable_components" setting so that changes trigger
   a cache-code reset.
 * It updates the settings framework so that callbacks can reference
   non-static functions. (The objects must be registered in "Container".)
 * It exposes some of our singletons (eg CRM_Core_Resources) as objects
   in "Container".
 * It adds a helper function (Civi\Core\Resolver) which can be used to
   convert references from data files (*.setting.php, *.xml, *.yml, etc)
   into objects/callables.
 * It updates various places that use callbacks from data files to
   go through Resolver.

See also: http://forum.civicrm.org/index.php/topic,35579.0.html
CRM/Admin/Form/Setting.php
CRM/Admin/Form/Setting/Component.php
CRM/Core/BAO/Setting.php
CRM/Core/Invoke.php
CRM/Core/Menu.php
CRM/Core/PseudoConstant.php
Civi/Core/Container.php
Civi/Core/Resolver.php [new file with mode: 0644]
settings/Core.setting.php
tests/phpunit/Civi/Core/ResolverTest.php [new file with mode: 0644]