/home
/deploy
/EHungry-9-simon
/Web
/classes
/Cache.class.php
if ($r) {
$uco = unserialize($r);
$typeFunc = 'is_'.$type;
if ($typeFunc($uco) || ($allowNull && is_null($uco))) {
return $uco;
}
}
return $notFoundResult;
}
public static function Get($key) {
if (array_key_exists($key, static::$requestCache)) {
$r = static::$requestCache[$key];
$r = static::afterGet($r);
App::cacheHit($key);
return $r;
}
if ($i = static::getInstance()) {
if ($r = $i->get($key)) {
//if a key has been used more than 3 times, store it in the in-memory request cache.
//We don't store every cache load in-memory, otherwise we might run out of memory on some pages (eg if they load every account)
if (!array_key_exists($key, static::$requestCount)) {
static::$requestCount[$key] = 0;
}
static::$requestCount[$key]++;
if (static::$requestCount[$key] > 3) {
static::$requestCache[$key] = $r;
}
$r = static::afterGet($r);
App::cacheHit($key);
} else {
App::cacheMiss($key);
}
return $r;
}
return false;
}
/**
Arguments
"read error on connection"
/home
/deploy
/EHungry-9-simon
/Web
/classes
/Cache.class.php
if ($r) {
$uco = unserialize($r);
$typeFunc = 'is_'.$type;
if ($typeFunc($uco) || ($allowNull && is_null($uco))) {
return $uco;
}
}
return $notFoundResult;
}
public static function Get($key) {
if (array_key_exists($key, static::$requestCache)) {
$r = static::$requestCache[$key];
$r = static::afterGet($r);
App::cacheHit($key);
return $r;
}
if ($i = static::getInstance()) {
if ($r = $i->get($key)) {
//if a key has been used more than 3 times, store it in the in-memory request cache.
//We don't store every cache load in-memory, otherwise we might run out of memory on some pages (eg if they load every account)
if (!array_key_exists($key, static::$requestCount)) {
static::$requestCount[$key] = 0;
}
static::$requestCount[$key]++;
if (static::$requestCount[$key] > 3) {
static::$requestCache[$key] = $r;
}
$r = static::afterGet($r);
App::cacheHit($key);
} else {
App::cacheMiss($key);
}
return $r;
}
return false;
}
/**
Arguments
/home
/deploy
/EHungry-9-simon
/Web
/classes
/Cache.class.php
* @param string $key
* @param bool $allowNull
* @return bool|array|null
*/
public static function GetArray($key, $allowNull = false) {
return static::GetType('array', $key, $allowNull);
}
/**
* This one can either return a boolean when key is found, or a null if key isn't found. So you need to check the
* result with with is_bool() or is_null().
* @param string $key The key to lookup
* @return bool|null
*/
public static function GetBoolean($key) {
return static::GetType('bool', $key, false, null);
}
private static function GetType($type, $key, $allowNull, $notFoundResult = false) {
$r = static::Get($key);
if ($r) {
$uco = unserialize($r);
$typeFunc = 'is_'.$type;
if ($typeFunc($uco) || ($allowNull && is_null($uco))) {
return $uco;
}
}
return $notFoundResult;
}
public static function Get($key) {
if (array_key_exists($key, static::$requestCache)) {
$r = static::$requestCache[$key];
$r = static::afterGet($r);
App::cacheHit($key);
return $r;
}
if ($i = static::getInstance()) {
if ($r = $i->get($key)) {
Arguments
/home
/deploy
/EHungry-9-simon
/Web
/classes
/Cache.class.php
}
/**
* Returns object if found in cache, otherwise false. Can also return null if found in cache and null allowed
* @param string $key
* @param bool $allowNull
* @return bool|object|null
*/
public static function GetObject($key, $allowNull = false) {
return static::GetType('object', $key, $allowNull);
}
/**
* Returns array if found in cache, otherwise false. Can also return null if found in cache and null allowed
* @param string $key
* @param bool $allowNull
* @return bool|array|null
*/
public static function GetArray($key, $allowNull = false) {
return static::GetType('array', $key, $allowNull);
}
/**
* This one can either return a boolean when key is found, or a null if key isn't found. So you need to check the
* result with with is_bool() or is_null().
* @param string $key The key to lookup
* @return bool|null
*/
public static function GetBoolean($key) {
return static::GetType('bool', $key, false, null);
}
private static function GetType($type, $key, $allowNull, $notFoundResult = false) {
$r = static::Get($key);
if ($r) {
$uco = unserialize($r);
$typeFunc = 'is_'.$type;
if ($typeFunc($uco) || ($allowNull && is_null($uco))) {
return $uco;
}
Arguments
"array"
"navtabs_30063"
false
/home
/deploy
/EHungry-9-simon
/Web
/classes
/CustomNavigationTab.class.php
<?
/**
* @property int $priority
* @property string $display_name
* @property string $url
* @property int $account_id
* @property int $page_id
* @property bool $open_new_tab [default: 0]
*/
class CustomNavigationTab extends BaseClass {
public static function getAllForAccount($aid = -1) {
$cacheKey = 'navtabs_'.$aid;
$co = Cache::GetArray($cacheKey);
if ($co) {
return $co;
}
$db_conn = DB::conn();
$rbs = [];
$sql = "SELECT * FROM ".CustomNavigationTab::getTableName()." WHERE account_id = ? ORDER BY priority ASC";
$db_conn->bindParameter($sql, 1, $aid, "integer");
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
while ($row = $result->fetch()) {
$r = new CustomNavigationTab();
$r->loadFromArray($row, true);
$rbs[] = $r;
}
}
Cache::SetArray($cacheKey, $rbs);
return $rbs;
}
public static function deleteAllForAccount($aid) {
self::where('account_id', $aid)->delete();
Cache::Delete('navtabs_'.$aid);
}
Arguments
/home
/deploy
/EHungry-9-simon
/Web
/controllers
/customer.php
}
$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();
}
//unset callback data in the event someone didn't hit the callback validation page
if (!in_array($_REQUEST['form'], ['checkout', 'nosuchpage', 'validatecallback', 'viewdeliveryzone'])) {
Arguments
/home
/deploy
/EHungry-9-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-9-simon/Web/controllers/customer.php"