<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
+ | Copyright CiviCRM LLC. All rights reserved. |
| |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
*/
class CRM_Utils_Check {
// How often to run checks and notify admins about issues.
* @var array
* @link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
*/
- protected static $severityList = array(
+ protected static $severityList = [
\Psr\Log\LogLevel::DEBUG,
\Psr\Log\LogLevel::INFO,
\Psr\Log\LogLevel::NOTICE,
\Psr\Log\LogLevel::CRITICAL,
\Psr\Log\LogLevel::ALERT,
\Psr\Log\LogLevel::EMERGENCY,
- );
+ ];
/**
* We only need one instance of this object, so we use the
$config = CRM_Core_Config::singleton();
$config->cleanup(0, FALSE);
- $statusMessages = array();
+ $statusMessages = [];
$maxSeverity = 0;
foreach ($this->checkAll() as $message) {
if (!$message->isVisible()) {
$messages = $this->checkAll();
}
$minLevel = self::severityMap($threshold);
- $errors = array();
+ $errors = [];
foreach ($messages as $message) {
if ($message->getLevel() >= $minLevel) {
$errors[] = $message->toArray();
* Array of CRM_Utils_Check_Message objects
*/
public static function checkAll($max = FALSE) {
- $messages = array();
+ $messages = [];
foreach (glob(__DIR__ . '/Check/Component/*.php') as $filePath) {
$className = 'CRM_Utils_Check_Component_' . basename($filePath, '.php');
/* @var CRM_Utils_Check_Component $check */
CRM_Utils_Hook::check($messages);
- uasort($messages, array(__CLASS__, 'severitySort'));
+ uasort($messages, [__CLASS__, 'severitySort']);
$maxSeverity = 1;
foreach ($messages as $message) {