Crikey! There was an error...
Whoops \ Exception \ ErrorException (E_WARNING)
file_put_contents(/var/www/resources/logs/popularity/daily.json): failed to open stream: Permission denied Whoops\Exception\ErrorException thrown with message "file_put_contents(/var/www/resources/logs/popularity/daily.json): failed to open stream: Permission denied" Stacktrace: #10 Whoops\Exception\ErrorException in /var/www/resources/user/plugins/admin/classes/popularity.php:108 #9 file_put_contents in /var/www/resources/user/plugins/admin/classes/popularity.php:108 #8 Grav\Plugin\Admin\Popularity:updateDaily in /var/www/resources/user/plugins/admin/classes/popularity.php:77 #7 Grav\Plugin\Admin\Popularity:trackHit in /var/www/resources/user/plugins/admin/admin.php:555 #6 Grav\Plugin\AdminPlugin:onShutdown in /var/www/resources/vendor/symfony/event-dispatcher/EventDispatcher.php:184 #5 call_user_func in /var/www/resources/vendor/symfony/event-dispatcher/EventDispatcher.php:184 #4 Symfony\Component\EventDispatcher\EventDispatcher:doDispatch in /var/www/resources/vendor/symfony/event-dispatcher/EventDispatcher.php:46 #3 Symfony\Component\EventDispatcher\EventDispatcher:dispatch in /var/www/resources/vendor/rockettheme/toolbox/Event/src/EventDispatcher.php:23 #2 RocketTheme\Toolbox\Event\EventDispatcher:dispatch in /var/www/resources/system/src/Grav/Common/Grav.php:283 #1 Grav\Common\Grav:fireEvent in /var/www/resources/system/src/Grav/Common/Grav.php:339 #0 Grav\Common\Grav:shutdown in [internal]:0
Stack frames (11)
10
Whoops
\
Exception
\
ErrorException
/
user
/
plugins
/
admin
/
classes
/
popularity.php
108
9
file_put_contents
/
user
/
plugins
/
admin
/
classes
/
popularity.php
108
8
Grav
\
Plugin
\
Admin
\
Popularity
updateDaily
/
user
/
plugins
/
admin
/
classes
/
popularity.php
77
7
Grav
\
Plugin
\
Admin
\
Popularity
trackHit
/
user
/
plugins
/
admin
/
admin.php
555
6
Grav
\
Plugin
\
AdminPlugin
onShutdown
/
vendor
/
symfony
/
event-dispatcher
/
EventDispatcher.php
184
5
call_user_func
/
vendor
/
symfony
/
event-dispatcher
/
EventDispatcher.php
184
4
Symfony
\
Component
\
EventDispatcher
\
EventDispatcher
doDispatch
/
vendor
/
symfony
/
event-dispatcher
/
EventDispatcher.php
46
3
Symfony
\
Component
\
EventDispatcher
\
EventDispatcher
dispatch
/
vendor
/
rockettheme
/
toolbox
/
Event
/
src
/
EventDispatcher.php
23
2
RocketTheme
\
Toolbox
\
Event
\
EventDispatcher
dispatch
/
system
/
src
/
Grav
/
Common
/
Grav.php
283
1
Grav
\
Common
\
Grav
fireEvent
/
system
/
src
/
Grav
/
Common
/
Grav.php
339
0
Grav
\
Common
\
Grav
shutdown
[internal]
0
/
var
/
www
/
resources
/
user
/
plugins
/
admin
/
classes
/
popularity.php
        }
 
        $day_month_year = date(self::DAILY_FORMAT);
 
        / get the daily access count
        if (array_key_exists($day_month_year, $this->daily_data)) {
            $this->daily_data[$day_month_year] = intval($this->daily_data[$day_month_year]) + 1;
        } else {
            $this->daily_data[$day_month_year] = 1;
        }
 
        / keep correct number as set by history
        $count = intval($this->config->get('plugins.admin.popularity.history.daily', 30));
        $total = count($this->daily_data);
 
        if ($total > $count) {
            $this->daily_data = array_slice($this->daily_data, -$count, $count, true);
        }
 
        file_put_contents($this->daily_file, json_encode($this->daily_data));
    }
 
    /**
     * @return array
     */
    public function getDailyChartData()
    {
        if (!$this->daily_data) {
            $this->daily_data = $this->getData($this->daily_file);
        }
 
        $limit      = intval($this->config->get('plugins.admin.popularity.dashboard.days_of_stats', 7));
        $chart_data = array_slice($this->daily_data, -$limit, $limit);
 
        $labels = [];
        $data   = [];
 
        foreach ($chart_data as $date => $count) {
            $labels[] = Grav::instance()['grav']['admin']->translate([
                'PLUGIN_ADMIN.' . strtoupper(date('D', strtotime($date)))]) .
Arguments
  1. "file_put_contents(/var/www/resources/logs/popularity/daily.json): failed to open stream: Permission denied"
    
/
var
/
www
/
resources
/
user
/
plugins
/
admin
/
classes
/
popularity.php
        }
 
        $day_month_year = date(self::DAILY_FORMAT);
 
        / get the daily access count
        if (array_key_exists($day_month_year, $this->daily_data)) {
            $this->daily_data[$day_month_year] = intval($this->daily_data[$day_month_year]) + 1;
        } else {
            $this->daily_data[$day_month_year] = 1;
        }
 
        / keep correct number as set by history
        $count = intval($this->config->get('plugins.admin.popularity.history.daily', 30));
        $total = count($this->daily_data);
 
        if ($total > $count) {
            $this->daily_data = array_slice($this->daily_data, -$count, $count, true);
        }
 
        file_put_contents($this->daily_file, json_encode($this->daily_data));
    }
 
    /**
     * @return array
     */
    public function getDailyChartData()
    {
        if (!$this->daily_data) {
            $this->daily_data = $this->getData($this->daily_file);
        }
 
        $limit      = intval($this->config->get('plugins.admin.popularity.dashboard.days_of_stats', 7));
        $chart_data = array_slice($this->daily_data, -$limit, $limit);
 
        $labels = [];
        $data   = [];
 
        foreach ($chart_data as $date => $count) {
            $labels[] = Grav::instance()['grav']['admin']->translate([
                'PLUGIN_ADMIN.' . strtoupper(date('D', strtotime($date)))]) .
Arguments
  1. "/var/www/resources/logs/popularity/daily.json"
    
  2. "{"31-08-2017":19,"05-09-2017":17,"08-09-2017":16,"03-10-2017":5,"12-10-2017":1,"13-10-2017":14,"14-10-2017":1,"16-10-2017":2,"17-10-2017":1,"18-10-2017":3,"26-10-2017":24,"27-10-2017":84,"30-10-2017":19,"31-10-2017":1,"02-11-2017":20,"03-11-2017":7,"06-11-2017":58,"09-11-2017":14,"01-12-2017":17,"06-12-2017":7,"11-12-2017":2,"23-02-2018":1,"27-02-2018":2,"01-03-2018":4,"02-03-2018":5,"06-03-2018":4,"07-03-2018":1,"20-03-2018":6,"09-04-2018":1,"24-09-2018":1}"
    
/
var
/
www
/
resources
/
user
/
plugins
/
admin
/
classes
/
popularity.php
        / Don't track error pages or pages that have no route
        if ($page->template() == 'error' || !$page->route()) {
            return;
        }
 
        / Make sure no 'widcard-style' ignore matches this url
        foreach ((array)$this->config->get('plugins.admin.popularity.ignore') as $ignore) {
            if (fnmatch($ignore, $relative_url)) {
                return;
            }
        }
 
        / initial creation if it doesn't exist
        if (!file_exists($this->data_path)) {
            mkdir($this->data_path);
            $this->flushPopularity();
        }
 
        / Update the data we want to track
        $this->updateDaily();
        $this->updateMonthly();
        $this->updateTotals($page->route());
        $this->updateVisitors(Grav::instance()['uri']->ip());
 
    }
 
    protected function updateDaily()
    {
 
        if (!$this->daily_data) {
            $this->daily_data = $this->getData($this->daily_file);
        }
 
        $day_month_year = date(self::DAILY_FORMAT);
 
        / get the daily access count
        if (array_key_exists($day_month_year, $this->daily_data)) {
            $this->daily_data[$day_month_year] = intval($this->daily_data[$day_month_year]) + 1;
        } else {
            $this->daily_data[$day_month_year] = 1;
/
var
/
www
/
resources
/
user
/
plugins
/
admin
/
admin.php
 
        if (isset($flashData->message)) {
            $this->grav['messages']->add($flashData->message, $flashData->status);
        }
    }
 
    /**
     * Handles the shutdown
     */
    public function onShutdown()
    {
        if ($this->active) {
            /only activate when Admin is active
            if ($this->admin->shouldLoadAdditionalFilesInBackground()) {
                $this->admin->loadAdditionalFilesInBackground();
            }
        } else {
            /if popularity is enabled, track non-admin hits
            if ($this->config->get('plugins.admin.popularity.enabled')) {
                $this->popularity->trackHit();
            }
        }
    }
 
    /**
     * Get list of form field types specified in this plugin. Only special types needs to be listed.
     *
     * @return array
     */
    public function getFormFieldTypes()
    {
        return [
            'column'   => [
                'input@' => false
            ],
            'columns'  => [
                'input@' => false
            ],
            'fieldset' => [
                'input@' => false
/
var
/
www
/
resources
/
vendor
/
symfony
/
event-dispatcher
/
EventDispatcher.php
        }
    }
 
    /**
     * Triggers the listeners of an event.
     *
     * This method can be overridden to add functionality that is executed
     * for each listener.
     *
     * @param callable[] $listeners The event listeners
     * @param string     $eventName The name of the event to dispatch
     * @param Event      $event     The event object to pass to the event handlers/listeners
     */
    protected function doDispatch($listeners, $eventName, Event $event)
    {
        foreach ($listeners as $listener) {
            if ($event->isPropagationStopped()) {
                break;
            }
            call_user_func($listener, $event, $eventName, $this);
        }
    }
 
    /**
     * Sorts the internal list of listeners for the given event by priority.
     *
     * @param string $eventName The name of the event
     */
    private function sortListeners($eventName)
    {
        krsort($this->listeners[$eventName]);
        $this->sorted[$eventName] = call_user_func_array('array_merge', $this->listeners[$eventName]);
    }
}
 
Arguments
  1. Event {}
    
  2. "onShutdown"
    
  3. EventDispatcher {}
    
/
var
/
www
/
resources
/
vendor
/
symfony
/
event-dispatcher
/
EventDispatcher.php
        }
    }
 
    /**
     * Triggers the listeners of an event.
     *
     * This method can be overridden to add functionality that is executed
     * for each listener.
     *
     * @param callable[] $listeners The event listeners
     * @param string     $eventName The name of the event to dispatch
     * @param Event      $event     The event object to pass to the event handlers/listeners
     */
    protected function doDispatch($listeners, $eventName, Event $event)
    {
        foreach ($listeners as $listener) {
            if ($event->isPropagationStopped()) {
                break;
            }
            call_user_func($listener, $event, $eventName, $this);
        }
    }
 
    /**
     * Sorts the internal list of listeners for the given event by priority.
     *
     * @param string $eventName The name of the event
     */
    private function sortListeners($eventName)
    {
        krsort($this->listeners[$eventName]);
        $this->sorted[$eventName] = call_user_func_array('array_merge', $this->listeners[$eventName]);
    }
}
 
Arguments
  1. array:2 [
      0 => AdminPlugin {}
      1 => "onShutdown"
    ]
    
  2. Event {}
    
  3. "onShutdown"
    
  4. EventDispatcher {}
    
/
var
/
www
/
resources
/
vendor
/
symfony
/
event-dispatcher
/
EventDispatcher.php
 */
class EventDispatcher implements EventDispatcherInterface
{
    private $listeners = array();
    private $sorted = array();
 
    /**
     * {@inheritdoc}
     */
    public function dispatch($eventName, Event $event = null)
    {
        if (null === $event) {
            $event = new Event();
        }
 
        $event->setDispatcher($this);
        $event->setName($eventName);
 
        if ($listeners = $this->getListeners($eventName)) {
            $this->doDispatch($listeners, $eventName, $event);
        }
 
        return $event;
    }
 
    /**
     * {@inheritdoc}
     */
    public function getListeners($eventName = null)
    {
        if (null !== $eventName) {
            if (!isset($this->listeners[$eventName])) {
                return array();
            }
 
            if (!isset($this->sorted[$eventName])) {
                $this->sortListeners($eventName);
            }
 
            return $this->sorted[$eventName];
Arguments
  1. array:1 [
      0 => array:2 [
        0 => AdminPlugin {}
        1 => "onShutdown"
      ]
    ]
    
  2. "onShutdown"
    
  3. Event {}
    
/
var
/
www
/
resources
/
vendor
/
rockettheme
/
toolbox
/
Event
/
src
/
EventDispatcher.php
use Symfony\Component\EventDispatcher\Event as BaseEvent;
use Symfony\Component\EventDispatcher\EventDispatcher as BaseEventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
/**
 * Implements Symfony EventDispatcher interface.
 *
 * @package RocketTheme\Toolbox\Event
 * @author RocketTheme
 * @license MIT
 */
class EventDispatcher extends BaseEventDispatcher implements EventDispatcherInterface
{
    public function dispatch($eventName, BaseEvent $event = null)
    {
        if (null === $event) {
            $event = new Event();
        }
 
        return parent::dispatch($eventName, $event);
    }
}
 
Arguments
  1. "onShutdown"
    
  2. Event {}
    
/
var
/
www
/
resources
/
system
/
src
/
Grav
/
Common
/
Grav.php
        / Vary: Accept-Encoding
        if ($this['config']->get('system.pages.vary_accept_encoding', false)) {
            header('Vary: Accept-Encoding');
        }
    }
 
    /**
     * Fires an event with optional parameters.
     *
     * @param  string $eventName
     * @param  Event  $event
     *
     * @return Event
     */
    public function fireEvent($eventName, Event $event = null)
    {
        /** @var EventDispatcher $events */
        $events = $this['events'];
 
        return $events->dispatch($eventName, $event);
    }
 
    /**
     * Set the final content length for the page and flush the buffer
     *
     */
    public function shutdown()
    {
        / Prevent user abort allowing onShutdown event to run without interruptions.
        if (function_exists('ignore_user_abort')) {
            @ignore_user_abort(true);
        }
 
        / Close the session allowing new requests to be handled.
        if (isset($this['session'])) {
            $this['session']->close();
        }
 
        if ($this['config']->get('system.debugger.shutdown.close_connection', true)) {
            / Flush the response and close the connection to allow time consuming tasks to be performed without leaving
Arguments
  1. "onShutdown"
    
  2. Event {}
    
/
var
/
www
/
resources
/
system
/
src
/
Grav
/
Common
/
Grav.php
                        header('Content-Encoding: identity');
                    } else {
                        header('Content-Encoding: none');
                    }
 
                }
 
 
                / Get length and close the connection.
                header('Content-Length: ' . ob_get_length());
                header("Connection: close");
 
                ob_end_flush();
                @ob_flush();
                flush();
            }
        }
 
        / Run any time consuming tasks.
        $this->fireEvent('onShutdown');
    }
 
    /**
     * Magic Catch All Function
     * Used to call closures like measureTime on the instance.
     * Source: /stackoverflow.com/questions/419804/closures-as-class-members
     */
    public function __call($method, $args)
    {
        $closure = $this->$method;
        call_user_func_array($closure, $args);
    }
 
    /**
     * Initialize and return a Grav instance
     *
     * @param  array $values
     *
     * @return static
     */
Arguments
  1. "onShutdown"
    
[internal]

Environment & details:

empty
empty
empty
empty
Key Value
redirect_after_login
"/"
user
User {}
Key Value
HTTPS
"on"
HTTP_HOST
"199.175.26.22:443"
HTTP_CONNECTION
"close"
HTTP_ACCEPT_ENCODING
"gzip"
HTTP_USER_AGENT
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
SERVER_SIGNATURE
"<address>Apache/2.4.25 (Debian) Server at 199.175.26.22 Port 443</address>\n"
SERVER_SOFTWARE
"Apache/2.4.25 (Debian)"
SERVER_NAME
"199.175.26.22"
SERVER_ADDR
"10.18.130.106"
SERVER_PORT
"443"
REMOTE_ADDR
"10.18.130.101"
DOCUMENT_ROOT
"/var/www/resources"
REQUEST_SCHEME
"https"
CONTEXT_PREFIX
""
CONTEXT_DOCUMENT_ROOT
"/var/www/resources"
SERVER_ADMIN
"[no address given]"
SCRIPT_FILENAME
"/var/www/resources/index.php"
REMOTE_PORT
"38128"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.1"
REQUEST_METHOD
"GET"
QUERY_STRING
""
REQUEST_URI
"/"
SCRIPT_NAME
"/index.php"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1537843662.981
REQUEST_TIME
1537843662
empty
0. Whoops\Handler\PrettyPageHandler
1. Whoops\Handler\CallbackHandler