This file is indexed.

/usr/share/php/Horde/Support/Memory.php is in php-horde-support 2.1.5-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
 * Simple interface for tracking memory consumption.
 *
 * <code>
 *  $t = new Horde_Support_Memory;
 *  $t->push();
 *  $used = $t->pop();
 * </code>
 *
 * Do not expect too much of this memory tracker. Profiling memory is not
 * trivial as your placement of the measurements may obscure important
 * information. As a trivial example: Assuming that your script used 20 MB of
 * memory befory you call push() the information you get when calling pop()
 * might only tell you that there was less than 20 MB of memory consumed in
 * between the two calls. Take the changes to internal memory handling of PHP in
 * between the different versions into account
 * (http://de3.php.net/manual/en/features.gc.performance-considerations.php) and
 * you should get an idea about why you might be cautious about the values you
 * get from this memory tracker.
 *
 * Copyright 2011-2016 Horde LLC (http://www.horde.org/)
 *
 * @category   Horde
 * @package    Support
 * @license    http://www.horde.org/licenses/bsd
 */
class Horde_Support_Memory
{
    /**
     * Holds the starting memory consumption.
     *
     * @var array
     */
    protected $_start = array();

    /**
     * Current index for stacked trackers.
     *
     * @var integer
     */
    protected $_idx = 0;

    /**
     * Push a new tracker on the stack.
     */
    public function push()
    {
        $start = $this->_start[$this->_idx++] = array(
            memory_get_usage(),
            memory_get_peak_usage(),
            memory_get_usage(true),
            memory_get_peak_usage(true)
        );
        return $start;
    }

    /**
     * Pop the latest tracker and return the difference with the current
     * memory situation.
     *
     * @return array The change in memory allocated via emalloc() in between the
     *               push() and the pop() call. The array holds four values: the
     *               first one indicates the change in current usage of memory
     *               while the second value indicates any changes in the peak
     *               amount of memory used. The third and fourth value show
     *               current and peak usage as well but indicate the real memory
     *               usage and not just the part allocated via emalloc(),
     */
    public function pop()
    {
        if (! ($this->_idx > 0)) {
            throw new Exception('No timers have been started');
        }
        $start = $this->_start[--$this->_idx];
        return array(
            memory_get_usage() - $start[0],
            memory_get_peak_usage() - $start[1],
            memory_get_usage(true) - $start[2],
            memory_get_peak_usage(true) - $start[3]
        );
    }

}