From 4d9ec3298604b62ea95c78dc4b112e2429876124 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 4 Feb 2024 10:13:42 +0200 Subject: [PATCH] rename method --- README.md | 4 ++-- src/Dokuwiki/Filesystem.php | 2 +- src/Dokuwiki/Helper.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 24da7a4..c8ca921 100644 --- a/README.md +++ b/README.md @@ -186,13 +186,13 @@ var_dump ( ); ``` -#### Filesystem::getData +#### Filesystem::getDataByPath Return file content if path match storage item ``` var_dump ( - $filesystem->getData( + $filesystem->getDataByPath( '/full/path/to/page.txt' ) ); diff --git a/src/Dokuwiki/Filesystem.php b/src/Dokuwiki/Filesystem.php index 49c7d5b..c132624 100644 --- a/src/Dokuwiki/Filesystem.php +++ b/src/Dokuwiki/Filesystem.php @@ -187,7 +187,7 @@ class Filesystem return $path; } - public function getData(?string $path): ?string + public function getDataByPath(?string $path): ?string { if (in_array($path, $this->_list) && is_file($path) || is_readable($path)) { diff --git a/src/Dokuwiki/Helper.php b/src/Dokuwiki/Helper.php index 3c0b10c..232b10f 100644 --- a/src/Dokuwiki/Helper.php +++ b/src/Dokuwiki/Helper.php @@ -53,7 +53,7 @@ class Helper { $h1 = $this->_reader->getH1( $this->_reader->toGemini( - $this->_filesystem->getData( + $this->_filesystem->getDataByPath( $file ) ) @@ -65,7 +65,7 @@ class Helper { $h1 = $this->_reader->getH1( $this->_reader->toGemini( - $this->_filesystem->getData( + $this->_filesystem->getDataByPath( $file ) ) @@ -141,7 +141,7 @@ class Helper ), $this->_reader->getH1( $this->_reader->toGemini( - $this->_filesystem->getData( + $this->_filesystem->getDataByPath( $path ) )