/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
"mim_prices_1897819_10710_ASC_1_0"
86400
"a:1:{i:0;O:13:"MenuItemPrice":28:{s:10:"\x00*\x00guarded";a:0:{}s:9:"\x00*\x00hidden";a:5:{i:0;s:13:"phonetic_name";i:1;s:16:"nutritional_info";i:2;s:26:"price_value_by_extra_count";i:3;s:11:"is_selected";i:4;s:12:"menu_item_id";}s:8:"\x00*\x00casts";a:1:{s:8:"is_shown";s:7:"boolean";}s:13:"\x00*\x00attributes";a:11:{s:2:"id";i:2798087;s:12:"menu_item_id";i:1897819;s:12:"display_name";s:17:"540. Moo Shu Pork";s:11:"price_value";i:1445;s:8:"is_shown";i:1;s:7:"menu_id";i:10710;s:14:"price_position";i:1;s:13:"phonetic_name";s:0:"";s:11:"is_selected";i:0;s:26:"price_value_by_extra_count";s:0:"";s:16:"nutritional_info";s:0:"";}s:18:"originalPriceValue";N;s:13:"priceOverride";N;s:12:"pdfPageCount";i:0;s:10:"timestamps";b:0;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:11:"\x00*\x00original";a:11:{s:2:"id";i:2798087;s:12:"menu_item_id";i:1897819;s:12:"display_name";s:17:"540. Moo Shu Pork";s:11:"price_value";i:1445;s:8:"is_shown";i:1;s:7:"menu_id";i:10710;s:14:"price_position";i:1;s:13:"phonetic_name";s:0:"";s:11:"is_selected";i:0;s:26:"price_value_by_extra_count";s:0:"";s:16:"nutritional_info";s: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:{}}}"
/home
/deploy
/EHungry-8-simon
/Web
/classes
/Cache.class.php
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;
}
public static function Exists(...$key):?bool {
if ($i = static::getInstance()) {
return $i->exists($key);
Arguments
"mim_prices_1897819_10710_ASC_1_0"
"a:1:{i:0;O:13:"MenuItemPrice":28:{s:10:"\x00*\x00guarded";a:0:{}s:9:"\x00*\x00hidden";a:5:{i:0;s:13:"phonetic_name";i:1;s:16:"nutritional_info";i:2;s:26:"price_value_by_extra_count";i:3;s:11:"is_selected";i:4;s:12:"menu_item_id";}s:8:"\x00*\x00casts";a:1:{s:8:"is_shown";s:7:"boolean";}s:13:"\x00*\x00attributes";a:11:{s:2:"id";i:2798087;s:12:"menu_item_id";i:1897819;s:12:"display_name";s:17:"540. Moo Shu Pork";s:11:"price_value";i:1445;s:8:"is_shown";i:1;s:7:"menu_id";i:10710;s:14:"price_position";i:1;s:13:"phonetic_name";s:0:"";s:11:"is_selected";i:0;s:26:"price_value_by_extra_count";s:0:"";s:16:"nutritional_info";s:0:"";}s:18:"originalPriceValue";N;s:13:"priceOverride";N;s:12:"pdfPageCount";i:0;s:10:"timestamps";b:0;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:11:"\x00*\x00original";a:11:{s:2:"id";i:2798087;s:12:"menu_item_id";i:1897819;s:12:"display_name";s:17:"540. Moo Shu Pork";s:11:"price_value";i:1445;s:8:"is_shown";i:1;s:7:"menu_id";i:10710;s:14:"price_position";i:1;s:13:"phonetic_name";s:0:"";s:11:"is_selected";i:0;s:26:"price_value_by_extra_count";s:0:"";s:16:"nutritional_info";s: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:{}}}"
86400
/home
/deploy
/EHungry-8-simon
/Web
/classes
/MenuItem.class.php
if ($co) {
$this->prices = $co;
} else {
$db_conn = DB::conn();
$this->prices = [];
$shownWhere = $is_shown_only ? ' AND is_shown = 1 ' : '';
$zeroWhere = $includeZeroDollarPrices ?'':' AND price_value > 0';
$sql = "SELECT * FROM ".MenuItemPrice::getTableName()." WHERE menu_item_id = ? AND menu_id = ? $shownWhere $zeroWhere ORDER BY price_position, price_value $sort_order";
$db_conn->bindParameter($sql, 1, $this->getId(), "integer");
$db_conn->bindParameter($sql, 1, $mid, "integer");
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
while ($row = $result->fetch()) {
$p = new MenuItemPrice();
$p->addHidden(['menu_item_id']); //Not needed when inside MenuItem - only affects API (serialization in general)
$p->loadFromArray($row);
$this->prices[] = $p;
}
}
Cache::SetArray($cacheKey, $this->prices);
}
return $this->prices;
}
public function loadAllPrices() {
$db_conn = DB::conn();
$this->prices = array();
$sql = "SELECT * FROM ".MenuItemPrice::getTableName()." WHERE menu_item_id = ? AND is_shown = 1 ORDER BY menu_item_id, price_position, price_value";
$db_conn->bindParameter($sql, 1, $this->getId(), "integer");
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
while ($row = $result->fetch()) {
$p = new MenuItemPrice();
$p->loadFromArray($row, true);
$this->prices[] = $p;
}
}
return $this->prices;
}
Arguments
"mim_prices_1897819_10710_ASC_1_0"
array:1 [
0 => MenuItemPrice {}
]
/home
/deploy
/EHungry-8-simon
/Web
/classes
/Category.class.php
return $result->rowCount();
}
while ($row = $result->fetch()) {
$item = new MenuItem();
if ($row['default_image']) {
$image = MenuItemImage::getDefaultByMenuItem($row['id']);
$item->setDefaultImage($image);
} else {
unset($row['default_image']);
unset($row['is_url']);
}
$item->forceFill($row);
$item->syncOriginal();
$item->exists = true;
$item->priority = $row['priority']; //adding the bonus field from the query
if ($notShown || $item->getIsShown() || (isLoggedAsAdmin() && $item->getIsShownToEmployees())) {
$mid = $mid?: $_SESSION["menu_id"];
$item->loadPricesFromMenu($mid, 'ASC', true, $displayZeroDollarItems);
if ($withNoPrices || count($item->getPrices())) {
$arr[$item->getDisplayName().$item->id] = $item;
}
}
}
if (count($arr)) {
if ($alphabetical) {
ksort($arr, SORT_NATURAL);
return array_values($arr);
} else {
return array_values($arr);
}
}
}
return $countOnly? 0 : null;
}
/**
* @return MenuItem|null
Arguments
/home
/deploy
/EHungry-8-simon
/Web
/classes
/Account.class.php
$page_fragment = Category::buildPageFragment($menu, $category, $items, $hidePrices, $sortByCategory, $is_admin);
Cache::Set($cache_key, $page_fragment);
} else {
//echo 'Using cached Category Page Fragement<br />';
}
return $page_fragment;
}
public function getCategoryItems($category, $menu = null, $is_admin = false, $restaurant = null, $sortByCategory = false) {
$cache_key =
($is_admin? 'admin_category_items' : 'category_4.0_items').
"_{$this->getId()}_{$menu->getId()}_{$category->getId()}_".
($sortByCategory? 'cat_' : 'alp_').
$restaurant->getId().
($_SESSION['embed']? '_embed' : '');
$items = Cache::GetArray($cache_key);
if (!$items) {
$items = [];
if ($category->getId() > 0) {
$items = $category->getItems($menu->id, false, false, false, false, false, $is_admin, $this->display_zero_dollar_items);
} elseif (is_object($restaurant)) {
$categories = $menu->getCategoriesForRestaurant($restaurant->getId(), true, false);
$carr = [];
foreach ($categories as $c) {
if ($sortByCategory) {
$items[$c->id] =
$c->getItems($menu->id, false, false, false, false, false, $is_admin, $this->display_zero_dollar_items);
} else {
$carr[] = $c->id;
}
}
if (!$sortByCategory) {
$items = Category::getItemsForCategories(implode(',', $carr), true, $this->display_zero_dollar_items);
}
}
Cache::SetArray($cache_key, $items);
}
return $items;
}
Arguments
10710
false
false
false
false
false
false
0
/home
/deploy
/EHungry-8-simon
/Web
/classes
/Account.class.php
"_{$this->getId()}_{$menu->getId()}_{$cid}_".
($sortByCategory? 'cat_' : 'alp_').
$restaurant->getId().
($_SESSION['embed']? '_embed' : '').
AWS_S3_REGION;
// try to retrieve from the cache server
$page_fragment = Cache::Get($cache_key);
if (!$page_fragment) {
//echo 'Building Category Page Fragment<br />';
if ($cid === -1) {
$category = new Category(-1);
$category->setDisplayName('View All Menu Items');
$category->setMenuId($menu->getId());
} else {
$category = new Category($cid);
}
$items = $this->getCategoryItems($category, $menu, $is_admin, $restaurant, $sortByCategory);
// now build the page fragment
$page_fragment = Category::buildPageFragment($menu, $category, $items, $hidePrices, $sortByCategory, $is_admin);
Cache::Set($cache_key, $page_fragment);
} else {
//echo 'Using cached Category Page Fragement<br />';
}
return $page_fragment;
}
public function getCategoryItems($category, $menu = null, $is_admin = false, $restaurant = null, $sortByCategory = false) {
$cache_key =
($is_admin? 'admin_category_items' : 'category_4.0_items').
"_{$this->getId()}_{$menu->getId()}_{$category->getId()}_".
($sortByCategory? 'cat_' : 'alp_').
$restaurant->getId().
($_SESSION['embed']? '_embed' : '');
$items = Cache::GetArray($cache_key);
if (!$items) {
$items = [];
Arguments
Category {}
Menu {}
false
Restaurant {}
true
/home
/deploy
/EHungry-8-simon
/Web
/model3.0
/customer
/ordering3.php
if (count($menus) == 1) {
$qs = '';
if ($_GET['embed']) {
$qs = '?embed='.$_GET['embed'];
}
redirectToOrdering([$restaurant, reset($menus)], $qs);
}
$_REQUEST['_PAGETITLE'] = 'Choose A Menu';
break;
case 2: //Menu
break;
case 3: //Category
if (isOrderingClosed(CLOSED_MSG_RESTAURANT)) {
$contentAndCartClass = 'contentandcart-category-closed';
}
if (ClosedHours::isCategoryHidden($restaurant, $category) || HolidayHours::isCategoryHidden($restaurant, $category)) {
redirectToOrderingWithError('Sorry, this category is currently unavailable.', [$restaurant, $menu, -1]);
}
$page_fragment = $account->getCategoryPageFragment($menu, $category->getId(), $restaurant->getHideAllPrices(), $restaurant, true);
if (isset($_REQUEST['sort'])) {
if ($_REQUEST['sort'] == "name") {
usort($items, array("MenuItem", "nameAlphaSort"));
} elseif ($_REQUEST['sort'] == "price") {
usort($items, array("MenuItem", "priceSort"));
}
}
break;
case 4: //Item
case 5: //Price
//check if we're closed right now. If so, display warning
if (!isset($_SESSION['time_ok']) && is_object($restaurant)) {
$eot = checkTimeWarning($cart, $restaurant);
}
break;
}
if ($_REQUEST['ordering_level'] < 3 && is_object($menu)) {
if ($account->getDefaultOrderingPage() == 1) {
Arguments
Menu {}
130655
0
Restaurant {}
true
/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"