/home
/deploy
/EHungry-4-boyan
/Web
/classes
/Cache.class.php
}
public static function SetObject($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function SetArray($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function SetBoolean($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function Set($key, $var, $expire = 86400) {
App::debugbarLog('debug', "Cache set: $key");
if ($i = static::getInstance()) {
$var = static::beforeSet($var);
return $expire > 0?
$i->setEx($key, $expire, $var) :
$i->set($key, $var);
}
return null;
}
public static function Exists(...$key):?bool {
if ($i = static::getInstance()) {
return $i->exists($key);
}
return null;
}
public static function Expire($key, $ttl) {
if ($i = static::getInstance()) {
return $i->expire($key, $ttl);
}
return false;
}
/**
Arguments
"MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error."
/home
/deploy
/EHungry-4-boyan
/Web
/classes
/Cache.class.php
}
public static function SetObject($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function SetArray($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function SetBoolean($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function Set($key, $var, $expire = 86400) {
App::debugbarLog('debug', "Cache set: $key");
if ($i = static::getInstance()) {
$var = static::beforeSet($var);
return $expire > 0?
$i->setEx($key, $expire, $var) :
$i->set($key, $var);
}
return null;
}
public static function Exists(...$key):?bool {
if ($i = static::getInstance()) {
return $i->exists($key);
}
return null;
}
public static function Expire($key, $ttl) {
if ($i = static::getInstance()) {
return $i->expire($key, $ttl);
}
return false;
}
/**
Arguments
"hn_host_secure_wwwaclassicpizzacom"
86400
"O:6:"HnHost":26:{s:12:"pdfPageCount";i:0;s:10:"timestamps";b:0;s:9:"\x00*\x00hidden";a:1:{i:0;s:8:"password";}s:13:"\x00*\x00connection";N;s:8:"\x00*\x00table";N;s:13:"\x00*\x00primaryKey";s:2:"id";s:10:"\x00*\x00keyType";s:3:"int";s:12:"incrementing";b:1;s:7:"\x00*\x00with";a:0:{}s:12:"\x00*\x00withCount";a:0:{}s:10:"\x00*\x00perPage";i:15;s:6:"exists";b:1;s:18:"wasRecentlyCreated";b:0;s:13:"\x00*\x00attributes";a:14:{s:2:"id";i:6465;s:11:"hn_insecure";s:0:"";s:9:"hn_secure";s:21:"www.aclassicpizza.com";s:6:"active";i:1;s:16:"redirect_enabled";i:0;s:13:"redirect_host";s:0:"";s:12:"redirect_uri";s:0:"";s:11:"ssl_expires";s:10:"0000-00-00";s:15:"ssl_common_name";s:0:"";s:7:"ssl_key";s:0:"";s:15:"ssl_certificate";s:0:"";s:6:"ssl_ip";s:0:"";s:11:"dns_pointed";i:0;s:14:"ssl_debug_note";s:0:"";}s:11:"\x00*\x00original";a:14:{s:2:"id";i:6465;s:11:"hn_insecure";s:0:"";s:9:"hn_secure";s:21:"www.aclassicpizza.com";s:6:"active";i:1;s:16:"redirect_enabled";i:0;s:13:"redirect_host";s:0:"";s:12:"redirect_uri";s:0:"";s:11:"ssl_expires";s:10:"0000-00-00";s:15:"ssl_common_name";s:0:"";s:7:"ssl_key";s:0:"";s:15:"ssl_certificate";s:0:"";s:6:"ssl_ip";s:0:"";s:11:"dns_pointed";i:0;s:14:"ssl_debug_note";s:0:"";}s:8:"\x00*\x00casts";a:0:{}s:8:"\x00*\x00dates";a:0:{}s:13:"\x00*\x00dateFormat";N;s:10:"\x00*\x00appends";a:0:{}s:9:"\x00*\x00events";a:0:{}s:14:"\x00*\x00observables";a:0:{}s:12:"\x00*\x00relations";a:0:{}s:10:"\x00*\x00touches";a:0:{}s:10:"\x00*\x00visible";a:0:{}s:11:"\x00*\x00fillable";a:0:{}s:10:"\x00*\x00guarded";a:1:{i:0;s:1:"*";}}"
/home
/deploy
/EHungry-4-boyan
/Web
/classes
/Cache.class.php
public static function getInstance() {
if (static::$redisObj === null) {
static::$redisObj = new Redis();
try {
if (!@static::$redisObj->connect(static::$host, (int)static::$port)) {
static::$redisObj = false;
Splunk::log(Splunk::LOG_REDIS_CONN, ['error' => 'Error connecting']);
} else {
static::$redisObj->select(static::$db);
}
} catch (RedisException $e) {
static::$redisObj = false;
Splunk::log(Splunk::LOG_REDIS_CONN, ['error' => 'Error connecting: '.$e->getMessage()]);
}
}
return static::$redisObj;
}
public static function SetObject($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function SetArray($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function SetBoolean($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function Set($key, $var, $expire = 86400) {
App::debugbarLog('debug', "Cache set: $key");
if ($i = static::getInstance()) {
$var = static::beforeSet($var);
return $expire > 0?
$i->setEx($key, $expire, $var) :
$i->set($key, $var);
}
return null;
}
Arguments
"hn_host_secure_wwwaclassicpizzacom"
"O:6:"HnHost":26:{s:12:"pdfPageCount";i:0;s:10:"timestamps";b:0;s:9:"\x00*\x00hidden";a:1:{i:0;s:8:"password";}s:13:"\x00*\x00connection";N;s:8:"\x00*\x00table";N;s:13:"\x00*\x00primaryKey";s:2:"id";s:10:"\x00*\x00keyType";s:3:"int";s:12:"incrementing";b:1;s:7:"\x00*\x00with";a:0:{}s:12:"\x00*\x00withCount";a:0:{}s:10:"\x00*\x00perPage";i:15;s:6:"exists";b:1;s:18:"wasRecentlyCreated";b:0;s:13:"\x00*\x00attributes";a:14:{s:2:"id";i:6465;s:11:"hn_insecure";s:0:"";s:9:"hn_secure";s:21:"www.aclassicpizza.com";s:6:"active";i:1;s:16:"redirect_enabled";i:0;s:13:"redirect_host";s:0:"";s:12:"redirect_uri";s:0:"";s:11:"ssl_expires";s:10:"0000-00-00";s:15:"ssl_common_name";s:0:"";s:7:"ssl_key";s:0:"";s:15:"ssl_certificate";s:0:"";s:6:"ssl_ip";s:0:"";s:11:"dns_pointed";i:0;s:14:"ssl_debug_note";s:0:"";}s:11:"\x00*\x00original";a:14:{s:2:"id";i:6465;s:11:"hn_insecure";s:0:"";s:9:"hn_secure";s:21:"www.aclassicpizza.com";s:6:"active";i:1;s:16:"redirect_enabled";i:0;s:13:"redirect_host";s:0:"";s:12:"redirect_uri";s:0:"";s:11:"ssl_expires";s:10:"0000-00-00";s:15:"ssl_common_name";s:0:"";s:7:"ssl_key";s:0:"";s:15:"ssl_certificate";s:0:"";s:6:"ssl_ip";s:0:"";s:11:"dns_pointed";i:0;s:14:"ssl_debug_note";s:0:"";}s:8:"\x00*\x00casts";a:0:{}s:8:"\x00*\x00dates";a:0:{}s:13:"\x00*\x00dateFormat";N;s:10:"\x00*\x00appends";a:0:{}s:9:"\x00*\x00events";a:0:{}s:14:"\x00*\x00observables";a:0:{}s:12:"\x00*\x00relations";a:0:{}s:10:"\x00*\x00touches";a:0:{}s:10:"\x00*\x00visible";a:0:{}s:11:"\x00*\x00fillable";a:0:{}s:10:"\x00*\x00guarded";a:1:{i:0;s:1:"*";}}"
86400
/home
/deploy
/EHungry-4-boyan
/Web
/classes
/HnHost.class.php
$aObj = Cache::GetObject($cacheKey, true);
if ($aObj || is_null($aObj)) {
return $aObj;
}
}
$hn = null;
$db_conn = DB::conn();
$sql = "SELECT id FROM ".HnHost::getTableName()." WHERE hn_secure = ?";
if ($activeOnly) {
$sql .= ' AND active = 1';
}
$db_conn->bindParameter($sql, 1, $secure, 'string');
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
$row = $result->fetch();
$hn = new HnHost($row['id']);
}
if ($activeOnly) {
Cache::SetObject($cacheKey, $hn);
}
return $hn;
}
}
Arguments
"hn_host_secure_wwwaclassicpizzacom"
HnHost {}
/home
/deploy
/EHungry-4-boyan
/PHP
/Global.php
if (!function_exists('HN_DevToLive')) {
die('Function HN_DevToLive must be defined in AutoConf/Local.php');
}
try {
define('HN_Current', strtolower(HN_DevToLive($_SERVER['HTTP_HOST']))); //phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
define('HN_SSL', ($_SERVER['HTTP_SCHEME'] == 'https'));
} catch (DomainException $e) {
$status = new AccessStatus();
/** @noinspection PhpUndefinedFieldInspection */
$status->close_message = <<<HTML
This subdomain probably has no SSL configured for it.<br/>
Check if there's no typo on the URL; otherwise, go to the <a href="https://order.ehungry.com.$e->baseSuffix/rcs/?form=devtools" target="_blank">Super Admin</a> and generate an SSL Cert for <tt>{$e->baseDomain}</tt>
HTML;
include(App_Path.'/Web/closed.php');
exit(0);
}
}
$hnHost = !TEST_ENV?
HnHost::getFromSecure(HN_Current) :
HnHost::unguarded(function () {
return new HnHost(TEST_HOST);
});
if (!$hnHost) {
$status = new AccessStatus();
$status->close_message = 'The URL you were trying to access is not valid on this server. If you feel this is in error, please contact your restaurant or online ordering provider. Sorry for any inconvenience!';
//if HN_DevToLive() didn't throw up, but still we end up here, this might be just a 404 error, or an actual missing
// SSL cert when accessing DevLevel 2 intentionally. Thus, let's include a helper message as well.
if (DevLevel >= 2) {
preg_match('/^(.*)\.(\d+)\.(.*)$/', $_SERVER['HTTP_HOST'], $domainPieces);
if (sizeof($domainPieces) == 4) {
$status->close_message .= "<br/><br/>Psst... developer! This may also be a missing SSL Cert.<br/>If there's no typo on the URL, <a href='https://order.ehungry.com.$domainPieces[2].$domainPieces[3]/rcs/?form=devtools'>generate a certificate</a> for <tt>$domainPieces[1]</tt>";
}
}
include(App_Path.'/Web/closed.php');
exit(0);
}
Arguments
/home
/deploy
/EHungry-4-boyan
/Web
/index.php
<? /** @noinspection PhpIncludeInspection - to avoid marking dynamic includes */
//TODO create a «root»/_bootstrap.php which can be used by .psysh.php, tests/bootstrap.php and Web/index.php
require(dirname(__DIR__).'/PHP/base_consts.php');
require(dirname(__DIR__).'/PHP/autoloader.php');
initializeAutoLoader();
//disabled for now since we already have our own Alerts infrastructure, and it's not worth it to append another cloud provider to the startup of every freaking request; it's also not possible to catch errors this early if we depend on database checks, but we'll leave it here in case we change our mind?
//ErrorHandlers::sentryInit(); //early catch of errors and failsafe for smaller controllers, not in Sentry
App::startTime();
ErrorHandlers::register();
// Global.php is the core setup file for the application
App::debugbarTime('Global.php');
require(dirname(__DIR__) . '/PHP/Global.php');
App::debugbarTime('Global.php');
/** @var string $controller The main controller - defined at /PHP/Global.php */
App::debugbarTime('Sentry - controller');
ErrorHandlers::sentryInit($controller); //doesn't always do much - not every controller has a Sentry project
App::debugbarTime('Sentry - controller');
App::debugbarTime("controller: $controller");
apache_note('AppController', $controller);
if (file_exists(CORE_PATH."lib/helpers/$controller.php")) {
require CORE_PATH."lib/helpers/$controller.php";
}
require CORE_PATH."controllers/$controller.php";
App::debugbarTime("controller: $controller");
Arguments
"/home/deploy/EHungry-4-boyan/PHP/Global.php"