We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2881df9 commit 18aec8cCopy full SHA for 18aec8c
1 file changed
src/Brainbits/Blocking/Adapter/FilesystemAdapter.php
@@ -111,6 +111,24 @@ public function get(IdentifierInterface $identifier)
111
*/
112
protected function getFilename(IdentifierInterface $identifier)
113
{
114
- return $this->root . '/' . $identifier;
+ return $this->ensureDirectoryExists($this->root) . '/' . $identifier;
115
+ }
116
+
117
+ /**
118
+ * Ensure directory exists
119
+ *
120
+ * @param string $filename
121
+ * @return string
122
+ * @throws \Exception
123
+ */
124
+ protected function ensureDirectoryExists($dirname)
125
+ {
126
+ if (!file_exists($dirname)) {
127
+ if (!mkdir($dirname, 0777, true)) {
128
+ throw new \Exception('Can\'t create block dir ' . $dirname);
129
130
131
132
+ return $dirname;
133
}
134
0 commit comments