/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
"upsell_b_74651"
86400
"b:0;"
/home
/deploy
/EHungry-6-boyan
/Web
/classes
/Cache.class.php
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);
}
return null;
}
Arguments
"upsell_b_74651"
"b:0;"
86400
/home
/deploy
/EHungry-6-boyan
/Web
/classes
/UpsellItem.class.php
public $timestamps = true;
public static function existsForAccount($aid = -1) {
$cacheKey = 'upsell_b_'.$aid;
$co = Cache::GetBoolean($cacheKey);
if (is_bool($co)) {
return $co;
}
$db_conn = DB::conn();
$rbs = array();
$sql = "SELECT id FROM ".UpsellItem::getTableName()." WHERE account_id = ? LIMIT 1";
$db_conn->bindParameter($sql, 1, $aid, "integer");
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
$res = true;
} else {
$res = false;
}
Cache::SetBoolean($cacheKey, $res);
return $res;
}
public static function clearUpsellCache($aid) {
Cache::Delete('upsell_b_'.$aid);
}
public static function getUpsellItemsBasedOnCart($account, $cart, $restaurant) {
if (is_object($cart) && is_object($restaurant)) {
$db_conn = DB::conn();
$upsells = array();
if (UpsellItem::existsForAccount($account->id)) {
$cartItems = $cart->getCartItems();
foreach ($cartItems as $i) {
$sql = "SELECT DISTINCT u.upsell_menu_item_id FROM ".UpsellItem::getTableName()." u, ".CategoryMenuItem::getTableName().
" m, ".Category::getTableName()." c WHERE m.category_id = c.id AND m.menu_item_id = u.upsell_menu_item_id AND c.is_shown = 1 AND c.menu_id = ? AND u.account_id = ? AND u.type = ? AND u.menu_item_id = ?";
$db_conn->bindParameter($sql, 1, $_SESSION['menu_id'], "integer");
$db_conn->bindParameter($sql, 1, $account->id, "integer");
Arguments
/home
/deploy
/EHungry-6-boyan
/Web
/templates3.0
/customer
/footer.php
<? $couponsDisplayed++;
}
if (sizeof($coupons_in_box) > $totalCouponsToDisplay) {
// Then we have more coupons that can be loaded, so we display the "Load More" button
echo '<li><a class="link" id="load-all-btn" role="button">Load All Coupons</a></li>';
} ?>
</ul>
</div>
<? if (is_object($restaurant)) {
if ($restaurant->getCouponGlobalTermsConditions()) {
echo '<em class="inner note">' . $restaurant->getCouponGlobalTermsConditions() .'</em>';
}
} ?>
</div>
<? }
}
if (is_object($account) && (UpsellItem::existsForAccount($account->getId()) || $account->getAutoUpsellEnabled())) {
include(CORE_PATH . "templates3.0/customer/upsells.php");
}
if (isset($_REQUEST['_TEMPLATE_SETTINGS']['advertisement_image'])) {
if (!$_REQUEST['mobiledetect']->isMobile() || $_REQUEST['mobiledetect']->isTablet()) {
if ($_REQUEST['form'] == 'home' || $_REQUEST['form'] == 'ordering3') {
include(CORE_PATH . "templates3.0/customer/widgets/promowidget.php");
}
} else {
include(CORE_PATH . "templates3.0/customer/widgets/promowidget.php");
}
}
if (!$_REQUEST['mobiledetect']->isMobile() || $_REQUEST['mobiledetect']->isTablet()) {
include(CORE_PATH . "templates3.0/customer/widgets/contactwidget.php");
include(CORE_PATH . "templates3.0/customer/widgets/socialwidget.php");
include(CORE_PATH . "templates3.0/customer/widgets/paymentwidget.php");
if (count($templateAppIds) > 0) {
include(CORE_PATH . "templates3.0/customer/widgets/appbannerwidget.php");
}
} ?>
</aside>
Arguments
/home
/deploy
/EHungry-6-boyan
/Web
/controllers
/customer.php
$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();
//FIXME: it's technically possible to end up with $template = null
if (!$_REQUEST['contentonly']) {
$template = !isset($_REQUEST["altdoc"])? "app/$part" : "app/alt$part";
}
} else {
$template = !isset($_REQUEST["altdoc"])? "customer/$part" : "customer/alt$part";
}
if ($_REQUEST['_VERSION'] == 4) {
return CORE_PATH."templates4.0/$template.php";
} else {
return CORE_PATH."templates3.0/$template.php";
}
Arguments
"/home/deploy/EHungry-6-boyan/Web/templates3.0/customer/footer.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"