芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/cepali/cache/stores/mongodb/MongoDB/Operation/ListCollections.php
databaseName = (string) $databaseName; $this->options = $options; } /** * Execute the operation. * * @see Executable::execute() * @param Server $server * @return CollectionInfoIterator * @throws DriverRuntimeException for other driver errors (e.g. connection errors) */ public function execute(Server $server) { return $this->executeCommand($server); } /** * Create options for executing the command. * * Note: read preference is intentionally omitted, as the spec requires that * the command be executed on the primary. * * @see http://php.net/manual/en/mongodb-driver-server.executecommand.php * @return array */ private function createOptions() { $options = []; if (isset($this->options['session'])) { $options['session'] = $this->options['session']; } return $options; } /** * Returns information for all collections in this database using the * listCollections command. * * @param Server $server * @return CollectionInfoCommandIterator * @throws DriverRuntimeException for other driver errors (e.g. connection errors) */ private function executeCommand(Server $server) { $cmd = ['listCollections' => 1]; if ( ! empty($this->options['filter'])) { $cmd['filter'] = (object) $this->options['filter']; } if (isset($this->options['maxTimeMS'])) { $cmd['maxTimeMS'] = $this->options['maxTimeMS']; } $cursor = $server->executeCommand($this->databaseName, new Command($cmd), $this->createOptions()); $cursor->setTypeMap(['root' => 'array', 'document' => 'array']); return new CollectionInfoCommandIterator(new CachingIterator($cursor)); } }