Guzzle PHP v5 Documentation
($container as $transaction) { echo $transaction['request']->getMethod(); //> GET, HEAD if ($transaction['response']) { echo $transaction['response']->getStatusCode(); //> 200, 200 } elseif ($transaction['error']) ($transaction['error']) { echo $transaction['error']; //> exception } var_dump($transaction['options']); //> dumps the request options of the sent request. } Test Web Server Using mock responses is almost always enough0 码力 | 49 页 | 231.08 KB | 10 月前3Guzzle PHP 6.5 Documentation
responses foreach ($container as $transaction) { echo $transaction['request']->getMethod(); //> GET, HEAD if ($transaction['response']) { echo $transaction['response']->getStatusCode(); //> 200, 200 } elseif ($transaction['error']) { echo $transaction['error']; //> exception } var_dump($transaction['options']); //> dumps the request options of the sent0 码力 | 65 页 | 311.42 KB | 10 月前3Guzzle PHP 7.0 Documentation
responses foreach ($container as $transaction) { echo $transaction['request']->getMethod(); //> GET, HEAD if ($transaction['response']) { echo $transaction['response']->getStatusCode(); //> 200, 200 } elseif ($transaction['error']) { echo $transaction['error']; //> exception } var_dump($transaction['options']); //> dumps the request options of the sent0 码力 | 64 页 | 310.93 KB | 10 月前3Guzzle PHP 7.0 Documentation
($container as $transaction) { echo $transaction['request']->getMethod(); //> GET, HEAD if ($transaction['response']) { echo $transaction['response']->getStatusCode(); //> 200, 200 } elseif ($transaction['error']) ($transaction['error']) { echo $transaction['error']; //> exception } var_dump($transaction['options']); //> dumps the request options of the sent request. } 1.6.3 Test Web Server Using mock responses is almost always0 码力 | 50 页 | 235.39 KB | 10 月前3Guzzle PHP v5 Documentation
responses foreach ($container as $transaction) { echo $transaction['request']->getMethod(); //> GET, HEAD if ($transaction['response']) { echo $transaction['response']->getStatusCode(); //> 200, 200 } elseif ($transaction['error']) { echo $transaction['error']; //> exception } var_dump($transaction['options']); //> dumps the request options of the sent0 码力 | 62 页 | 309.78 KB | 10 月前3Guzzle PHP 6.5 Documentation
($container as $transaction) { echo $transaction['request']->getMethod(); //> GET, HEAD if ($transaction['response']) { echo $transaction['response']->getStatusCode(); //> 200, 200 } elseif ($transaction['error']) ($transaction['error']) { echo $transaction['error']; 42 Chapter 1. User Guide Guzzle, Release //> exception } var_dump($transaction['options']); //> dumps the request options of the sent request. } 1.6.3 Test Web0 码力 | 50 页 | 237.04 KB | 10 月前3Laravel 5.0 Documentation
commands! For example, a command pipe could wrap the entire command operation within a database transaction, or simply log its execution. To add a pipe to your bus, call the pipeThrough method of the UseDatabaseTransactions { public function handle($command, $next) { return DB::transaction(function() use ($command, $next) { return $next($command); Queued Commands Closure as a command pipe: $dispatcher->pipeThrough([function($command, $next) { return DB::transaction(function() use ($command, $next) { return $next($command); } }]); Managers & Factories0 码力 | 242 页 | 1.44 MB | 1 年前3Guzzle PHP 5.3 Documentation
event will trigger the error event of a request. complete The complete event is emitted after a transaction completes and an entire response has been received. The event is a GuzzleHttp\Event\CompleteEvent ($cachedResponse) { if ($e->getResponse()->getStatusCode() == 302) { // Intercept the original transaction with the new response $e->intercept($cachedResponse); } } ); $response = $client->send($request); the request $newResponse = $e->getClient()->send($e->getRequest()); // Intercept the original transaction with the new response $e->intercept($newResponse); } }); Attention: If an error event is intercepted0 码力 | 63 页 | 275.75 KB | 10 月前3Guzzle PHP 5.3 Documentation
event will trigger the error event of a request. complete The complete event is emitted after a transaction completes and an entire response has been received. The event is a GuzzleHttp\Event\CompleteEvent { if ($e->getResponse()->getStatusCode() == 302) { // Intercept the original transaction with the new response $e->intercept($cachedResponse); } } ); $response = $newResponse = $e->getClient()->send($e->getRequest()); // Intercept the original transaction with the new response $e->intercept($newResponse); } }); Attention If an error event0 码力 | 72 页 | 312.62 KB | 10 月前3CakePHP Cookbook Documentation 5.x
to a database server. This class is responsible for loading the database driver, providing SQL transaction mechanisms and preparing SQL statements among other things. driver The class name of the driver the closure returns false, a rollback will be issued. If the closure executes successfully, the transaction will be committed. Interacting with Statements When using the lower level database API, you will EntityInterface $entity, ArrayObject $options) The Model.afterSaveCommit event is fired after the transaction in which the save operation is wrapped has been committed. It’s also triggered for non atomic saves0 码力 | 1080 页 | 939.39 KB | 1 年前3
共 55 条
- 1
- 2
- 3
- 4
- 5
- 6