Commit ae870bc2cad703333c1d223bce4c058d1f6a7739

Authored by Eriksen Costa Paixão
1 parent 0f720084
Exists in master

#31 by Eriksen, José Rogerio Santos: Corrigido erro em função printf de debugging

Showing 1 changed file with 22 additions and 29 deletions   Show diff stats
ieducar/intranet/include/clsBancoPgSql.inc.php
... ... @@ -139,38 +139,31 @@ class clsBancoSQL_ {
139 139 }
140 140  
141 141  
142   - /*
143   - Conecta-se em Banco, com Usuario e Senha, na Porta do Host
144   - e guarda o indentificador da conexão em Link_ID.
145   - Se a conexão falhar ele interrompe a execução do script.
146   - */
147   - /*private*/ function Conecta()
148   - {
149   - /*
150   - Testa se o link está ativo
151   - Se estiver inativo,
152   - junta as propriedades que tiveram valores atribuidos
153   - para formar a Frase de conexão
154   - */
155   - if ( 0 == $this->bLink_ID )
156   - {
157   - $this->FraseConexao();
158 142  
159   - /* Função para depuração */
160   - if ($this->bDepurar)
161   - {
162   - printf("<br>Depurar: Frase de Conex&atilde;o : %s, %s, %s<br>\n", $this->strFraseConexao);
163   - }
  143 + /**
  144 + * Conecta com o banco de dados
  145 + *
  146 + * Verifica se o link está inativo e conecta. Se a conexão não obtiver
  147 + * sucesso, interrompe o script
  148 + */
  149 + public function Conecta() {
  150 + // Verifica se o link de conexão está inativo e conecta
  151 + if (0 == $this->bLink_ID) {
  152 + $this->FraseConexao();
  153 +
  154 + if ($this->bDepurar) {
  155 + printf("<br>Depurar: Frase de Conex&atilde;o : %s<br>\n", $this->strFraseConexao);
  156 + }
  157 +
  158 + $this->bLink_ID = pg_connect($this->strFraseConexao);
  159 +
  160 + if (!$this->bLink_ID) {
  161 + $this->Interrompe("Link inv&aacute;lido, conex&atilde;o falhou!");
  162 + }
  163 + }
  164 + }
164 165  
165   - $this->bLink_ID=pg_connect($this->strFraseConexao);
166 166  
167   - if (!$this->bLink_ID)
168   - {
169   - $this->Interrompe("Link inv&aacute;lido, conex&atilde;o falhou!");
170   - }
171   - //$this->Consulta( "SET TIMEZONE TO gmt2" );
172   - }
173   - }
174 167  
175 168 /*
176 169 Executa uma instru&ccedil;&atilde;o SQL e retorna um identificador para o resultado
... ...