From e802d5204b96d645ec3d40b81b4a8bdc6e0ee675 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Mon, 4 Nov 2019 23:31:31 +0100 Subject: refactor: switch to psr-4 autoloading --- app/class/Flywheel/Formatter/JSON.php | 21 +++++++++++++++++++++ app/class/Flywheel/Predicate.php | 11 +++++++++++ app/class/Flywheel/Query.php | 16 ++++++++++++++++ app/class/Flywheel/Repository.php | 30 ++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 app/class/Flywheel/Formatter/JSON.php create mode 100644 app/class/Flywheel/Predicate.php create mode 100644 app/class/Flywheel/Query.php create mode 100644 app/class/Flywheel/Repository.php (limited to 'app/class/Flywheel') diff --git a/app/class/Flywheel/Formatter/JSON.php b/app/class/Flywheel/Formatter/JSON.php new file mode 100644 index 0000000..9659fcb --- /dev/null +++ b/app/class/Flywheel/Formatter/JSON.php @@ -0,0 +1,21 @@ +operators = array( + '>', '>=', '<', '<=', '==', '===', '!=', '!==', 'IN' + ); + } +} diff --git a/app/class/Flywheel/Query.php b/app/class/Flywheel/Query.php new file mode 100644 index 0000000..f002080 --- /dev/null +++ b/app/class/Flywheel/Query.php @@ -0,0 +1,16 @@ +predicate = new Predicate(); + } +} diff --git a/app/class/Flywheel/Repository.php b/app/class/Flywheel/Repository.php new file mode 100644 index 0000000..d0b68eb --- /dev/null +++ b/app/class/Flywheel/Repository.php @@ -0,0 +1,30 @@ +formatter->getFileExtension(); + $files = glob($this->path . DIRECTORY_SEPARATOR . '*.' . $ext); + return $files; + } + + /** + * Get an array containing the id of all files in this repository + * + * @return array An array, item is a id + */ + public function getAllIds() + { + $ext = $this->formatter->getFileExtension(); + return array_map(function($path) use ($ext) { + return $this->getIdFromPath($path, $ext); + }, $this->getAllFiles()); + } +} -- cgit v1.2.3