X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FVersionCheck.php;h=4a9407f5dbe8f7783b30a9f77c0f6da81415cd4c;hb=8e7dbe1623e988dc347e1866055f4b3833c443a1;hp=fbb05a1929c9cc1efad57f47d06c2bea49279082;hpb=8f90afde2e35f46beb0dea2ef7a2def050517d3a;p=civicrm-core.git diff --git a/CRM/Utils/VersionCheck.php b/CRM/Utils/VersionCheck.php index fbb05a1929..4a9407f5db 100644 --- a/CRM/Utils/VersionCheck.php +++ b/CRM/Utils/VersionCheck.php @@ -178,6 +178,7 @@ class CRM_Utils_VersionCheck { * Add info to the 'entities' array */ private function getEntityStats() { + // FIXME hardcoded list = bad $tables = [ 'CRM_Activity_DAO_Activity' => 'is_test = 0', 'CRM_Case_DAO_Case' => 'is_deleted = 0', @@ -203,15 +204,18 @@ class CRM_Utils_VersionCheck { 'CRM_Mailing_Event_DAO_Delivered' => NULL, ]; foreach ($tables as $daoName => $where) { - $dao = new $daoName(); - if ($where) { - $dao->whereAdd($where); + if (class_exists($daoName)) { + /* @var \CRM_Core_DAO $dao */ + $dao = new $daoName(); + if ($where) { + $dao->whereAdd($where); + } + $short_name = substr($daoName, strrpos($daoName, '_') + 1); + $this->stats['entities'][] = [ + 'name' => $short_name, + 'size' => $dao->count(), + ]; } - $short_name = substr($daoName, strrpos($daoName, '_') + 1); - $this->stats['entities'][] = [ - 'name' => $short_name, - 'size' => $dao->count(), - ]; } }