if (!$version) {
$verFile = implode(DIRECTORY_SEPARATOR,
- array(dirname(__FILE__), '..', '..', 'civicrm-version.php')
+ array(dirname(__FILE__), '..', '..', 'xml', 'version.xml')
);
if (file_exists($verFile)) {
- require_once $verFile;
- if (function_exists('civicrmVersion')) {
- $info = civicrmVersion();
- $version = $info['version'];
- }
- }
- else {
- // svn installs don't have version.txt by default. In that case version.xml should help -
- $verFile = implode(DIRECTORY_SEPARATOR,
- array(dirname(__FILE__), '..', '..', 'xml', 'version.xml')
- );
- if (file_exists($verFile)) {
- $str = file_get_contents($verFile);
- $xmlObj = simplexml_load_string($str);
- $version = (string) $xmlObj->version_no;
- }
+ $str = file_get_contents($verFile);
+ $xmlObj = simplexml_load_string($str);
+ $version = (string) $xmlObj->version_no;
}
// pattern check
// move things to CiviCRM cache as needed
CRM_Core_Session::storeSessionObjects();
+ if (Civi\Core\Container::isContainerBooted()) {
+ Civi::dispatcher()->dispatch('civi.core.exit');
+ }
+
+ $userSystem = CRM_Core_Config::singleton()->userSystem;
+ if (is_callable(array($userSystem, 'onCiviExit'))) {
+ $userSystem->onCiviExit();
+ }
exit($status);
}