Whoops\Exception\ErrorException: fwrite(): write of 3776 bytes failed with errno=28 No space left on device in /var/www/grav/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:131 Stack trace: #0 /var/www/grav/system/src/Grav/Common/Debugger.php(352): Whoops\Run->handleError() #1 [internal function]: Grav\Common\Debugger->deprecatedErrorHandler() #2 /var/www/grav/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php(131): fwrite() #3 /var/www/grav/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php(117): Monolog\Handler\StreamHandler->streamWrite() #4 /var/www/grav/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(39): Monolog\Handler\StreamHandler->write() #5 /var/www/grav/vendor/monolog/monolog/src/Monolog/Logger.php(344): Monolog\Handler\AbstractProcessingHandler->handle() #6 /var/www/grav/vendor/monolog/monolog/src/Monolog/Logger.php(470): Monolog\Logger->addRecord() #7 /var/www/grav/system/src/Grav/Common/Errors/Errors.php(61): Monolog\Logger->addCritical() #8 /var/www/grav/vendor/filp/whoops/src/Whoops/Handler/CallbackHandler.php(50): Grav\Common\Errors\Errors->Grav\Common\Errors\{closure}() #9 /var/www/grav/vendor/filp/whoops/src/Whoops/Run.php(321): Whoops\Handler\CallbackHandler->handle() #10 [internal function]: Whoops\Run->handleException() #11 {main}
return true; } public function getStatusFile() { return $this->status_file; } public function statusFileExists() { return file_exists($this->status_file); } public function storeStatusFile() { $problems = $this->getProblemsSerializable(); $json = json_encode($problems); file_put_contents($this->status_file, $json); } public function check($problems_dir = null) { $problems_dir = $problems_dir ?: dirname(__DIR__); $problems = []; $problems_found = false; foreach (new \DirectoryIterator($problems_dir) as $file) { if ($file->isDot() || $file->isDir()) { continue; } $classname = 'Grav\\Plugin\\Problems\\' . $file->getBasename('.php'); /** @var Problem $problem */ $problem = new $classname(); $problems[$problem->getId()] = $problem; } // Fire event to allow other plugins to add problems Grav::instance()->fireEvent('onProblemsInitialized', new Event(['problems' => $problems]));
"file_put_contents(): write of 2576 bytes failed with errno=28 No space left on device"
return true; } public function getStatusFile() { return $this->status_file; } public function statusFileExists() { return file_exists($this->status_file); } public function storeStatusFile() { $problems = $this->getProblemsSerializable(); $json = json_encode($problems); file_put_contents($this->status_file, $json); } public function check($problems_dir = null) { $problems_dir = $problems_dir ?: dirname(__DIR__); $problems = []; $problems_found = false; foreach (new \DirectoryIterator($problems_dir) as $file) { if ($file->isDot() || $file->isDir()) { continue; } $classname = 'Grav\\Plugin\\Problems\\' . $file->getBasename('.php'); /** @var Problem $problem */ $problem = new $classname(); $problems[$problem->getId()] = $problem; } // Fire event to allow other plugins to add problems Grav::instance()->fireEvent('onProblemsInitialized', new Event(['problems' => $problems]));
} public function onPluginsInitialized() { if (\defined('GRAV_CLI') || $this->isAdmin()) { return; } $this->checker = new ProblemChecker(); if (!$this->checker->statusFileExists()) { // If no issues remain, save a state file in the cache if (!$this->problemsFound()) { // delete any existing validated files /** @var \SplFileInfo $fileInfo */ foreach (new \GlobIterator(CACHE_DIR . ProblemChecker::PROBLEMS_PREFIX . '*') as $fileInfo) { @unlink($fileInfo->getPathname()); } // create a file in the cache dir so it only runs on cache changes $this->checker->storeStatusFile(); } else { $this->renderProblems(); } } } private function renderProblems() { /** @var Uri $uri */ $uri = $this->grav['uri']; /** @var \Twig_Environment $twig */ $twig = $this->getTwig(); $data = [ 'problems' => $this->problems, 'base_url' => $baseUrlRelative = $uri->rootUrl(false), 'problems_url' => $baseUrlRelative . '/user/plugins/problems', ];
} } /** * 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; } $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] = []; foreach ($this->listeners[$eventName] as $priority => $listeners) { foreach ($listeners as $k => $listener) { if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) { $listener[0] = $listener[0](); $this->listeners[$eventName][$priority][$k] = $listener; } $this->sorted[$eventName][] = $listener;
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordan Alliot <jordan.alliot@gmail.com> * @author Nicolas Grekas <p@tchwork.com> */ class EventDispatcher implements EventDispatcherInterface { private $listeners = []; private $sorted = []; /** * {@inheritdoc} */ public function dispatch($eventName, Event $event = null) { if (null === $event) { $event = new Event(); } if ($listeners = $this->getListeners($eventName)) { $this->doDispatch($listeners, $eventName, $event); } return $event; } /** * {@inheritdoc} */ public function getListeners($eventName = null) { if (null !== $eventName) { if (empty($this->listeners[$eventName])) { return []; } if (!isset($this->sorted[$eventName])) { $this->sortListeners($eventName); } return $this->sorted[$eventName];
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); } }
foreach ($values as $i => $value) { header($key . ': ' . $value, $i === 0); } } } /** * 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
*/ namespace Grav\Common\Processors; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; class PluginsProcessor extends ProcessorBase { public $id = 'plugins'; public $title = 'Plugins'; public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface { $this->startTimer(); // TODO: remove in 2.0. $this->container['accounts']; $this->container['plugins']->init(); $this->container->fireEvent('onPluginsInitialized'); $this->stopTimer(); return $handler->handle($request); } }
private $handler; /** @var ContainerInterface|null */ private $container; /** * {@inheritdoc} * @throws InvalidArgumentException */ public function handle(ServerRequestInterface $request): ResponseInterface { $middleware = array_shift($this->middleware); // Use default callable if there is no middleware. if ($middleware === null) { return \call_user_func($this->handler, $request); } if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, clone $this); } if (null === $this->container || !$this->container->has($middleware)) { throw new InvalidArgumentException( sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class), $middleware ); } array_unshift($this->middleware, $this->container->get($middleware)); return $this->handle($request); } }
// Use default callable if there is no middleware. if ($middleware === null) { return \call_user_func($this->handler, $request); } if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, clone $this); } if (null === $this->container || !$this->container->has($middleware)) { throw new InvalidArgumentException( sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class), $middleware ); } array_unshift($this->middleware, $this->container->get($middleware)); return $this->handle($request); } }
} /** @var Uri $uri */ $uri = $this->container['uri']; $uri->init(); // Redirect pages with trailing slash if configured to do so. $path = $uri->path() ?: '/'; if ($path !== '/' && $config->get('system.pages.redirect_trailing_slash', false) && Utils::endsWith($path, '/')) { $redirect = (string) $uri::getCurrentRoute()->toString(); $this->container->redirect($redirect); } $this->container->setLocale(); $this->stopTimer(); return $handler->handle($request); } }
private $handler; /** @var ContainerInterface|null */ private $container; /** * {@inheritdoc} * @throws InvalidArgumentException */ public function handle(ServerRequestInterface $request): ResponseInterface { $middleware = array_shift($this->middleware); // Use default callable if there is no middleware. if ($middleware === null) { return \call_user_func($this->handler, $request); } if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, clone $this); } if (null === $this->container || !$this->container->has($middleware)) { throw new InvalidArgumentException( sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class), $middleware ); } array_unshift($this->middleware, $this->container->get($middleware)); return $this->handle($request); } }
// Use default callable if there is no middleware. if ($middleware === null) { return \call_user_func($this->handler, $request); } if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, clone $this); } if (null === $this->container || !$this->container->has($middleware)) { throw new InvalidArgumentException( sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class), $middleware ); } array_unshift($this->middleware, $this->container->get($middleware)); return $this->handle($request); } }
*/ namespace Grav\Common\Processors; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; class DebuggerProcessor extends ProcessorBase { public $id = '_debugger'; public $title = 'Init Debugger'; public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface { $this->startTimer(); $this->container['debugger']->init(); $this->stopTimer(); return $handler->handle($request); } }
private $handler; /** @var ContainerInterface|null */ private $container; /** * {@inheritdoc} * @throws InvalidArgumentException */ public function handle(ServerRequestInterface $request): ResponseInterface { $middleware = array_shift($this->middleware); // Use default callable if there is no middleware. if ($middleware === null) { return \call_user_func($this->handler, $request); } if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, clone $this); } if (null === $this->container || !$this->container->has($middleware)) { throw new InvalidArgumentException( sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class), $middleware ); } array_unshift($this->middleware, $this->container->get($middleware)); return $this->handle($request); } }
// Use default callable if there is no middleware. if ($middleware === null) { return \call_user_func($this->handler, $request); } if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, clone $this); } if (null === $this->container || !$this->container->has($middleware)) { throw new InvalidArgumentException( sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class), $middleware ); } array_unshift($this->middleware, $this->container->get($middleware)); return $this->handle($request); } }
*/ namespace Grav\Common\Processors; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; class ErrorsProcessor extends ProcessorBase { public $id = '_errors'; public $title = 'Error Handlers Reset'; public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface { $this->startTimer(); $this->container['errors']->resetHandlers(); $this->stopTimer(); return $handler->handle($request); } }
private $handler; /** @var ContainerInterface|null */ private $container; /** * {@inheritdoc} * @throws InvalidArgumentException */ public function handle(ServerRequestInterface $request): ResponseInterface { $middleware = array_shift($this->middleware); // Use default callable if there is no middleware. if ($middleware === null) { return \call_user_func($this->handler, $request); } if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, clone $this); } if (null === $this->container || !$this->container->has($middleware)) { throw new InvalidArgumentException( sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class), $middleware ); } array_unshift($this->middleware, $this->container->get($middleware)); return $this->handle($request); } }
// Use default callable if there is no middleware. if ($middleware === null) { return \call_user_func($this->handler, $request); } if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, clone $this); } if (null === $this->container || !$this->container->has($middleware)) { throw new InvalidArgumentException( sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class), $middleware ); } array_unshift($this->middleware, $this->container->get($middleware)); return $this->handle($request); } }
/** @var Config $config */ $config = $grav['config']; switch ($config->get('system.log.handler', 'file')) { case 'syslog': $log = $grav['log']; $log->popHandler(); $facility = $config->get('system.log.syslog.facility', 'local6'); $logHandler = new SyslogHandler('grav', $facility); $formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%"); $logHandler->setFormatter($formatter); $log->pushHandler($logHandler); break; } $this->stopTimer(); return $handler->handle($request); } }
private $handler; /** @var ContainerInterface|null */ private $container; /** * {@inheritdoc} * @throws InvalidArgumentException */ public function handle(ServerRequestInterface $request): ResponseInterface { $middleware = array_shift($this->middleware); // Use default callable if there is no middleware. if ($middleware === null) { return \call_user_func($this->handler, $request); } if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, clone $this); } if (null === $this->container || !$this->container->has($middleware)) { throw new InvalidArgumentException( sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class), $middleware ); } array_unshift($this->middleware, $this->container->get($middleware)); return $this->handle($request); } }
// Use default callable if there is no middleware. if ($middleware === null) { return \call_user_func($this->handler, $request); } if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, clone $this); } if (null === $this->container || !$this->container->has($middleware)) { throw new InvalidArgumentException( sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class), $middleware ); } array_unshift($this->middleware, $this->container->get($middleware)); return $this->handle($request); } }
namespace Grav\Common\Processors; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; class ConfigurationProcessor extends ProcessorBase { public $id = '_config'; public $title = 'Configuration'; public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface { $this->startTimer(); $this->container['config']->init(); $this->container['plugins']->setup(); $this->stopTimer(); return $handler->handle($request); } }
private $handler; /** @var ContainerInterface|null */ private $container; /** * {@inheritdoc} * @throws InvalidArgumentException */ public function handle(ServerRequestInterface $request): ResponseInterface { $middleware = array_shift($this->middleware); // Use default callable if there is no middleware. if ($middleware === null) { return \call_user_func($this->handler, $request); } if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, clone $this); } if (null === $this->container || !$this->container->has($middleware)) { throw new InvalidArgumentException( sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class), $middleware ); } array_unshift($this->middleware, $this->container->get($middleware)); return $this->handle($request); } }
// Use default callable if there is no middleware. if ($middleware === null) { return \call_user_func($this->handler, $request); } if ($middleware instanceof MiddlewareInterface) { return $middleware->process($request, clone $this); } if (null === $this->container || !$this->container->has($middleware)) { throw new InvalidArgumentException( sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class), $middleware ); } array_unshift($this->middleware, $this->container->get($middleware)); return $this->handle($request); } }
}, 'debuggerAssetsProcessor' => function () { return new DebuggerAssetsProcessor($this); }, 'renderProcessor' => function () { return new RenderProcessor($this); }, ] ); $default = function (ServerRequestInterface $request) { return new Response(404); }; /** @var Debugger $debugger */ $debugger = $this['debugger']; $collection = new RequestHandler($this->middleware, $default, $container); $response = $collection->handle($this['request']); $body = $response->getBody(); // Handle ETag and If-None-Match headers. if ($response->getHeaderLine('ETag') === '1') { $etag = md5($body); $response = $response->withHeader('ETag', $etag); if ($this['request']->getHeaderLine('If-None-Match') === $etag) { $response = $response->withStatus(304); $body = ''; } } $this->header($response); echo $body; $debugger->render(); register_shutdown_function([$this, 'shutdown']); }
if (!is_file($autoload)) { die('Please run: <i>bin/grav install</i>'); } // Register the auto-loader. $loader = require $autoload; use Grav\Common\Grav; use RocketTheme\Toolbox\Event\Event; // Get the Grav instance $grav = Grav::instance( array( 'loader' => $loader ) ); // Process the page try { $grav->process(); } catch (\Error $e) { $grav->fireEvent('onFatalException', new Event(array('exception' => $e))); throw $e; } catch (\Exception $e) { $grav->fireEvent('onFatalException', new Event(array('exception' => $e))); throw $e; }
Key | Value |
USER | "xyz"
|
HOME | "/var/www"
|
HTTP_ACCEPT_ENCODING | "gzip"
|
HTTP_X_REAL_IP | "54.198.108.174"
|
HTTP_X_FORWARDED_SERVER | "2de8430da048"
|
HTTP_X_FORWARDED_PROTO | "https"
|
HTTP_X_FORWARDED_PORT | "443"
|
HTTP_X_FORWARDED_HOST | "mxiia.com"
|
HTTP_X_FORWARDED_FOR | "54.198.108.174"
|
HTTP_REFERER | "http://mxiia.com/manual/ja/stopping.html"
|
HTTP_ACCEPT | "*/*"
|
HTTP_USER_AGENT | "claudebot"
|
HTTP_HOST | "mxiia.com"
|
SCRIPT_FILENAME | "/var/www/grav//index.php"
|
REDIRECT_STATUS | "200"
|
SERVER_NAME | "f8f5f6ab5427"
|
SERVER_PORT | "80"
|
SERVER_ADDR | "172.18.0.2"
|
REMOTE_PORT | "55248"
|
REMOTE_ADDR | "172.18.0.3"
|
SERVER_SOFTWARE | "nginx/1.14.2"
|
GATEWAY_INTERFACE | "CGI/1.1"
|
REQUEST_SCHEME | "http"
|
SERVER_PROTOCOL | "HTTP/1.1"
|
DOCUMENT_ROOT | "/var/www/grav"
|
DOCUMENT_URI | "/index.php"
|
REQUEST_URI | "/manual/ja/stopping.html"
|
SCRIPT_NAME | "/index.php"
|
CONTENT_LENGTH | "" |
CONTENT_TYPE | "" |
REQUEST_METHOD | "GET"
|
QUERY_STRING | "" |
FCGI_ROLE | "RESPONDER"
|
PHP_SELF | "/index.php"
|
REQUEST_TIME_FLOAT | 1711714675.1036
|
REQUEST_TIME | 1711714675
|