Use uppercase for RuntimeOption static methods.
Main style for static functions is UpperCase.
Esse commit está contido em:
@@ -25,7 +25,7 @@ namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
File *PhpStreamWrapper::openFD(const char *sFD) {
|
||||
if (!RuntimeOption::clientExecutionMode()) {
|
||||
if (!RuntimeOption::ClientExecutionMode()) {
|
||||
raise_warning("Direct access to file descriptors "
|
||||
"is only available from command-line");
|
||||
return nullptr;
|
||||
|
||||
@@ -1322,7 +1322,7 @@ bool hphp_invoke(ExecutionContext *context, const std::string &cmd,
|
||||
bool &error, string &errorMsg,
|
||||
bool once /* = true */, bool warmupOnly /* = false */,
|
||||
bool richErrorMsg /* = false */) {
|
||||
bool isServer = RuntimeOption::serverExecutionMode();
|
||||
bool isServer = RuntimeOption::ServerExecutionMode();
|
||||
error = false;
|
||||
|
||||
String oldCwd;
|
||||
|
||||
@@ -13,7 +13,10 @@
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
// Get SIZE_MAX definition. Do this before including any other files, to make
|
||||
|
||||
#include "hphp/runtime/base/runtime_option.h"
|
||||
|
||||
// Get SIZE_MAX definition. Do this before including any more files, to make
|
||||
// sure that this is the first place that stdint.h is included.
|
||||
#ifndef __STDC_LIMIT_MACROS
|
||||
#define __STDC_LIMIT_MACROS
|
||||
@@ -21,7 +24,6 @@
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#include <stdint.h>
|
||||
|
||||
#include "hphp/runtime/base/runtime_option.h"
|
||||
#include "hphp/runtime/base/type_conversions.h"
|
||||
#include "hphp/runtime/base/builtin_functions.h"
|
||||
#include "hphp/runtime/base/shared/shared_store_base.h"
|
||||
@@ -382,7 +384,7 @@ int RuntimeOption::GetScannerType() {
|
||||
static inline bool evalJitDefault() {
|
||||
// --mode server or --mode daemon
|
||||
// run long enough to justify JIT
|
||||
if (RuntimeOption::serverExecutionMode()) {
|
||||
if (RuntimeOption::ServerExecutionMode()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,11 +36,11 @@ public:
|
||||
|
||||
static bool Loaded;
|
||||
|
||||
static bool serverExecutionMode() {
|
||||
static bool ServerExecutionMode() {
|
||||
return strcmp(ExecutionMode, "srv") == 0;
|
||||
}
|
||||
|
||||
static bool clientExecutionMode() {
|
||||
static bool ClientExecutionMode() {
|
||||
return strcmp(ExecutionMode, "cli") == 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ void HttpProtocol::PrepareSystemVariables(Transport *transport,
|
||||
g->GV(_ENV).set(s_HHVM_JIT, 1);
|
||||
}
|
||||
|
||||
bool isServer = RuntimeOption::serverExecutionMode();
|
||||
bool isServer = RuntimeOption::ServerExecutionMode();
|
||||
if (isServer) {
|
||||
g->GV(_ENV).set(s_HPHP_SERVER, 1);
|
||||
#ifdef HOTPROFILER
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include "hphp/runtime/base/server/http_request_handler.h"
|
||||
#include "hphp/runtime/base/server/rpc_request_handler.h"
|
||||
|
||||
#include "hphp/runtime/base/server/http_request_handler.h"
|
||||
#include "hphp/runtime/base/program_functions.h"
|
||||
#include "hphp/runtime/base/runtime_option.h"
|
||||
#include "hphp/runtime/base/server/server_stats.h"
|
||||
@@ -35,7 +36,7 @@ RPCRequestHandler::RPCRequestHandler(bool info /* = true */)
|
||||
: m_count(0), m_reset(false),
|
||||
m_returnEncodeType(Json) {
|
||||
hphp_session_init();
|
||||
bool isServer = RuntimeOption::serverExecutionMode();
|
||||
bool isServer = RuntimeOption::ServerExecutionMode();
|
||||
if (isServer) {
|
||||
m_context = hphp_context_init();
|
||||
} else {
|
||||
|
||||
@@ -60,7 +60,7 @@ static int precompute_integers() {
|
||||
(StringData const **)calloc(NUM_CONVERTED_INTEGERS, sizeof(StringData*));
|
||||
String::converted_integers = String::converted_integers_raw
|
||||
- String::MinPrecomputedInteger;
|
||||
if (RuntimeOption::serverExecutionMode()) {
|
||||
if (RuntimeOption::ServerExecutionMode()) {
|
||||
// Proactively populate, in order to increase cache locality for sequential
|
||||
// access patterns.
|
||||
for (int n = String::MinPrecomputedInteger;
|
||||
|
||||
@@ -108,7 +108,7 @@ bool f_error_log(CStrRef message, int message_type /* = 0 */,
|
||||
std::string line(message.data(),
|
||||
// Truncate to 512k
|
||||
message.size() > (1<<19) ? (1<<19) : message.size());
|
||||
if (RuntimeOption::serverExecutionMode() ||
|
||||
if (RuntimeOption::ServerExecutionMode() ||
|
||||
RuntimeOption::AlwaysEscapeLog) {
|
||||
Logger::Error(line);
|
||||
} else {
|
||||
|
||||
@@ -780,7 +780,7 @@ void f_set_time_limit(int seconds) {
|
||||
TimeoutThread::DeferTimeout(seconds);
|
||||
// Just for ini_get
|
||||
g_context->setRequestTimeLimit(seconds);
|
||||
if (RuntimeOption::clientExecutionMode() &&
|
||||
if (RuntimeOption::ClientExecutionMode() &&
|
||||
seconds != 0) {
|
||||
raise_warning("set_time_limit is not supported in client mode");
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ void f_pcntl_exec(CStrRef path, CArrRef args /* = null_array */,
|
||||
}
|
||||
|
||||
int64_t f_pcntl_fork() {
|
||||
if (RuntimeOption::serverExecutionMode()) {
|
||||
if (RuntimeOption::ServerExecutionMode()) {
|
||||
raise_error("forking is disallowed in server mode");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ void Repo::initLocal() {
|
||||
if (!RuntimeOption::RepoLocalPath.empty()) {
|
||||
attachLocal(RuntimeOption::RepoLocalPath.c_str(), isWritable);
|
||||
} else {
|
||||
if (RuntimeOption::clientExecutionMode()) {
|
||||
if (RuntimeOption::ClientExecutionMode()) {
|
||||
std::string cliRepo = s_cliFile;
|
||||
if (!cliRepo.empty()) {
|
||||
cliRepo += ".hhbc";
|
||||
|
||||
@@ -159,13 +159,13 @@ static int64_t numRequests;
|
||||
|
||||
static inline bool warmedUp() {
|
||||
return (numRequests >= RuntimeOption::EvalJitWarmupRequests) ||
|
||||
(RuntimeOption::clientExecutionMode() &&
|
||||
(RuntimeOption::ClientExecutionMode() &&
|
||||
!RuntimeOption::EvalJitProfileRecord);
|
||||
}
|
||||
|
||||
static inline bool profileThisRequest() {
|
||||
if (warmedUp()) return false;
|
||||
if (RuntimeOption::serverExecutionMode()) return true;
|
||||
if (RuntimeOption::ServerExecutionMode()) return true;
|
||||
return RuntimeOption::EvalJitProfileRecord;
|
||||
}
|
||||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário