RedisException
Stack frames (12)
11
RedisException
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/Cache.class.php
69
10
Redis
setex
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/Cache.class.php
69
9
Cache
Set
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/Cache.class.php
57
8
Cache
SetArray
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/DbFields.php
53
7
DbFields
getFields
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/BaseClass.class.php
474
6
BaseClass
setAttribute
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/BaseClass.class.php
157
5
BaseClass
__construct
…
/vendor
/illuminate
/database
/Eloquent
/Model.php
1386
4
Illuminate
\Database
\Eloquent
\Model
__callStatic
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/Policy.php
116
3
Policy
getResellerPolicy
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/Policy.php
92
2
Policy
getPolicyForCustomer
/
home
/deploy
/EHungry-9-boyan
/Web
/view3.0
/customer
/privacy.php
2
1
include_once
/
home
/deploy
/EHungry-9-boyan
/Web
/controllers
/customer.php
874
0
require
/
home
/deploy
/EHungry-9-boyan
/Web
/index.php
30
/
home
/deploy
/EHungry-9-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-9-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
"describe_policy_1"86400"a:7:{s:2:"id";s:1:"N";s:4:"type";s:1:"E";s:7:"type_id";s:1:"N";s:11:"policy_type";s:1:"E";s:5:"level";s:1:"E";s:6:"method";s:1:"E";s:6:"policy";s:1:"S";}"
/
home
/deploy
/EHungry-9-boyan
/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
"describe_policy_1""a:7:{s:2:"id";s:1:"N";s:4:"type";s:1:"E";s:7:"type_id";s:1:"N";s:11:"policy_type";s:1:"E";s:5:"level";s:1:"E";s:6:"method";s:1:"E";s:6:"policy";s:1:"S";}"86400
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/DbFields.php
$this->table = $table;
}
public function getFields($withTypes = false):array {
//FIXME: workaround for BaseClass objects that are not present in the database. check BaseClass::NO_TABLE
if (!$this->table) {
return [];
}
if (!$this->typesCache) { //not in the local cache, let's fetch it
$cacheKey = "describe_{$this->table}_1"; //this "1" meant "include ID" in the old code
//TODO: replace with Cache::Remember
$this->typesCache = Cache::GetArray($cacheKey);
if (!$this->typesCache || self::SKIP_CACHE) { //not in the cache either, let's generate it
$this->typesCache = collect(DB::select("DESCRIBE $this->table"))
->pluck('Type', 'Field')
->transform(['DbFields','simplifyType'])
->all();
Cache::SetArray($cacheKey, $this->typesCache);
}
}
if (!$this->fieldsCache && !$withTypes) {
$this->fieldsCache = array_keys($this->typesCache);
}
return $withTypes? $this->typesCache : $this->fieldsCache;
}
/**
* Separates all attributes into custom and pure fields (those present on the database table).
* @param array $values
* @return array 0 => custom fields, 1 => pure fields
*/
public function splitCustom(array $values) {
$tableFields = array_flip($this->getFields());
$customFields = array_diff_key($values, $tableFields);
$pureFields = array_intersect_key($values, $tableFields);
Arguments
"describe_policy_1"array:7 [ "id" => "N" "type" => "E" "type_id" => "N" "policy_type" => "E" "level" => "E" "method" => "E" "policy" => "S" ]
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/BaseClass.class.php
* Checks for either legacy or Laravel-style getters (getField() or getFieldAttribute()).
* @param string $key
* @return string
*/
private function findAnyGetMutator($key):string {
return $this->findAnyMutator('get', $key);
}
public function setAttribute($key, $value) {
if ($key == 'key_name' && in_array($key, $this->fields()->getFields())) {
//TODO: another special case, there's a field with the same name as the setter for the Eloquent PK at TemplateAccountSettings
return parent::setAttribute($key, $value);
}
//first we check for the mutated setters
if ($setter = $this->findAnySetMutator($key)) {
return $this->$setter($value);
}
if (in_array($key, $this->fields()->getFields()) || array_key_exists($key, $this->attributes)) {
//this is an existing database field, so let's set it as an attribute
return parent::setAttribute($key, $value);
} elseif (property_exists($this, $key)) {
//support for legacy setter of custom props
return $this->$key = $value;
} else {
//probably a custom prop (sometimes used in legacy code), so let's set it directly on the object as usual
if (DevLevel > 0) {
trigger_error('Custom property set at '.static::class.": $key", E_USER_NOTICE);
}
return $this->$key = $value;
}
}
/**
* Sets the "created_at" field, similarly to {@link HasTimestamps::setCreatedAt()}.
*
* We had to override this method because of the legacy setters, as follows: Eloquent is based on setXyzAttribute()
* setters, but we also allow setXyz() for legacy reasons, and this happens at {@link setAttribute()}. When
* {@link updateTimestamps()} is called, it calls setUpdateAt() (which works fine because our configured field is
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/BaseClass.class.php
*/
protected static $restaurantDates = [];
/**
* @param int|array|ParameterHandler $idOrAttr An ID, so the entry is loaded from the database, or a list of attributes to be pre-filled into a new entry.
*/
public function __construct($idOrAttr = null) {
if (is_numeric($idOrAttr)) {
//legacy behavior
if ($entry = static::find($idOrAttr)) {
//TODO: find a way to have default attributes respected in the same way Eloquent does - probably a mix of array_merge() and array_filter() (so we clear empty values from the found entry), or maybe we'll need a custom merger so the final attribute array doesn't miss any field
$this->setRawAttributes($entry->attributes, true);
$this->exists = true;
}
$this->setAttribute('id', $idOrAttr);
parent::__construct();
} elseif (is_array($idOrAttr) || $idOrAttr instanceof ParameterHandler) {
parent::__construct($idOrAttr); //default Eloquent behavior + our custom fill()
} else {
$this->setAttribute('id', -1); //FIXME: legacy behavior as well... can we ditch this someday please????
parent::__construct();
}
}
/**
* We've overwritten the original query builder to include extra methods :)
* @param \Illuminate\Database\Query\Builder $query
* @return Builder|EloquentModel|eHungry\Illuminate\Database\Eloquent\Builder
*/
public function newEloquentBuilder($query) {
return new eHungry\Illuminate\Database\Eloquent\Builder($query);
}
protected static function boot() {
parent::boot();
//Registering events in a better way - https://laravel.com/docs/5.7/eloquent#events
//Based on the Ardent implementation (https://goo.gl/ieFB59), taken from Yii/Rails models
$eventTypes = ['sav', 'creat', 'updat', 'delet', 'restor', 'retriev'];
$tenses = ['ing', 'ed']; //There's NO retrieving event! a check was not placed here for performance
Arguments
"id"-1
/
home
/deploy
/EHungry-9-boyan
/PHP
/vendor
/illuminate
/database
/Eloquent
/Model.php
*/
public function __call($method, $parameters)
{
if (in_array($method, ['increment', 'decrement'])) {
return $this->$method(...$parameters);
}
return $this->newQuery()->$method(...$parameters);
}
/**
* Handle dynamic static method calls into the method.
*
* @param string $method
* @param array $parameters
* @return mixed
*/
public static function __callStatic($method, $parameters)
{
return (new static)->$method(...$parameters);
}
/**
* Convert the model to its string representation.
*
* @return string
*/
public function __toString()
{
return $this->toJson();
}
/**
* When a model is being unserialized, check if it needs to be booted.
*
* @return void
*/
public function __wakeup()
{
$this->bootIfNotBooted();
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/Policy.php
->where('type', self::TYPE_ACCOUNT)
->where('type_id', $account->id)
->value('policy');
if ($restaurantPolicy) {
$policy .= '<hr>'.$restaurantPolicy;
}
}
return strtr($policy, self::macros($account->reseller, $account));
}
/**
* @param ResellerUser|null $reseller
* @param string $policyType
* @param string $level
*/
private static function getResellerPolicy($reseller, string $policyType, string $level) {
if (is_object($reseller)) {
$resellerPolicy = self::select(['policy', 'method'])
->where('policy_type', $policyType)
->where('level', $level)
->where('type', self::TYPE_RESELLER)
->where('type_id', $reseller->id)
->first();
}
//if no specific reseller policy or appending reseller policy, get default policy
if (!isset($resellerPolicy) || $resellerPolicy->method == self::METHOD_APPEND) {
$policy = self::where('policy_type', $policyType)
->where('level', $level)
->where('type', self::TYPE_RCS)
->value('policy');
if (isset($resellerPolicy)) { //if reseller policy here, must be METHOD_APPEND, so add
$policy .= '<hr>'.$resellerPolicy->policy;
}
} else {
$policy = $resellerPolicy->policy;
}
return $policy;
Arguments
"select"array:1 [ 0 => array:2 [ 0 => "policy" 1 => "method" ] ]
/
home
/deploy
/EHungry-9-boyan
/Web
/classes
/Policy.php
if ($policyType == self::POLICY_ACCESSIBILITY) {
$policy = self::getAccessibilityPolicy();
} else {
$policy = self::getResellerPolicy($reseller, $policyType, self::LEVEL_ADMIN);
}
return strtr($policy, self::macros($reseller, $account));
}
/**
* @param string $policyType {@see self::POLICIES}
* @param Account $account
*/
public static function getPolicyForCustomer(string $policyType, Account $account) {
if (!in_array($policyType, self::POLICIES)) {
return 'Invalid policy';
}
if ($policyType == self::POLICY_ACCESSIBILITY) {
$policy = self::getAccessibilityPolicy();
} else {
$policy = self::getResellerPolicy($account->reseller, $policyType, self::LEVEL_CUSTOMER);
$restaurantPolicy =
self::where('policy_type', $policyType)
->where('level', self::LEVEL_CUSTOMER)
->where('type', self::TYPE_ACCOUNT)
->where('type_id', $account->id)
->value('policy');
if ($restaurantPolicy) {
$policy .= '<hr>'.$restaurantPolicy;
}
}
return strtr($policy, self::macros($account->reseller, $account));
}
/**
* @param ResellerUser|null $reseller
* @param string $policyType
* @param string $level
Arguments
ResellerUser {}"privacy_policy""customer"
/
home
/deploy
/EHungry-9-boyan
/Web
/view3.0
/customer
/privacy.php
<? echo Policy::getPolicyForCustomer(Policy::POLICY_PRIVACY, $account);
Arguments
"privacy_policy"Account {}
/
home
/deploy
/EHungry-9-boyan
/Web
/controllers
/customer.php
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();
//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";
}
Arguments
"/home/deploy/EHungry-9-boyan/Web/view3.0/customer/privacy.php"
/
home
/deploy
/EHungry-9-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-9-boyan/Web/controllers/customer.php"
Environment & details:
| Key | Value |
| aid | "restaurant/kingchefnorthmiami/privacy"
|
empty
empty
| Key | Value |
| PHPSESSID | "g1m47mktp2d599h2eu08h6hitk"
|
| Key | Value |
| loc | "en_US"
|
| customer_account_id | 15807
|
| cart | Cart {}
|
| restaurant_id | 10171
|
| app_banner_shown | true
|
| menu_id | 12806
|
| Key | Value |
| UNIQUE_ID | "aX-GXOehoh7CVEbc75XnmAAAAAI"
|
| SCRIPT_URL | "/restaurant/kingchefnorthmiami/privacy"
|
| SCRIPT_URI | "http://www.springroll.com.9.boyan.ehungry.net/restaurant/kingchefnorthmiami/privacy"
|
| HTTP_HOST | "www.springroll.com.9.boyan.ehungry.net"
|
| HTTP_X_REAL_IP | "216.73.216.34"
|
| HTTP_X_FORWARDED_FOR | "216.73.216.34"
|
| HTTP_X_CONFKEY | "Main_Domain:6462"
|
| HTTP_SCHEME | "https"
|
| HTTP_EHENV | "TODO"
|
| HTTP_CONNECTION | "close"
|
| HTTP_ACCEPT | "*/*"
|
| HTTP_USER_AGENT | "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
|
| HTTP_ACCEPT_ENCODING | "gzip, br, zstd, deflate"
|
| HTTP_COOKIE | "PHPSESSID=g1m47mktp2d599h2eu08h6hitk"
|
| PATH | "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
|
| SERVER_SIGNATURE | "" |
| SERVER_SOFTWARE | "Apache/2.4.66 () mod_wsgi/4.6.5 Python/3.7 PHP/7.2.34"
|
| SERVER_NAME | "www.springroll.com.9.boyan.ehungry.net"
|
| SERVER_ADDR | "127.0.0.1"
|
| SERVER_PORT | "80"
|
| REMOTE_ADDR | "127.0.0.1"
|
| DOCUMENT_ROOT | "/home/deploy/EHungry-9-boyan/Web"
|
| REQUEST_SCHEME | "http"
|
| CONTEXT_PREFIX | "" |
| CONTEXT_DOCUMENT_ROOT | "/home/deploy/EHungry-9-boyan/Web"
|
| SERVER_ADMIN | "root@localhost"
|
| SCRIPT_FILENAME | "/home/deploy/EHungry-9-boyan/Web/index.php"
|
| REMOTE_PORT | "38530"
|
| GATEWAY_INTERFACE | "CGI/1.1"
|
| SERVER_PROTOCOL | "HTTP/1.0"
|
| REQUEST_METHOD | "GET"
|
| QUERY_STRING | "aid=restaurant/kingchefnorthmiami/privacy"
|
| REQUEST_URI | "/restaurant/kingchefnorthmiami/privacy"
|
| SCRIPT_NAME | "/restaurant/kingchefnorthmiami/privacy"
|
| PHP_SELF | "/restaurant/kingchefnorthmiami/privacy"
|
| REQUEST_TIME_FLOAT | 1769965148.145
|
| REQUEST_TIME | 1769965148
|
empty
0. Whoops\Handler\PrettyPageHandler
Fatal error: Uncaught RedisException: 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. in [no active file]:0 Stack trace: #0 {main} thrown in [no active file] on line 0