Bearsampp 2025.8.29
Loading...
Searching...
No Matches
ActionDebugPostgresql Class Reference

Public Member Functions

 __construct ($args)

Detailed Description

Class ActionDebugPostgresql

This class handles the debugging actions for PostgreSQL within the Bearsampp application. It retrieves and displays PostgreSQL command line output based on the provided arguments.

Definition at line 16 of file class.action.debugPostgresql.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( $args)

Constructor for ActionDebugPostgresql.

Parameters
array$argsAn array of arguments where the first element is expected to be a PostgreSQL command.

This constructor initializes the debugging process for PostgreSQL. It checks the provided arguments, retrieves the command line output for the specified PostgreSQL command, and displays it in a message box.

Global variables used:

  • $bearsamppLang: Provides language-specific strings.
  • $bearsamppBins: Provides access to Bearsampp binaries, including PostgreSQL.
  • $bearsamppWinbinder: Handles the display of message boxes.

Definition at line 31 of file class.action.debugPostgresql.php.

32 {
33 global $bearsamppLang, $bearsamppBins, $bearsamppTools, $bearsamppWinbinder;
34
35 if (isset($args[0]) && !empty($args[0])) {
36 $editor = false;
37 $msgBoxError = false;
38 $caption = $bearsamppLang->getValue(Lang::DEBUG) . ' ' . $bearsamppLang->getValue(Lang::POSTGRESQL) . ' - ';
39 if ($args[0] == BinPostgresql::CMD_VERSION) {
41 }
42 $caption .= ' (' . $args[0] . ')';
43
44 $debugOutput = $bearsamppBins->getPostgresql()->getCmdLineOutput($args[0]);
45
46 if ($editor) {
47 Util::openFileContent($caption, $debugOutput);
48 } else {
49 if ($msgBoxError) {
50 $bearsamppWinbinder->messageBoxError(
51 $debugOutput,
52 $caption
53 );
54 } else {
55 $bearsamppWinbinder->messageBoxInfo(
56 $debugOutput,
57 $caption
58 );
59 }
60 }
61 }
62 }
global $bearsamppBins
global $bearsamppLang
const DEBUG_POSTGRESQL_VERSION
const POSTGRESQL
const DEBUG
static openFileContent($caption, $content)

References $bearsamppBins, $bearsamppLang, BinPostgresql\CMD_VERSION, Lang\DEBUG, Lang\DEBUG_POSTGRESQL_VERSION, Util\openFileContent(), and Lang\POSTGRESQL.


The documentation for this class was generated from the following file: