/home
/deploy
/EHungry-2-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-2-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
"cd_aid_67700"
86400
"O:12:"CustomDomain":27:{s:12:"\x00*\x00nullables";a:2:{i:0;s:14:"domain_expires";i:1;s:14:"domain_checked";}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";s:7:"default";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:7:{s:2:"id";i:5405;s:10:"account_id";i:67700;s:6:"domain";s:23:"www.chinakinggretna.com";s:4:"type";s:7:"default";s:14:"domain_expires";N;s:12:"domain_flags";i:0;s:14:"domain_checked";N;}s:11:"\x00*\x00original";a:7:{s:2:"id";i:5405;s:10:"account_id";i:67700;s:6:"domain";s:23:"www.chinakinggretna.com";s:4:"type";s:7:"default";s:14:"domain_expires";N;s:12:"domain_flags";i:0;s:14:"domain_checked";N;}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-2-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
"cd_aid_67700"
"O:12:"CustomDomain":27:{s:12:"\x00*\x00nullables";a:2:{i:0;s:14:"domain_expires";i:1;s:14:"domain_checked";}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";s:7:"default";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:7:{s:2:"id";i:5405;s:10:"account_id";i:67700;s:6:"domain";s:23:"www.chinakinggretna.com";s:4:"type";s:7:"default";s:14:"domain_expires";N;s:12:"domain_flags";i:0;s:14:"domain_checked";N;}s:11:"\x00*\x00original";a:7:{s:2:"id";i:5405;s:10:"account_id";i:67700;s:6:"domain";s:23:"www.chinakinggretna.com";s:4:"type";s:7:"default";s:14:"domain_expires";N;s:12:"domain_flags";i:0;s:14:"domain_checked";N;}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-2-boyan
/Web
/classes
/CustomDomain.class.php
public static function getForAccount($aid, $websiteDomain = false) {
$cacheKey = $websiteDomain ? "cd_aid_website_$aid" : "cd_aid_$aid";
$aObj = Cache::GetObject($cacheKey, true);
if ($aObj || is_null($aObj)) {
return $aObj;
}
$query = CustomDomain::where('account_id', $aid);
if ($websiteDomain) {
$query->where('type', self::TYPE_WEBSITE);
} else {
$query->where('type', self::TYPE_DEFAULT);
}
$domain = $query->first();
if ($domain instanceof CustomDomain) {
Cache::SetObject($cacheKey, $domain);
return $domain;
}
Cache::SetObject($cacheKey, null);
return null;
}
public static function setupDomainForAccount($domain, \Account $account, $websiteDomain = false) {
if ($websiteDomain) {
$cd = CustomDomain::getForAccountWebsite($account->id);
} else {
$cd = CustomDomain::getForAccount($account->getId());
}
if (!$cd) {
$cd = new CustomDomain();
$cd->setAccountId($account->getId());
if ($websiteDomain) {
$cd->type = self::TYPE_WEBSITE;
Arguments
"cd_aid_67700"
CustomDomain {}
/home
/deploy
/EHungry-2-boyan
/Web
/controllers
/customer.php
if ($account->getRestaurantCount() == 1) {
$_REQUEST['_SINGLE_RESTAURANT'] = true;
if (!isset($restaurant) || !is_object($restaurant)) {
$restaurant = $account->getDefaultRestaurant();
}
}
if (isset($restaurant) && $restaurant) {
$cart = Cart::clearCurrentIfRestaurantIsDifferent($restaurant);
$_SESSION['restaurant_id'] = $restaurant->getId();
$menus = $restaurant->getActiveMenus();
if (count($menus) == 1) {
$_REQUEST['_SINGLE_MENU'] = true;
}
}
$domain = null;
//must be premium plan
if ($account->hasPermission(WHITELABEL)) {
$domain = CustomDomain::getForAccount($account->getId());
}
if (!$usingOldLink) {
if (isset($tokens[0]) && $tokens[0]) {
if ($tokens[0] == 'menu') {
if ($_REQUEST['_SINGLE_RESTAURANT']) {
if ($_REQUEST['_SINGLE_MENU']) {
$_REQUEST['_MAIN_MENU_URL'] = true;
$_REQUEST['form'] = 'ordering3';
$_REQUEST['ordering_level'] = 3;
$menu = reset($menus);
$_SESSION['menu_id'] = $menu->getId();
$category = new Category(-1);
$category->setUrlTag('menu');
$category->setDisplayName('All Menu Items');
$category->menu_id = $menu->id;
$_REQUEST['category_id'] = -1;
} else {
header('Location: '.formatCustomerOrderLink([$restaurant, $menus[0], -1]), true, 301);
exit();
Arguments
/home
/deploy
/EHungry-2-boyan
/Web
/index.php
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-2-boyan/Web/controllers/customer.php"