/home
/deploy
/EHungry-8-simon
/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-8-simon
/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
"menu_at_30166_main"
86400
"O:4:"Menu":28:{s:14:"\x00Menu\x00errorMsg";N;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:41:{s:2:"id";i:9844;s:10:"start_time";s:8:"01:00:00";s:8:"end_time";s:8:"01:00:00";s:12:"display_name";s:4:"Main";s:10:"account_id";i:30166;s:11:"activate_at";s:19:"0000-00-00 00:00:00";s:13:"deactivate_at";s:19:"0000-00-00 00:00:00";s:8:"priority";i:1;s:3:"tag";s:0:"";s:16:"menu_description";s:135:"Please note: requests for additional items or special preparation may incur an <b>extra charge</b> not calculated on your online order.";s:16:"always_available";i:1;s:23:"delivery_fee_adjustment";d:0;s:10:"image_path";s:0:"";s:9:"is_hidden";i:0;s:16:"original_menu_id";i:0;s:25:"use_advanced_availability";i:0;s:11:"monday_open";s:8:"00:00:00";s:13:"monday_closed";s:8:"00:00:00";s:12:"tuesday_open";s:8:"00:00:00";s:14:"tuesday_closed";s:8:"00:00:00";s:14:"wednesday_open";s:8:"00:00:00";s:16:"wednesday_closed";s:8:"00:00:00";s:13:"thursday_open";s:8:"00:00:00";s:15:"thursday_closed";s:8:"00:00:00";s:11:"friday_open";s:8:"00:00:00";s:13:"friday_closed";s:8:"00:00:00";s:13:"saturday_open";s:8:"00:00:00";s:15:"saturday_closed";s:8:"00:00:00";s:11:"sunday_open";s:8:"00:00:00";s:13:"sunday_closed";s:8:"00:00:00";s:16:"closed_on_monday";i:0;s:17:"closed_on_tuesday";i:0;s:19:"closed_on_wednesday";i:0;s:18:"closed_on_thursday";i:0;s:16:"closed_on_friday";i:0;s:18:"closed_on_saturday";i:0;s:16:"closed_on_sunday";i:0;s:7:"url_tag";s:4:"main";s:6:"iac_id";N;s:12:"supermenu_id";N;s:8:"tax_code";N;}s:11:"\x00*\x00original";a:41:{s:2:"id";i:9844;s:10:"start_time";s:8:"01:00:00";s:8:"end_time";s:8:"01:00:00";s:12:"display_name";s:4:"Main";s:10:"account_id";i:30166;s:11:"activate_at";s:19:"0000-00-00 00:00:00";s:13:"deactivate_at";s:19:"0000-00-00 00:00:00";s:8:"priority";i:1;s:3:"tag";s:0:"";s:16:"menu_description";s:135:"Please note: requests for additional items or special preparation may incur an <b>extra charge</b> not calculated on your online order.";s:16:"always_available";i:1;s:23:"delivery_fee_adjustment";d:0;s:10:"image_path";s:0:"";s:9:"is_hidden";i:0;s:16:"original_menu_id";i:0;s:25:"use_advanced_availability";i:0;s:11:"monday_open";s:8:"00:00:00";s:13:"monday_closed";s:8:"00:00:00";s:12:"tuesday_open";s:8:"00:00:00";s:14:"tuesday_closed";s:8:"00:00:00";s:14:"wednesday_open";s:8:"00:00:00";s:16:"wednesday_closed";s:8:"00:00:00";s:13:"thursday_open";s:8:"00:00:00";s:15:"thursday_closed";s:8:"00:00:00";s:11:"friday_open";s:8:"00:00:00";s:13:"friday_closed";s:8:"00:00:00";s:13:"saturday_open";s:8:"00:00:00";s:15:"saturday_closed";s:8:"00:00:00";s:11:"sunday_open";s:8:"00:00:00";s:13:"sunday_closed";s:8:"00:00:00";s:16:"closed_on_monday";i:0;s:17:"closed_on_tuesday";i:0;s:19:"closed_on_wednesday";i:0;s:18:"closed_on_thursday";i:0;s:16:"closed_on_friday";i:0;s:18:"closed_on_saturday";i:0;s:16:"closed_on_sunday";i:0;s:7:"url_tag";s:4:"main";s:6:"iac_id";N;s:12:"supermenu_id";N;s:8:"tax_code";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:"*";}s:17:"\x00*\x00_uploadAccount";N;}"
/home
/deploy
/EHungry-8-simon
/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
"menu_at_30166_main"
"O:4:"Menu":28:{s:14:"\x00Menu\x00errorMsg";N;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:41:{s:2:"id";i:9844;s:10:"start_time";s:8:"01:00:00";s:8:"end_time";s:8:"01:00:00";s:12:"display_name";s:4:"Main";s:10:"account_id";i:30166;s:11:"activate_at";s:19:"0000-00-00 00:00:00";s:13:"deactivate_at";s:19:"0000-00-00 00:00:00";s:8:"priority";i:1;s:3:"tag";s:0:"";s:16:"menu_description";s:135:"Please note: requests for additional items or special preparation may incur an <b>extra charge</b> not calculated on your online order.";s:16:"always_available";i:1;s:23:"delivery_fee_adjustment";d:0;s:10:"image_path";s:0:"";s:9:"is_hidden";i:0;s:16:"original_menu_id";i:0;s:25:"use_advanced_availability";i:0;s:11:"monday_open";s:8:"00:00:00";s:13:"monday_closed";s:8:"00:00:00";s:12:"tuesday_open";s:8:"00:00:00";s:14:"tuesday_closed";s:8:"00:00:00";s:14:"wednesday_open";s:8:"00:00:00";s:16:"wednesday_closed";s:8:"00:00:00";s:13:"thursday_open";s:8:"00:00:00";s:15:"thursday_closed";s:8:"00:00:00";s:11:"friday_open";s:8:"00:00:00";s:13:"friday_closed";s:8:"00:00:00";s:13:"saturday_open";s:8:"00:00:00";s:15:"saturday_closed";s:8:"00:00:00";s:11:"sunday_open";s:8:"00:00:00";s:13:"sunday_closed";s:8:"00:00:00";s:16:"closed_on_monday";i:0;s:17:"closed_on_tuesday";i:0;s:19:"closed_on_wednesday";i:0;s:18:"closed_on_thursday";i:0;s:16:"closed_on_friday";i:0;s:18:"closed_on_saturday";i:0;s:16:"closed_on_sunday";i:0;s:7:"url_tag";s:4:"main";s:6:"iac_id";N;s:12:"supermenu_id";N;s:8:"tax_code";N;}s:11:"\x00*\x00original";a:41:{s:2:"id";i:9844;s:10:"start_time";s:8:"01:00:00";s:8:"end_time";s:8:"01:00:00";s:12:"display_name";s:4:"Main";s:10:"account_id";i:30166;s:11:"activate_at";s:19:"0000-00-00 00:00:00";s:13:"deactivate_at";s:19:"0000-00-00 00:00:00";s:8:"priority";i:1;s:3:"tag";s:0:"";s:16:"menu_description";s:135:"Please note: requests for additional items or special preparation may incur an <b>extra charge</b> not calculated on your online order.";s:16:"always_available";i:1;s:23:"delivery_fee_adjustment";d:0;s:10:"image_path";s:0:"";s:9:"is_hidden";i:0;s:16:"original_menu_id";i:0;s:25:"use_advanced_availability";i:0;s:11:"monday_open";s:8:"00:00:00";s:13:"monday_closed";s:8:"00:00:00";s:12:"tuesday_open";s:8:"00:00:00";s:14:"tuesday_closed";s:8:"00:00:00";s:14:"wednesday_open";s:8:"00:00:00";s:16:"wednesday_closed";s:8:"00:00:00";s:13:"thursday_open";s:8:"00:00:00";s:15:"thursday_closed";s:8:"00:00:00";s:11:"friday_open";s:8:"00:00:00";s:13:"friday_closed";s:8:"00:00:00";s:13:"saturday_open";s:8:"00:00:00";s:15:"saturday_closed";s:8:"00:00:00";s:11:"sunday_open";s:8:"00:00:00";s:13:"sunday_closed";s:8:"00:00:00";s:16:"closed_on_monday";i:0;s:17:"closed_on_tuesday";i:0;s:19:"closed_on_wednesday";i:0;s:18:"closed_on_thursday";i:0;s:16:"closed_on_friday";i:0;s:18:"closed_on_saturday";i:0;s:16:"closed_on_sunday";i:0;s:7:"url_tag";s:4:"main";s:6:"iac_id";N;s:12:"supermenu_id";N;s:8:"tax_code";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:"*";}s:17:"\x00*\x00_uploadAccount";N;}"
86400
/home
/deploy
/EHungry-8-simon
/Web
/classes
/Menu.class.php
public function getErrorMessage() {
return $this->errorMsg;
}
public static function getByAccountAndUrlTag($aid, $tag) {
$cacheKey = 'menu_at_'.$aid.'_'.$tag;
$co = Cache::GetObject($cacheKey, true);
if ($co || is_null($co)) {
return $co;
}
$db_conn = DB::conn();
$sql = "SELECT id FROM ".Menu::getTableName()." WHERE account_id = ? AND url_tag = ?";
$db_conn->bindParameter($sql, 1, $aid, 'integer');
$db_conn->bindParameter($sql, 1, $tag, 'string');
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
if ($row = $result->fetch()) {
$m = new Menu($row['id']);
Cache::SetObject($cacheKey, $m);
return $m;
}
}
Cache::SetObject($cacheKey, null);
return null;
}
public static function belongsToAccount($mid = -1, $aid = -1) {
$db_conn = DB::conn();
$arr = array();
$sql = "SELECT id FROM ".Menu::getTableName()." WHERE id = ? AND account_id = ?";
$db_conn->bindParameter($sql, 1, $mid, "integer");
$db_conn->bindParameter($sql, 1, $aid, "integer");
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
return true;
}
return false;
}
Arguments
"menu_at_30166_main"
Menu {}
/home
/deploy
/EHungry-8-simon
/Web
/controllers
/customer.php
$_REQUEST['ordering_level'] = ($k + 1);
switch ($_REQUEST['ordering_level']) {
case 1:
$restaurant = Restaurant::getByAccountAndUrlTag($account->getId(), $v);
if (is_object($restaurant)) {
if (isset($_SESSION['restaurant_id']) && $restaurant->getId() != $_SESSION['restaurant_id']) {
$or = new Restaurant($_SESSION['restaurant_id']);
if ($or->getAccountId() != $restaurant->getAccountId()) {
unset($_SESSION['customer_id']);
}
$cart = Cart::getCurrent();
$cart->clear();
}
$_SESSION['restaurant_id'] = $restaurant->getId();
$menus = $restaurant->getMenus();
}
break;
case 2:
if (isset($restaurant) && is_object($restaurant)) {
$menu = Menu::getByAccountAndUrlTag($account->getId(), $v);
if (is_object($menu)) {
if ($menu->is_hidden) {
$menus[] = $menu;
usort($menus, [Restaurant::class, "sortMenus"]);
$_REQUEST['hidden_menu'] = $menu;
}
$_SESSION['menu_id'] = $menu->getId();
}
}
break;
case 3:
if (isset($menu) && is_object($menu)) {
if ($v == 'view-all' || $v == 'menu' || strpos($v, 'menu?') === 0) {
$category = new Category(-1);
$category->setUrlTag($v);
$category->setDisplayName('All Menu Items');
$category->setMenuId($menu->id);
$_REQUEST['category_id'] = -1;
} elseif ($v == 'popular-items') {
$category = new Category(-1);
Arguments
/home
/deploy
/EHungry-8-simon
/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-8-simon/Web/controllers/customer.php"