Execute the operation.

@see Executable::execute()
@param Server $server
@return Cursor
359140
public function execute(Server $server)
    {
        $cursor = $server->executeCommand($this->databaseName, $this->command, $this->createOptions());

        if (isset($this->options['typeMap'])) {
            $cursor->setTypeMap($this->options['typeMap']);
        }

        return $cursor;
    }
920027
public function exec($sql, array $parameters = [])
    {
        $statement = $this->executeQuery($sql, $parameters);

        return $statement->rowCount();
    }
1151066
public function execute($params = [])
    {
        return $this->getDb()
            ->createCommand()
            ->setText($this->buildSql())
            ->execute(array_merge($this->getParams(), $params));
    }
532726
public function initialize(Server $server)
    {
        $this->server = $server;
        $server->on('method:GET', [$this, 'httpGet']);
        $server->on('method:OPTIONS', [$this, 'httpOptions']);
        $server->on('method:HEAD', [$this, 'httpHead']);
        $server->on('method:DELETE', [$this, 'httpDelete']);
        $server->on('method:PROPFIND', [$this, 'httpPropFind']);
        $server->on('method:PROPPATCH', [$this, 'httpPropPatch']);
        $server->on('method:PUT', [$this, 'httpPut']);
        $server->on('method:MKCOL', [$this, 'httpMkcol']);
        $server->on('method:MOVE', [$this, 'httpMove']);
        $server->on('method:COPY', [$this, 'httpCopy']);
        $server->on('method:REPORT', [$this, 'httpReport']);

        $server->on('propPatch', [$this, 'propPatchProtectedPropertyCheck'], 90);
        $server->on('propPatch', [$this, 'propPatchNodeUpdate'], 200);
        $server->on('propFind', [$this, 'propFind']);
        $server->on('propFind', [$this, 'propFindNode'], 120);
        $server->on('propFind', [$this, 'propFindLate'], 200);

        $server->on('exception', [$this, 'exception']);
    }
867652
public function run(ServerRequestInterface $request = null)
    {
        $request = $request ?: ServerRequestFactory::fromGlobals();

        $response = $this->handle($request);

        $this->responseEmitter->emit($response);
    }
183851
public function request(ServerRequest $request = null)
    {
        $finding = $this->map->findByRequest($request = ($request ? : $this->request));

        return $this->run($finding);
    }
779541
public function execute($data = null)
    {
        if (class_exists(DebuggerHelper::class)) {
            DebuggerHelper::disableConsole();
        }

        try {
            $result = $this->next->execute($data);

            if ($result instanceof AbstractView) {
                $result = $result->getHandledData();
            }

            $message = $this->getMessage();

            return new JsonBuffer($message, $result);
        } catch (\Exception $e) {
            return $this->handleException($e);
        } catch (\Throwable $t) {
            return $this->handleException(new \ErrorException(
                $t->getMessage(),
                $t->getCode(),
                E_ERROR,
                $t->getFile(),
                $t->getLine(),
                $t
            ));
        }
    }
692270
def execute(self, sql):
        """"""
        cursor = self.connection.cursor()
        try:
            cursor.execute(sql)
        finally:
            cursor.close()
1193135
def _execute(self, *args):
        
        cursor = self.db.cursor()
        cursor.execute(*args)
        return cursor
1237756
function setServer($server)
    {
        $this->server = new DataEntity(
            $this->_normalizeServer($server)
        );
        
        return $this->server;
    }
1182515
public function execute($route, array $parameters = array(), \Exedra\Http\ServerRequest $request = null)
    {
        $route = $this->baseRoute($route);

        $request = $request ? : $this->request;

        return $this->app->execute($route, $parameters, $request);
    }
691775
public function onStart(Server $server): void
    {
        $this->fire(ServerEvent::STARTED, $server);

        $this->masterPid = $masterPid = $server->master_pid;
        $rootPath        = $this->config('rootPath');
        $rootPath        = $rootPath ? " (at $rootPath)" : '';

        // save master process id to file.
        ProcessUtil::setTitle(sprintf('%s: master%s', $this->name, $rootPath));

        $this->log("The <comment>master</comment> process success started. (PID:<info>{$masterPid}</info>, pidFile: $this->pidFile)");
    }
788282
private function executeCommand(Server $server)
    {
        $cmd = [
            'createIndexes' => $this->collectionName,
            'indexes' => $this->indexes,
        ];

        if (isset($this->options['maxTimeMS'])) {
            $cmd['maxTimeMS'] = $this->options['maxTimeMS'];
        }

        $server->executeWriteCommand($this->databaseName, new Command($cmd), $this->createOptions());
    }
248989
public function execute($sql, array $parameters = [])
    {
        $sth = $this->prepare($sql);
        $sth->execute($parameters);
        return $sth;
    }
702092
public function execute(Server $server)
    {
        $cmd = ['listDatabases' => 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('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 an Iterator instead of an array in case listDatabases is
         * eventually changed to return a command cursor, like the collection
         * and index enumeration commands. This makes the "totalSize" command
         * field inaccessible, but users can manually invoke the command if they
         * need that value.
         */
        return new DatabaseInfoLegacyIterator($result['databases']);
    }
1274287
public function handle(AbstractServer $server): void
    {
        parent::handle($server);

        /* @var Container $app */
        $app = $server->getApplication();

        //close websocket
        try {
            $info = $server->getServer()->getClientInfo($this->fd);
            //当在websocket cliet中使用http访问时，也会带上websocket_status参数，状态为0
            if (is_array($info) && isset($info['websocket_status']) && $info['websocket_status'] > 0) {
                $this->closeWebSocket($app);
            }
        } finally {
            $app->make('events')->dispatch(
                new CloseHandledEvent($this->fd)
            );
        }
    }
880859
public static function fromServer(Server $server): ServerForm
    {
        return new self(array_merge($server->getAttributes(), ['server' => $server->name, 'scenario' => 'update'], [
            'ips' => implode(',', ArrayHelper::getColumn($server->ips, 'ip')),
        ]));
    }