I'm using ConsoleTrait now, but the error persists. This line in cache.php seems to be the problem, when I comment it out, the problem goes away:
// Dump Cache state
$grav['debugger']->addMessage('Cache: [' . ($this->enabled ? 'true' : 'false') . '] Driver: [' . $this->driver_name . ']');
My cache is overridden though, I've extended cache.php, this is the code:
namespace Grav\Plugin;
use \Doctrine\Common\Cache\Cache as DoctrineCache;
use Grav\Common\Config\Config;
use Grav\Common\Filesystem\Folder;
/*
*/
class OverrideCache extends \Grav\Common\Cache
{
/**
*
* Set static variables in parent class cache.php
*
*/
public function setCacheRemove($caches)
{
if(!empty($caches)){
parent::$standard_remove = $caches;
}
else{
parent::$standard_remove = [
'cache://twig/',
'cache://doctrine/',
'cache://compiled/',
'cache://validated-',
'asset://',
];
}
}
/**
*
* Prevent images from being flushed on any cache flush
*
*/
public function overrideAllCaches($caches)
{
if(!empty($caches)){
parent::$standard_remove =
parent::$all_remove =
parent::$assets_remove =
parent::$images_remove =
parent::$cache_remove =
$caches;
}
else{
parent::$standard_remove =
parent::$all_remove =
parent::$assets_remove =
parent::$images_remove =
parent::$cache_remove =
[
'cache://twig/',
'cache://doctrine/',
'cache://compiled/',
'cache://validated-',
'asset://',
];
}
}
}
Seems to be the get method on the config object in Grav\Common\Debugger.php that spawns this error. So in debugger.php my grav object doesn't seem to have the config object, but when I dump it in my console it's present.
makes no difference how I use getGrav(), same error:
$grav = self::getGrav();
$grav = $this->getGrav();