]> _ Git - cubist_util.git/commitdiff
wip #6296 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 20 Sep 2023 08:34:46 +0000 (10:34 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 20 Sep 2023 08:34:46 +0000 (10:34 +0200)
src/Cache.php [new file with mode: 0644]

diff --git a/src/Cache.php b/src/Cache.php
new file mode 100644 (file)
index 0000000..6bc5292
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+
+namespace Cubist\Util;
+
+use Cubist\Util\Files\Files;
+use Illuminate\Cache\FileStore;
+use Illuminate\Cache\Repository;
+use Illuminate\Filesystem\Filesystem;
+
+class Cache
+{
+    /**
+     * @var Repository
+     */
+    protected static $_repository = null;
+
+    /**
+     * @return Repository
+     */
+    public static function getRepository()
+    {
+        if (null === static::$_repository) {
+            $filestore = new FileStore(
+                new Filesystem(),
+                Files::mkdir(sys_get_temp_dir() . '/cubist')
+            );
+
+            static::$_repository = new Repository($filestore);
+
+        }
+        return static::$_repository;
+    }
+}
\ No newline at end of file