Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
// This file is part of Moodle - http://moodle.org/
3
//
4
// Moodle is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// Moodle is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
 
17
namespace tool_messageinbound;
18
 
19
/**
20
 * The Mail Pickup Utils.
21
 *
22
 * @package    tool_messageinbound
23
 * @copyright  2023 Huong Nguyen <huongnv13@gmail.com>
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 */
26
class utils {
27
 
28
    /** @var int Encoding type: 7 bit SMTP semantic data. */
29
    const ENC7BIT = 0;
30
    /** @var int Encoding type: 8 bit SMTP semantic data. */
31
    const ENC8BIT = 1;
32
    /** @var int Encoding type: 8 bit binary data. */
33
    const ENCBINARY = 2;
34
    /** @var int Encoding type: BASE64 encoded data. */
35
    const ENCBASE64 = 3;
36
    /** @var int Encoding type: Human-readable 8-as-7 bit data. */
37
    const ENCQUOTEDPRINTABLE = 4;
38
    /** @var int Encoding type: Unknown. */
39
    const ENCOTHER = 5;
40
 
41
    /**
42
     * Get body content encoding.
43
     *
44
     * @return string[] List of body content encoding.
45
     */
46
    public static function get_body_encoding(): array {
47
        return [
48
            self::ENC7BIT => '7BIT',
49
            self::ENC8BIT => '8BIT',
50
            self::ENCBINARY => 'BINARY',
51
            self::ENCBASE64 => 'BASE64',
52
            self::ENCQUOTEDPRINTABLE => 'QUOTED-PRINTABLE',
53
            self::ENCOTHER => 'X-UNKNOWN',
54
        ];
55
    }
56
}