芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/giga.mgaplay.com.br/vendor/mongodb/mongodb/src/Command/ListDatabases.php
options = $options; } /** * Execute the operation. * * @see Executable::execute() * @param Server $server * @return array An array of database info structures * @throws UnexpectedValueException if the command response was malformed * @throws DriverRuntimeException for other driver errors (e.g. connection errors) */ public function execute(Server $server) { $cmd = ['listDatabases' => 1]; if (isset($this->options['authorizedDatabases'])) { $cmd['authorizedDatabases'] = $this->options['authorizedDatabases']; } if (! empty($this->options['filter'])) { $cmd['filter'] = (object) $this->options['filter']; } if (isset($this->options['maxTimeMS'])) { $cmd['maxTimeMS'] = $this->options['maxTimeMS']; } if (isset($this->options['nameOnly'])) { $cmd['nameOnly'] = $this->options['nameOnly']; } $cursor = $server->executeReadCommand('admin', new Command($cmd), $this->createOptions()); $cursor->setTypeMap(['root' => 'array', 'document' => 'array']); $result = current($cursor->toArray()); if (! isset($result['databases']) || ! is_array($result['databases'])) { throw new UnexpectedValueException('listDatabases command did not return a "databases" array'); } return $result['databases']; } /** * 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; } }