/** * @group storage */ function queryfx_all(AphrontDatabaseConnection $conn, $sql) { $argv = func_get_args(); call_user_func_array('queryfx', $argv); return $conn->selectAllResults(); }
public function isReachable(AphrontDatabaseConnection $connection) { $record = $this->getHealthRecord(); $should_check = $record->getShouldCheck(); if ($this->isSevered() && !$should_check) { return false; } try { $connection->openConnection(); $reachable = true; } catch (AphrontSchemaQueryException $ex) { // We get one of these if the database we're trying to select does not // exist. In this case, just re-throw the exception. This is expected // during first-time setup, when databases like "config" will not exist // yet. throw $ex; } catch (Exception $ex) { $reachable = false; } if ($should_check) { $record->didHealthCheck($reachable); } if (!$reachable) { $this->didFailToConnect = true; } return $reachable; }
public function isReachable(AphrontDatabaseConnection $connection) { $record = $this->getHealthRecord(); $should_check = $record->getShouldCheck(); if ($this->isSevered() && !$should_check) { return false; } try { $connection->openConnection(); $reachable = true; } catch (Exception $ex) { $reachable = false; } if ($should_check) { $record->didHealthCheck($reachable); } if (!$reachable) { $this->didFailToConnect = true; } return $reachable; }
protected function &getTransactionStack($key) { if (!self::$transactionShutdownRegistered) { self::$transactionShutdownRegistered = true; register_shutdown_function(array('AphrontDatabaseConnection', 'shutdownTransactionStacks')); } if (!isset(self::$transactionStacks[$key])) { self::$transactionStacks[$key] = array(); } return self::$transactionStacks[$key]; }
/** * @group storage */ function queryfx(AphrontDatabaseConnection $conn, $sql) { $argv = func_get_args(); $query = call_user_func_array('qsprintf', $argv); $conn->executeRawQuery($query); }