2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
16 #ifndef incl_HPHP_DEBUGGABLE_H_
17 #define incl_HPHP_DEBUGGABLE_H_
19 #include "hphp/runtime/base/type-string.h"
26 ///////////////////////////////////////////////////////////////////////////////
29 * Implement this interface to report information to debugger or execute
39 typedef std::pair
<const char*, std::string
> InfoEntry
;
40 typedef std::vector
<InfoEntry
> InfoVec
;
43 static void Add(InfoVec
& out
, const char* name
, const std::string
& value
);
44 static void AddServerStats(InfoVec
& out
, const char* name
,
45 const char* statsName
= nullptr);
47 static std::string
FormatNumber(const char* fmt
, int64_t n
);
48 static std::string
FormatSize(int64_t size
);
49 static std::string
FormatTime(int64_t milliSeconds
);
52 virtual ~IDebuggable() {}
55 * Returns a map of those support bits. Tells caller which function can be
58 virtual int debuggerSupport() {
63 * Fill up vector with summary information.
65 virtual void debuggerInfo(InfoVec
& info
) {
69 * Dump detailed information to return string.
71 virtual String
debuggerDump() {
76 * Execute a debugger action.
78 virtual String
debuggerVerb(const std::string
& verb
,
79 const std::vector
<std::string
>& args
) {
84 ///////////////////////////////////////////////////////////////////////////////
87 #endif // incl_HPHP_DEBUGGABLE_H_