SimpleSAML\Logger::warning PHP Метод

warning() публичный статический Метод

Log a warning.
public static warning ( $string )
    public static function warning($string)
    {
        self::log(self::WARNING, $string);
    }

Usage Example

Пример #1
0
 /**
  * This function performs some sanity checks on XML documents, and optionally validates them against their schema
  * if the 'validatexml' debugging option is enabled. A warning will be printed to the log if validation fails.
  *
  * @param string $message The SAML document we want to check.
  * @param string $type The type of document. Can be one of:
  * - 'saml20'
  * - 'saml11'
  * - 'saml-meta'
  *
  * @throws \InvalidArgumentException If $message is not a string or $type is not a string containing one of the
  *     values allowed.
  * @throws \SimpleSAML_Error_Exception If $message contains a doctype declaration.
  *
  * @author Olav Morken, UNINETT AS <*****@*****.**>
  * @author Jaime Perez, UNINETT AS <*****@*****.**>
  */
 public static function checkSAMLMessage($message, $type)
 {
     $allowed_types = array('saml20', 'saml11', 'saml-meta');
     if (!(is_string($message) && in_array($type, $allowed_types))) {
         throw new \InvalidArgumentException('Invalid input parameters.');
     }
     // a SAML message should not contain a doctype-declaration
     if (strpos($message, '<!DOCTYPE') !== false) {
         throw new \SimpleSAML_Error_Exception('XML contained a doctype declaration.');
     }
     // see if debugging is enabled for XML validation
     $debug = \SimpleSAML_Configuration::getInstance()->getArrayize('debug', array('validatexml' => false));
     $enabled = \SimpleSAML_Configuration::getInstance()->getBoolean('debug.validatexml', false);
     if (!(in_array('validatexml', $debug, true) || array_key_exists('validatexml', $debug) && $debug['validatexml'] === true || $enabled)) {
         // XML validation is disabled
         return;
     }
     $result = true;
     switch ($type) {
         case 'saml11':
             $result = self::isValid($message, 'oasis-sstc-saml-schema-protocol-1.1.xsd');
             break;
         case 'saml20':
             $result = self::isValid($message, 'saml-schema-protocol-2.0.xsd');
             break;
         case 'saml-meta':
             $result = self::isValid($message, 'saml-schema-metadata-2.0.xsd');
     }
     if ($result !== true) {
         Logger::warning($result);
     }
 }
All Usage Examples Of SimpleSAML\Logger::warning