Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
 * Whoops - php errors for cool kids
 * @author Filipe Dobreira <http://github.com/filp>
 */

namespace Whoops\Util;

class Misc
{
    /**
	 * Can we at this point in time send HTTP headers?
	 *
	 * Currently this checks if we are even serving an HTTP request,
	 * as opposed to running from a command line.
	 *
	 * If we are serving an HTTP request, we check if it's not too late.
	 *
	 * @return bool
	 */
    public static function canSendHeaders()
    {
        return isset($_SERVER["REQUEST_URI"]) && !headers_sent();
    }

    /**
	 * Translate ErrorException code into the represented constant.
	 *
	 * @param int $error_code
	 * @return string
	 */
    public static function translateErrorCode($error_code)
    {
        $constants = get_defined_constants(true);
        if (array_key_exists('Core' , $constants)) {
            foreach ($constants['Core'] as $constant => $value) {
                if (substr($constant, 0, 2) == 'E_' && $value == $error_code) {
                    return $constant;
                }
            }
        }
        return "E_UNKNOWN";
    }
}

Commits for Nextrek/Aiba_backup/vendor/filp/whoops/src/Whoops/Util/Misc.php

Diff revisions: vs.
Revision Author Commited Message
1464 MOliva picture MOliva Tue 13 Oct, 2020 11:16:56 +0000