Remove two unused builtin_functions.h things, collapse print() into echo()
Esse commit está contido em:
@@ -825,21 +825,6 @@ bool interface_supports_array(const std::string& n) {
|
||||
(n.size() == 8 && !strcasecmp(s, "Indexish")));
|
||||
}
|
||||
|
||||
String get_source_filename(litstr path, bool dir_component /* = false */) {
|
||||
String ret;
|
||||
if (path[0] == '/') {
|
||||
ret = path;
|
||||
} else {
|
||||
ret = RuntimeOption::SourceRoot + path;
|
||||
}
|
||||
|
||||
if (dir_component) {
|
||||
return f_dirname(ret);
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
Variant include_impl_invoke(CStrRef file, bool once, const char *currentDir) {
|
||||
if (file[0] == '/') {
|
||||
if (RuntimeOption::SandboxMode || !RuntimeOption::AlwaysUseRelativePath) {
|
||||
|
||||
@@ -185,31 +185,18 @@ const V &String::set(K key, const V &value) {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// output functions
|
||||
|
||||
inline int print(const char *s) {
|
||||
g_context->write(s);
|
||||
return 1;
|
||||
}
|
||||
inline int print(CStrRef s) {
|
||||
// print is not a real function. x_print exists, but this function gets called
|
||||
g_context->write(s);
|
||||
return 1;
|
||||
}
|
||||
inline void echo(const char *s) {
|
||||
g_context->write(s);
|
||||
}
|
||||
inline void echo(CStrRef s) {
|
||||
// echo is not a real function. x_echo exists, but this function gets called
|
||||
g_context->write(s);
|
||||
}
|
||||
|
||||
String get_source_filename(litstr path,bool dir_component = false);
|
||||
|
||||
void NEVER_INLINE throw_invalid_property_name(CStrRef name) ATTRIBUTE_NORETURN;
|
||||
void NEVER_INLINE throw_null_object_prop();
|
||||
void NEVER_INLINE throw_null_get_object_prop();
|
||||
void NEVER_INLINE raise_null_object_prop();
|
||||
void throw_exception(CObjRef e);
|
||||
bool set_line(int line0, int char0 = 0, int line1 = 0, int char1 = 0);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// isset/unset
|
||||
|
||||
@@ -646,7 +646,7 @@ public:
|
||||
|
||||
switch (t->method) {
|
||||
case PHP_CURL_STDOUT:
|
||||
echo(String(data, length, AttachLiteral));
|
||||
g_context->write(data, length);
|
||||
break;
|
||||
case PHP_CURL_FILE:
|
||||
return t->fp->write(String(data, length, AttachLiteral), length);
|
||||
@@ -680,7 +680,7 @@ public:
|
||||
if (ch->m_write.method == PHP_CURL_RETURN && length > 0) {
|
||||
ch->m_write.buf.append(data, (int)length);
|
||||
} else {
|
||||
echo(String(data, length, AttachLiteral));
|
||||
g_context->write(data, length);
|
||||
}
|
||||
break;
|
||||
case PHP_CURL_FILE:
|
||||
|
||||
@@ -737,11 +737,11 @@ private:
|
||||
|
||||
public:
|
||||
SimpleProfiler() {
|
||||
print("<div style='display:none'>");
|
||||
echo("<div style='display:none'>");
|
||||
}
|
||||
|
||||
~SimpleProfiler() {
|
||||
print("</div>");
|
||||
echo("</div>");
|
||||
print_output();
|
||||
}
|
||||
|
||||
@@ -759,16 +759,16 @@ public:
|
||||
|
||||
private:
|
||||
void print_output() {
|
||||
print("<link rel='stylesheet' href='/css/hotprofiler.css' type='text/css'>"
|
||||
echo("<link rel='stylesheet' href='/css/hotprofiler.css' type='text/css'>"
|
||||
"<script language='javascript' src='/js/hotprofiler.js'></script>"
|
||||
"<p><center><h2>Hotprofiler Data</h2></center><br>"
|
||||
"<div id='hotprofiler_stats'></div>"
|
||||
"<script language='javascript'>hotprofiler_data = [");
|
||||
for (StatsMap::const_iterator iter = m_stats.begin();
|
||||
iter != m_stats.end(); ++iter) {
|
||||
print("{\"fn\": \"");
|
||||
print(iter->first.c_str());
|
||||
print("\"");
|
||||
echo("{\"fn\": \"");
|
||||
echo(iter->first.c_str());
|
||||
echo("\"");
|
||||
|
||||
const CountMap &counts = iter->second;
|
||||
|
||||
@@ -778,11 +778,11 @@ private:
|
||||
",\"ct\": %" PRId64 ",\"wt\": %" PRId64 ",\"ut\": %" PRId64 ",\"st\": 0",
|
||||
counts.count, (int64_t)to_usec(counts.tsc, m_MHz),
|
||||
(int64_t)to_usec(counts.vtsc, m_MHz, true));
|
||||
print(buf);
|
||||
echo(buf);
|
||||
|
||||
print("},\n");
|
||||
echo("},\n");
|
||||
}
|
||||
print("]; write_data('ut', false);</script><br><br> <br>");
|
||||
echo("]; write_data('ut', false);</script><br><br> <br>");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -4306,7 +4306,7 @@ inline void OPTBLD_INLINE VMExecutionContext::iopInstanceOfD(PC& pc) {
|
||||
inline void OPTBLD_INLINE VMExecutionContext::iopPrint(PC& pc) {
|
||||
NEXT();
|
||||
Cell* c1 = m_stack.topC();
|
||||
print(tvCellAsVariant(c1).toString());
|
||||
echo(tvCellAsVariant(c1).toString());
|
||||
tvRefcountedDecRefCell(c1);
|
||||
c1->m_type = KindOfInt64;
|
||||
c1->m_data.num = 1;
|
||||
@@ -4350,7 +4350,7 @@ inline void OPTBLD_INLINE VMExecutionContext::iopExit(PC& pc) {
|
||||
if (c1->m_type == KindOfInt64) {
|
||||
exitCode = c1->m_data.num;
|
||||
} else {
|
||||
print(tvCellAsVariant(c1).toString());
|
||||
echo(tvCellAsVariant(c1).toString());
|
||||
}
|
||||
m_stack.popC();
|
||||
throw ExitException(exitCode);
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário