eZXMLInputParser::eZXMLInputParser PHP Method

eZXMLInputParser() public method

The constructor. \param $validate \param $validateErrorLevel Determines types of errors that break input processing It's possible to combine any error types, by creating a bitmask of EZ_XMLINPUTPARSER_ERROR_* constants. \c true value means that all errors defined by $detectErrorLevel parameter will break further processing \param $detectErrorLevel Determines types of errors that will be detected and added to error log ($Messages).
public eZXMLInputParser ( $validateErrorLevel = self::ERROR_NONE, $detectErrorLevel = self::ERROR_NONE, $parseLineBreaks = false, $removeDefaultAttrs = false )
    function eZXMLInputParser($validateErrorLevel = self::ERROR_NONE, $detectErrorLevel = self::ERROR_NONE, $parseLineBreaks = false, $removeDefaultAttrs = false)
    {
        // Back-compatibility fixes:
        if ($detectErrorLevel === self::SHOW_SCHEMA_ERRORS) {
            $detectErrorLevel = self::ERROR_SCHEMA;
        } elseif ($detectErrorLevel === self::SHOW_ALL_ERRORS) {
            $detectErrorLevel = self::ERROR_ALL;
        }
        if ($validateErrorLevel === false) {
            $validateErrorLevel = self::ERROR_NONE;
        } elseif ($validateErrorLevel === true) {
            $validateErrorLevel = $detectErrorLevel;
        }
        $this->ValidateErrorLevel = $validateErrorLevel;
        $this->DetectErrorLevel = $detectErrorLevel;
        $this->RemoveDefaultAttrs = $removeDefaultAttrs;
        $this->ParseLineBreaks = $parseLineBreaks;
        $this->XMLSchema = eZXMLSchema::instance();
        $this->eZPublishVersion = eZPublishSDK::majorVersion() + eZPublishSDK::minorVersion() * 0.1;
        $ini = eZINI::instance('ezxml.ini');
        if ($ini->hasVariable('InputSettings', 'TrimSpaces')) {
            $trimSpaces = $ini->variable('InputSettings', 'TrimSpaces');
            $this->TrimSpaces = $trimSpaces == 'true' ? true : false;
        }
        if ($ini->hasVariable('InputSettings', 'AllowMultipleSpaces')) {
            $allowMultipleSpaces = $ini->variable('InputSettings', 'AllowMultipleSpaces');
            $this->AllowMultipleSpaces = $allowMultipleSpaces == 'true' ? true : false;
        }
        if ($ini->hasVariable('InputSettings', 'AllowNumericEntities')) {
            $allowNumericEntities = $ini->variable('InputSettings', 'AllowNumericEntities');
            $this->AllowNumericEntities = $allowNumericEntities == 'true' ? true : false;
        }
        $contentIni = eZINI::instance('content.ini');
        $useStrictHeaderRule = $contentIni->variable('header', 'UseStrictHeaderRule');
        $this->StrictHeaders = $useStrictHeaderRule == 'true' ? true : false;
    }