/** * Get the extensions * * @param string $group The extension group * * @return ExtensionInterface[] */ public function getExtensions($group = '') { if (key_exists($group, $this->extensions)) { return $this->extensions[$group]; } $this->extensions[$group] = []; $fs = $this->rootFolder; if (is_string($this->rootFolder)) { // It is only the path $fs = new Local($this->rootFolder); } if (!$fs instanceof AbstractAdapter) { return []; } foreach ($fs->listContents($group, true) as $file) { if (strpos($file['path'], 'extension.yml') === false) { continue; } $path = $fs->applyPathPrefix($file['path']); if (key_exists($path, $this->loadedFiles)) { // We have loaded it already $this->extensions[$group][] = $this->loadedFiles[$path]; continue; } $extension = new Extension(); $this->loadedFiles[$path] = $extension; $this->extensions[$group][] = $extension; $config = Yaml::parse($fs->read($file['path'])['contents'], Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE); if (key_exists('listeners', $config)) { $this->createListeners($extension, $config['listeners']); } if (key_exists('queryhandlers', $config)) { $this->createQueryHandlers($extension, $config['queryhandlers']); } } return $this->extensions[$group]; }
/** * @expectedException League\Flysystem\NotSupportedException */ public function testLinkCausedUnsupportedException() { $root = __DIR__ . '/files/'; $original = $root . 'original.txt'; $link = $root . 'link.txt'; file_put_contents($original, 'something'); symlink($original, $link); $adapter = new Local($root); $adapter->listContents(); }