Whoops\Exception\ErrorException: fwrite(): write of 7186 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}
* Writes a string content to file in an atomic way. * * @param string $filename Path to the file where to write the data. * @param string $content The content to write * * @return bool TRUE on success, FALSE if path cannot be created, if path is not writable or an any other error. */ protected function writeFile(string $filename, string $content) : bool { $filepath = pathinfo($filename, PATHINFO_DIRNAME); if (! $this->createPathIfNeeded($filepath)) { return false; } if (! is_writable($filepath)) { return false; } $tmpFile = tempnam($filepath, 'swap'); @chmod($tmpFile, 0666 & (~$this->umask)); if (file_put_contents($tmpFile, $content) !== false) { @chmod($tmpFile, 0666 & (~$this->umask)); if (@rename($tmpFile, $filename)) { return true; } @unlink($tmpFile); } return false; } private function getIterator() : Iterator { return new RecursiveIteratorIterator( new RecursiveDirectoryIterator($this->directory, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST );
"tempnam(): file created in the system's temporary directory"
* Writes a string content to file in an atomic way. * * @param string $filename Path to the file where to write the data. * @param string $content The content to write * * @return bool TRUE on success, FALSE if path cannot be created, if path is not writable or an any other error. */ protected function writeFile(string $filename, string $content) : bool { $filepath = pathinfo($filename, PATHINFO_DIRNAME); if (! $this->createPathIfNeeded($filepath)) { return false; } if (! is_writable($filepath)) { return false; } $tmpFile = tempnam($filepath, 'swap'); @chmod($tmpFile, 0666 & (~$this->umask)); if (file_put_contents($tmpFile, $content) !== false) { @chmod($tmpFile, 0666 & (~$this->umask)); if (@rename($tmpFile, $filename)) { return true; } @unlink($tmpFile); } return false; } private function getIterator() : Iterator { return new RecursiveIteratorIterator( new RecursiveDirectoryIterator($this->directory, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST );
} fclose($resource); return $lifetime === 0 || $lifetime > time(); } /** * {@inheritdoc} */ protected function doSave($id, $data, $lifeTime = 0) { if ($lifeTime > 0) { $lifeTime = time() + $lifeTime; } $data = serialize($data); $filename = $this->getFilename($id); return $this->writeFile($filename, $lifeTime . PHP_EOL . $data); } }
$namespacedKeysAndValues[$this->getNamespacedId($key)] = $value; } return $this->doSaveMultiple($namespacedKeysAndValues, $lifetime); } /** * {@inheritdoc} */ public function contains($id) { return $this->doContains($this->getNamespacedId($id)); } /** * {@inheritdoc} */ public function save($id, $data, $lifeTime = 0) { return $this->doSave($this->getNamespacedId($id), $data, $lifeTime); } /** * {@inheritdoc} */ public function deleteMultiple(array $keys) { return $this->doDeleteMultiple(array_map([$this, 'getNamespacedId'], $keys)); } /** * {@inheritdoc} */ public function delete($id) { return $this->doDelete($this->getNamespacedId($id)); } /** * {@inheritdoc}
return $this->driver->fetch($id); } return false; } /** * Stores a new cached entry. * * @param string $id the id of the cached entry * @param array|object $data the data for the cached entry to store * @param int $lifetime the lifetime to store the entry in seconds */ public function save($id, $data, $lifetime = null) { if ($this->enabled) { if ($lifetime === null) { $lifetime = $this->getLifetime(); } $this->driver->save($id, $data, $lifetime); } } /** * Deletes an item in the cache based on the id * * @param string $id the id of the cached data entry * @return bool true if the item was deleted successfully */ public function delete($id) { if ($this->enabled) { return $this->driver->delete($id); } return false; } /** * Deletes all cache
/** * Accessible method to manually reset the pages cache * * @param string $pages_dir */ public function resetPages($pages_dir) { $this->recurse($pages_dir); $this->buildRoutes(); // cache if needed if ($this->grav['config']->get('system.cache.enabled')) { /** @var Cache $cache */ $cache = $this->grav['cache']; /** @var Taxonomy $taxonomy */ $taxonomy = $this->grav['taxonomy']; // save pages, routes, taxonomy, and sort to cache $cache->save($this->pages_cache_id, [$this->instances, $this->routes, $this->children, $taxonomy->taxonomy(), $this->sort]); } } /** * Recursive function to load & build page relationships. * * @param string $directory * @param PageInterface|null $parent * * @return PageInterface * @throws \RuntimeException * @internal */ protected function recurse($directory, PageInterface $parent = null) { $directory = rtrim($directory, DS); $page = new Page; /** @var Config $config */ $config = $this->grav['config'];