/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
"hh_2025-05-19 00:00:00_r7325_PICKUP_0"
86400
"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
"hh_2025-05-19 00:00:00_r7325_PICKUP_0"
"N;"
86400
/home
/deploy
/EHungry-8-simon
/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_2025-05-19 00:00:00_r7325_PICKUP_0"
null
/home
/deploy
/EHungry-8-simon
/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
"2025-05-19 00:00:00"
7325
null
"PICKUP"
/home
/deploy
/EHungry-8-simon
/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
"2025-05-19 00:00:00"
7325
"PICKUP"
/home
/deploy
/EHungry-8-simon
/Web
/classes
/Restaurant.class.php
return $availableDates;
}
public function hasAvailableDays($selectedTime, $orderType) {
$dateTime = new DateTime(date('Y-m-d', $selectedTime));
$availableDates = $this->getAvailableDates($dateTime, $orderType, true, true, false, true);
return count($availableDates) > 0;
}
public function hasOrderingDaysForAnyType() {
return count($this->getOrderingDaysForAnyType()) > 0;
}
public function getOrderingDaysForAnyType($ignoreDaysLimit = false) {
$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, true);
}
if (isset($orderTypes["DELIVERY"])) {
$availableDates = array_merge($availableDates, $this->getAvailableDates($dateTime, 'DELIVERY', false, $ignoreDaysLimit, false, true));
}
sort($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 = [];
//filter out time slots where the max number of orders has been placed already
Arguments
DateTime @1745910000 {
date: 2025-04-29 00:00:00.0 America/Los_Angeles (-07:00)
}
"PICKUP"
false
false
false
true
/home
/deploy
/EHungry-8-simon
/Web
/classes
/Restaurant.class.php
$availableDates[] = $ymd;
}
}
}
}
$cart->setBaseOrderType($savedOrderType);
$cart->updateToSession();
return $availableDates;
}
public function hasAvailableDays($selectedTime, $orderType) {
$dateTime = new DateTime(date('Y-m-d', $selectedTime));
$availableDates = $this->getAvailableDates($dateTime, $orderType, true, true, false, true);
return count($availableDates) > 0;
}
public function hasOrderingDaysForAnyType() {
return count($this->getOrderingDaysForAnyType()) > 0;
}
public function getOrderingDaysForAnyType($ignoreDaysLimit = false) {
$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, true);
}
if (isset($orderTypes["DELIVERY"])) {
$availableDates = array_merge($availableDates, $this->getAvailableDates($dateTime, 'DELIVERY', false, $ignoreDaysLimit, false, true));
}
sort($availableDates);
return $availableDates;
}
/**
* @param DateTime $date
* @return array
*/
/home
/deploy
/EHungry-8-simon
/Web
/lib
/global.php
if ($restaurant->getPublicOrderingIsClosedForever()) {
return $returnClosedUntilTime ? 'Indefinitely' : 'Online ordering is not currently offered at this location.';
}
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 (is_object($restaurant) && !$restaurant->hasOrderingDaysForAnyType()) {
if ($restaurant->same_day_orders_only || $restaurant->asap_orders_only) {
$availableDays = $restaurant->getOrderingDaysForAnyType(true);
$firstAvailableTime = null;
if (count($availableDays)) {
$availableDay = reset($availableDays);
$pickupTimes = $restaurant->getEffectiveOpenAndCloseTimes('PICKUP', strtotime($availableDay));
$deliveryTimes = $restaurant->getEffectiveOpenAndCloseTimes('DELIVERY', strtotime($availableDay));
$firstAvailableTime = min($pickupTimes['open'], $deliveryTimes['open']);
}
return $returnClosedUntilTime ? strtotime($availableDay . ' ' . $firstAvailableTime)
: ('Online ordering is closed' . ($firstAvailableTime ? (' until ' . date('F jS \a\t g:iA', strtotime($availableDay . ' ' . $firstAvailableTime))) : ''));
}
return $returnClosedUntilTime ? strtotime('+200 years') : 'Online ordering is closed';
}
return false;
}
function addErrorDialogueToLoadEvent() {
if (!isset($_REQUEST['hide_error_dialog'])) {
/home
/deploy
/EHungry-8-simon
/Web
/model3.0
/customer
/ordering3.php
if ($account->getSkipTimeWarning()) {
$_SESSION['time_ok'] = true;
}
if (shouldShowAdminBypassMessageForCheckout()) {
setStatus(ONLINE_ORDERING_BYPASS_MESSAGE);
}
if (is_object($restaurant) && is_object($menu) && is_object($category) && isset($_REQUEST['item_id'])) {
$item = new MenuItem($_REQUEST['item_id']);
$item->setQuantity(1);
if (!$item->isInMenu($menu->getId())) {
redirectToOrderingWithError('The selected menu item is not available in the selected menu.', [$restaurant, $menu, $category]);
}
if (!MenuItemAvailability::isAvailableForMenuItemAndTime($item->getId(), $restaurant->getLocalTime())) {
redirectToOrderingWithError('The selected menu item has limited availability. It is not currently offered at this time.', [$restaurant, $menu, $category]);
}
$closedMsg = isOrderingClosed(CLOSED_MSG_RESTAURANT);
if ($closedMsg && is_string($closedMsg)) {
setStatus($closedMsg);
}
if (isset($_REQUEST['price_id'])) {
$p = new MenuItemPrice($_REQUEST['price_id']);
if ($p->getMenuItemId() == $item->getId()) {
$selected_price = $p;
$selectPriceId = $p->getId();
}
}
}
$_REQUEST['_PAGETITLE'] = '';
$_REQUEST['_PAGEDESCRIPTION'] = '';
$_REQUEST['_PAGEH2'] = '';
$menuText = '';
$orderTypeText = '';
//check that our order level contains the necessary bits of valid data, otherwise redirect back up
Arguments
/home
/deploy
/EHungry-8-simon
/Web
/controllers
/customer.php
$cart->setDefaultOrderType($account, $restaurant);
$cart->setDefaultFees($account, $restaurant);
}
$restaurantRequiredPages = [
'login',
'customerorders'
];
if (is_null($restaurant) && in_array($_REQUEST['form'], $restaurantRequiredPages)) {
redirectTo('home');
}
$modelPath = CORE_PATH . 'model4.0/customer/'.$_REQUEST['form'].'.php';
} else {
$_REQUEST['mobiledetect'] = new Mobile_Detect;
}
if (is_readable($modelPath)) {
include_once($modelPath);
}
App::debugbarTime("model '{$_REQUEST['form']}'");
$custom_nav = CustomNavigationTab::getAllForAccount($account->getId());
$view2HideRightColumns = ['checkout', 'dashboard', 'customerdetails', 'customerorders',
'mydeliveryaddresses', 'emailpreferences', 'mycoupons', 'mycreditcards', 'mypassword',
'customerorderdetails', 'editcustomer', 'adddeliveryaddress',
'editlocation', 'orderconfirmation','viewcart', 'map', 'validatecallback'];
if (in_array($_REQUEST['form'], $view2HideRightColumns)) {
$hideRightColumn = true;
}
$myAccountPages = ['accountsettings', 'dashboard', 'customerdetails', 'customerorders', 'editaddress', 'editcustomer', 'mydeliveryaddresses', 'editlocation', 'emailpreferences', 'mycoupons', 'mycreditcards', 'mypassword', 'adddeliveryaddress', 'map', 'myloyalty'];
if (in_array($_REQUEST['form'], $myAccountPages)) {
$isMyAccountPage = true;
}
if (!isset($cart) || !is_object($cart)) {
$GLOBALS['cart'] = \Cart::getCurrent();
Arguments
"/home/deploy/EHungry-8-simon/Web/model3.0/customer/ordering3.php"
/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"