From abdbac031912a395c7524ad0e6f5c70c918531b2 Mon Sep 17 00:00:00 2001 From: Thedro Neely Date: Fri, 11 Nov 2022 05:50:53 -0500 Subject: app/storage/cache/.keep -> storage/cache/.keep --- .gitignore | 2 +- app/storage/cache/.keep | 0 bootstrap/Helpers.php | 6 +++--- bootstrap/helpers/cache | 6 +++--- storage/cache/.keep | 0 5 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 app/storage/cache/.keep create mode 100644 storage/cache/.keep diff --git a/.gitignore b/.gitignore index 23ad3ab..41b9e86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ **/generators/exoference/*.html .hugo_build.lock -/app/storage /cockpit +/storage /vendor config.php generators/hugo/content diff --git a/app/storage/cache/.keep b/app/storage/cache/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/bootstrap/Helpers.php b/bootstrap/Helpers.php index 76ee478..b3cc870 100644 --- a/bootstrap/Helpers.php +++ b/bootstrap/Helpers.php @@ -31,7 +31,7 @@ function views(string $folder, string $name) function cache(string $filename, string $data) { file_put_contents( - $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/storage/cache/' + $_SERVER['DOCUMENT_ROOT'] . '/..' . '/storage/cache/' . base64_encode($filename), $data ); } @@ -40,12 +40,12 @@ function fetch(string $uri, string $field) { if (file_exists( $_SERVER['DOCUMENT_ROOT'] . '/..' - . '/app/storage/cache/' . base64_encode($uri . $field) + . '/storage/cache/' . base64_encode($uri . $field) ) ) { echo file_get_contents( $_SERVER['DOCUMENT_ROOT'] . '/..' - . '/app/storage/cache/' . base64_encode($uri . $field) + . '/storage/cache/' . base64_encode($uri . $field) ); return; } diff --git a/bootstrap/helpers/cache b/bootstrap/helpers/cache index 267b442..ac7c8d2 100755 --- a/bootstrap/helpers/cache +++ b/bootstrap/helpers/cache @@ -1,4 +1,4 @@ #!/bin/sh -eu -cachedir=$(dirname "$(pwd)")/app/storage/cache; -rm -r "${cachedir:?}/"* > /dev/null 2>&1 || { echo "Nothing to invalidate in ${cachedir:?}" && exit; }; -echo "Cache invalidated in ${cachedir:?}"; +cachedir=$(dirname "$(pwd)")/storage/cache +rm --recursive "${cachedir:?}/"* >/dev/null 2>&1 || { printf "Nothing to invalidate in %s\n" "${cachedir:?}" && exit; } +printf "Cache invalidated in %s\n" "${cachedir:?}" diff --git a/storage/cache/.keep b/storage/cache/.keep new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3