/home
/deploy
/EHungry-6-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-6-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
"hh_2026-01-22 00:00:00_r11221_PICKUP_0"
86400
"N;"
/home
/deploy
/EHungry-6-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
"hh_2026-01-22 00:00:00_r11221_PICKUP_0"
"N;"
86400
/home
/deploy
/EHungry-6-boyan
/Web
/classes
/HolidayHours.class.php
}
}
} else {
$sql = "SELECT id FROM ".HolidayHours::getTableName()." WHERE for_date = ? AND " .
($cid ? "category_id" : "restaurant_id") . " = ? AND order_type = ? $where ORDER BY id DESC";
$db_conn->bindParameter($sql, 1, $date, "string");
$db_conn->bindParameter($sql, 1, $rid, "integer");
$db_conn->bindParameter($sql, 1, $type, "string");
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
if ($row = $result->fetch()) {
$hh = new HolidayHours($row['id']);
Cache::SetObject($cacheKey, $hh);
return $hh;
}
}
}
if ($cacheKey) {
Cache::SetObject($cacheKey, null);
}
return null;
}
public static function getByDateAndRestaurant($date, $rid) {
$db_conn = DB::conn();
$rbs = [];
$sql = "SELECT id FROM ".HolidayHours::getTableName()." WHERE for_date = ? AND restaurant_id = ? ORDER BY id DESC";
$db_conn->bindParameter($sql, 1, $date, "string");
$db_conn->bindParameter($sql, 1, $rid, "integer");
$result = $db_conn->query($sql);
if ($result) {
while ($row = $result->fetch()) {
$rbs[] = new HolidayHours($row['id']);
}
}
return $rbs;
}
public static function storeHours($holidayClosed, $forDate, $restaurantID, $holidayNotifications, $holidayOpenHour, $holidayOpenMinute, $holidayOpenMeridien, $holidayClosedHour, $holidayClosedMinute, $holidayClosedMeridien, $timeErrorMessage, $orderType, $namedHolidayID, $holidayDateRangeID, $categoryID = null, $isYearly = false, $showCategoryWhenClosed = false) {
Arguments
"hh_2026-01-22 00:00:00_r11221_PICKUP_0"
null
/home
/deploy
/EHungry-6-boyan
/Web
/classes
/HolidayHours.class.php
}
if (!$time) {
$time = $restaurant->getLocalTime();
}
$holidayHours = HolidayHours::getByDateAndCategoryAndType(date('Y-m-d 00:00:00', $time), $category->getId(), $orderType, $isHiddenToCustomers);
if (is_object($holidayHours)) {
return $holidayHours;
}
//check parent category too
if ($category->parent_id) {
$holidayHours = HolidayHours::getByDateAndCategoryAndType(date('Y-m-d 00:00:00', $time), $category->parent_id, $orderType, $isHiddenToCustomers);
if (is_object($holidayHours)) {
return $holidayHours;
}
}
return false;
}
public static function getByDateAndRestaurantAndType($date, $rid, $type = 'PICKUP') {
return HolidayHours::getByDateAndTypeAndRestaurantOrCategory($date, $rid, null, $type);
}
public static function getByDateAndCategoryAndType($date, $cid, $type = null, $isHiddenToCustomers = false) {
return HolidayHours::getByDateAndTypeAndRestaurantOrCategory($date, null, $cid, $type, $isHiddenToCustomers);
}
public static function getByDateAndTypeAndRestaurantOrCategory($date, $rid = null, $cid = null, $type = 'PICKUP', $isHiddenToCustomers = false) {
$db_conn = DB::conn();
$cacheKey = 'hh_'.$date.'_'.($cid > 0 ? ('c'.$cid):('r'.$rid)).'_'.($type?:'ALL') . "_" . ($isHiddenToCustomers ? '1' : '0');
$aObj = Cache::GetObject($cacheKey, true);
if ($aObj || is_null($aObj)) {
return $aObj;
}
$where = '';
if ($cid) {
$rid = $cid;
if ($isHiddenToCustomers) {
$where .= ' AND show_category_when_closed = 0';
Arguments
"2026-01-22 00:00:00"
11221
null
"PICKUP"
/home
/deploy
/EHungry-6-boyan
/Web
/classes
/Restaurant.class.php
if ($currentLocalTime < $todayTimestamp) {
continue;
}
//Max number of days in advance of order ready date that a customer can place an order
//max_advance_days + 2 because we want to be able to check for the hours going into the next day ie. midnight-4am (+1) and then look all the way until midnight (+2)
$maxTime = strtotime(' +' . ($this->max_advance_days + 2) . ' days', $todayTimestamp);
if ($currentLocalTime >= $maxTime && !$ignoreOrderingDaysLimit) {
if (!($cart->getTimeSlotsEnabled($this, $orderType) && $this->asap_orders_only)) {
break;
}
}
//closed days
$closed = $this->{$orderTypeString.'closed_on_'.strtolower(getWeekdayName($today))};
//disable days for holidays
if (!$excludeClosedHours) {
$holidayDate = date('Y-m-d 00:00:00', $currentLocalTime);
$holidayHours = HolidayHours::getByDateAndRestaurantAndType($holidayDate, $this->getId(), $orderType);
if (is_object($holidayHours)) {
$closed = $holidayHours->getIsClosed();
}
}
//disable days for when the cart items' category is closed
$categories = $cart->getCartItemsCategories();
foreach ($categories as $category) {
$isCategoryHidden = ClosedHours::isCategoryDisabled($this, $category, $currentLocalTime, false, $orderType) || HolidayHours::isCategoryDisabled($this, $category, $currentLocalTime, false, $orderType);
if ($isCategoryHidden) {
$closed = true;
}
}
//ordering closed
$closedUntil = $this->getLocalPublicOrderingClosedUntilText(true, $orderType);
if ($closedUntil && strtotime(date('Y-m-d', $closedUntil)) > strtotime(date('Y-m-d', $currentLocalTime))) {
$closed = true;
}
Arguments
"2026-01-22 00:00:00"
11221
"PICKUP"
/home
/deploy
/EHungry-6-boyan
/Web
/classes
/Restaurant.class.php
* @param bool $ignoreDaysLimit
* @param Menu[] $menus
* @return array
* @throws Exception
*/
public function getOrderingDaysForAnyType($ignoreDaysLimit = false, $menus = []) {
// Use a static variable to store cache within the request scope, so we don't recalculate this on every call within the request
static $cache = [];
$cacheKey = ($ignoreDaysLimit ? '1' : '0') .
($menus === null ? 'null' : md5(json_encode($menus)));
if (isset($cache[$cacheKey])) {
return $cache[$cacheKey];
}
$orderTypes = $this->getEnabledBaseOrderTypes();
$availableDates = [];
$dateTime = new DateTime(date('Y-m-d', $this->getLocalTime()));
if (isset($orderTypes["PICKUP"]) || isset($orderTypes["DINEIN"])) {
$availableDates = $this->getAvailableDates($dateTime, 'PICKUP', false, $ignoreDaysLimit, false, $menus);
}
if (isset($orderTypes["DELIVERY"])) {
$availableDates = array_merge($availableDates, $this->getAvailableDates($dateTime, 'DELIVERY', false, $ignoreDaysLimit, false, $menus));
}
sort($availableDates);
$cache[$cacheKey] = $availableDates;
return $availableDates;
}
/**
* @param DateTime $date
* @return array
*/
public function getAvailableTimeSlots($date) {
//time slots
if ($this->time_slots_enabled) {
$validTimes = $this->getAvailableTimes($date);
$timeSlots = RestaurantTimeSlot::getForRestaurant($this);
$validTimeSlots = [];
Arguments
DateTime @1768982400 {
date: 2026-01-21 00:00:00.0 America/Los_Angeles (-08:00)
}
"PICKUP"
false
false
false
[]
/home
/deploy
/EHungry-6-boyan
/Web
/lib
/global.php
}
if ($restaurant->public_ordering_closed_until) {
return $restaurant->getLocalPublicOrderingClosedUntilText($returnClosedUntilTime);
}
}
if (is_string($defaultMsg)) {
return $returnClosedUntilTime ? 'Indefinitely' : $defaultMsg;
}
return $returnClosedUntilTime ? 'Indefinitely' : ($result?: true); //in case result is an empty string
}
if ($skipLoginCheck && is_object($restaurant) && $restaurant->isOrderingClosed()) {
return true;
}
//If no ordering times are currently available, check if ordering will be possible later.
//If not, return "Online ordering is closed" (effective indefinitely, represented as +200 years)
if (is_object($restaurant) && count($restaurant->getOrderingDaysForAnyType()) === 0) {
$firstAvailableTime = $restaurant->getFirstAvailableTime();
if ($firstAvailableTime) {
return $returnClosedUntilTime ? $firstAvailableTime
: ('Online ordering is closed' . (' until ' . date('F jS \a\t g:iA', $firstAvailableTime)));
}
return $returnClosedUntilTime ? strtotime('+200 years') : 'Online ordering is closed';
}
return false;
}
function addErrorDialogueToLoadEvent() {
if (!isset($_REQUEST['hide_error_dialog'])) {
$errStr = str_replace("'", "‘", $_REQUEST['errors']);
$errStr = preg_replace('/\r\n/', ' ', $errStr);
if ($errStr) {
return '<script type="text/javascript" defer="defer">
var tmpOnload = window.onload;
window.onload = function() {
if(tmpOnload) tmpOnload();
/home
/deploy
/EHungry-6-boyan
/Web
/templates4.0
/customer
/header.php
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-K9P93M" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<? include(CORE_PATH . 'templates4.0/customer/header_devtools.php'); ?>
<?=HTML\printLoggedInAdminBanner()?>
<!-- wrapper starts -->
<div class="wrapper">
<div style="grid-area: header-announcements">
<? include(CORE_PATH."templates3.0/customer/upgrade_browser_banner.php"); ?>
<? if (isset($account) && $account->hasVisibleAnnouncement("header")) {
if (!isset($_SESSION['announcement_text']) || $_SESSION['announcement_text'] != $account->getContextualAnnouncementsHtml()) { ?>
<div class="header-opensign announcement-bg-color announcement-txt-color">
<?=$account->getContextualAnnouncementsHtml()?>
<a href="javascript:void(0)" class="close" id="closeAnnouncement" role="button" aria-label="Close Announcement" tabindex="0"><i class="fas fa-times fa-xs"></i></a>
</div>
<? }
} ?>
<!-- get closed sign if applicable. -->
<? if ($closed_msg = isOrderingClosed(CLOSED_MSG_RESTAURANT)) { ?>
<div class="header-opensign" style="background-color:#fecece; font-size: .875em">
<?=$closed_msg?>
</div>
<? } ?>
<? if ($_REQUEST['form'] == 'home') { ?>
<?=renderStatusMessages4()?>
<? } ?>
<? if (isSpringroll()) { ?>
<div class="d-flex gap-2 p-2" style="background-color: #d44220">
<a class="mx-auto" href="/">
<div role="img" aria-label="Logo Image" style="transform: scale(0.6); background-color: white; width: 136px; height: 33px; -webkit-mask: url(<?=getAssetUrl('logo.svg')?>); mask: url(<?=getAssetUrl('logo.svg')?>)"></div>
</a>
</div>
<? } ?>
</div>
<? // Header ?>
<div class="headerAndWtype" style="grid-area: header">
Arguments
/home
/deploy
/EHungry-6-boyan
/Web
/controllers
/customer.php
}
if (!isset($cart) || !is_object($cart)) {
$GLOBALS['cart'] = \Cart::getCurrent();
}
//unset callback data in the event someone didn't hit the callback validation page
if (!in_array($_REQUEST['form'], ['checkout', 'nosuchpage', 'validatecallback', 'viewdeliveryzone'])) {
//TODO: probably need to add one more form here that is called ajax, callback seems to reset when it shouldnt
unset($_SESSION['validation_data']);
}
$locs = $account->getActiveRestaurants('position');
$tab = MainNavigationTab::getAllForAccount($account->getId());
include_once(CORE_PATH.'lib/helpers/customer3.0.php');
if (!in_array($_REQUEST['form'], $viewContentOnly)) {
App::debugbarTime('header');
include_once(getLayoutPartPath('header'));
App::debugbarTime('header');
}
App::debugbarTime("view '{$_REQUEST['form']}'");
$path = CORE_PATH.'view' . ($_REQUEST['_VERSION'] == 4 ? 4 : 3) . '.0/customer/'.$_REQUEST['form'].'.php';
if (is_readable($path)) {
include_once($path);
}
App::debugbarTime("view '{$_REQUEST['form']}'");
if (!in_array($_REQUEST['form'], $viewContentOnly)) {
App::debugbarTime('footer');
include_once(getLayoutPartPath('footer'));
App::debugbarTime('footer');
}
function getLayoutPartPath($part) {
if (isset($_REQUEST['_CORDOVA_APP'])) {
$cart = Cart::getCurrent();
Arguments
"/home/deploy/EHungry-6-boyan/Web/templates4.0/customer/header.php"
/home
/deploy
/EHungry-6-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-6-boyan/Web/controllers/customer.php"