You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Added a QueryCollection that holds multiple queries you can retrieved
by an ID
- The root -and child dirs selection can now be cached to gain
performance
thrownewFileQueryException(sprintf('Query is trying to run with file "%s" but no root directories are configured. Make sure sure you have added at least one root directory with Files::addRootDir() before you run a query', $fileName));
264
287
}
265
288
266
-
$this->_queriedFileName = $fileName;
289
+
$this->_clearPathCache();
267
290
268
-
if ($this->getRootDirSelection()->isInvalidated()) {
269
-
$this->_cachedQueryRootDirs;
291
+
$currentRootDirs = $files->rootDirs();
292
+
if (!Dirs::equalDirs($this->_cachedRootDirs, $currentRootDirs) || $this->getRootDirSelection()->isInvalidated()) {
293
+
$this->_clearRootDirCache();
270
294
}
271
-
if ($this->getChildDirSelection()->isInvalidated()) {
272
-
$this->_cachedQueryChildren;
295
+
$this->_cachedRootDirs = $currentRootDirs;
296
+
$currentChildDirs = $files->childDirs();
297
+
if (!Dirs::equalDirs($this->_cachedChildDirs, $currentChildDirs) || $this->getChildDirSelection()->isInvalidated()) {
$this->setExpectedException('FQ\Exceptions\FileQueryException', 'Query is trying to run with file "File2" but no root directories are configured. Make sure sure you have added at least one root directory with Files::addRootDir() before you run a query');
182
191
$this->files()->removeAllRootDirs();
@@ -197,6 +206,17 @@ public function testRunQueryAndLoadFileAfterwardsButFails() {
197
206
$query->load();
198
207
$this->assertTrue(class_exists('File2'));
199
208
}
209
+
publicfunctiontestRunQueryTwice() {
210
+
$query = $this->query();
211
+
212
+
$this->runQuery();
213
+
$query->load();
214
+
$this->assertTrue(class_exists('File2'));
215
+
216
+
$this->runQuery('File1');
217
+
$query->load();
218
+
$this->assertTrue(class_exists('File1'));
219
+
}
200
220
201
221
publicfunctiontestListPathsWhenQueryHasNotRan() {
202
222
$this->setExpectedException('FQ\Exceptions\FileQueryException', 'You must first call the "run" method before you can retrieve query information');
0 commit comments