Skip to content

Commit

Permalink
Trunk:
Browse files Browse the repository at this point in the history
 * Merge desde Rama 2.7 @revs[6857:6933]
  • Loading branch information
enfoqueNativo committed May 18, 2016
1 parent 0db5d6d commit 732ba8b
Show file tree
Hide file tree
Showing 19 changed files with 558 additions and 128 deletions.
42 changes: 42 additions & 0 deletions bin/connection_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env php
<?php

$intentos = 20;
echo "Chequeando conexion postgres...". PHP_EOL;
if ($argc < 6) {
echo " Chequea la conexion con la bd hasta $intentos intentos ". PHP_EOL;
echo " Modo de uso: \n connection_test host port user pwd db_name ". PHP_EOL;
exit(-1);
}

$HOST = $argv[1];
$PORT = filter_var($argv[2], FILTER_VALIDATE_INT);
$USR = $argv[3];
$env_pwd = $argv[4];
$BASE = $argv[5];

$PWD = (isset($_ENV[$env_pwd])) ? $_ENV[$env_pwd] : 'postgres';

if ($HOST == '' || $PORT === false || $USR == '' || $BASE == '') {
echo "Parametros incorrectos";
exit(-1);
}

$dsn = "pgsql:host=$HOST;dbname=$BASE;port=$PORT";
$count = 0;
$connFailed = true;
while ($connFailed) {
try {
$db = new PDO($dsn, $USR, $PWD);
$connFailed = false;
} catch (PDOException $e) {
$count++;
$connFailed = ($count < $intentos);
sleep (2);
echo "Intentando nuevamente..". PHP_EOL;
//echo $e->getMessage();
}
}
$retcode = ($count < $intentos) ? 0: $count;
exit($retcode);
?>
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"repositories": [
{
"type": "composer",
"url": "http://satis.siu.edu.ar"
"url": "https://satis.siu.edu.ar"
}
],
"config" : {
Expand All @@ -26,7 +26,8 @@
"siu-toba/ssl-cert-utils": "@dev",
"guzzlehttp/guzzle": "~6.0",
"onelogin/php-saml": "2.3.0",
"greenlion/PHP-SQL-Parser": "@dev"
"greenlion/PHP-SQL-Parser": "@dev",
"guiguiboy/PHP-CLI-Progress-Bar": "dev-master"
},
"bin": ["bin/toba"],
"autoload": {
Expand Down
89 changes: 67 additions & 22 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pgdata:
image: postgres:9.4
command: true
command: "true"
volumes:
#Comentar la siguiente linea para corregir permisos en OSX
- ./docker-data/pgdata:/var/lib/postgresql/data
Expand All @@ -20,7 +20,7 @@ web:
# TOBA_BASE_NOMBRE : toba
# TOBA_PROYECTO_DIR : /var/local/toba/proyectos/miproyecto
# TOBA_PROYECTO_ALIAS : /miproyecto
# TOBA_PROYECTO_INSTALAR : true
# TOBA_PROYECTO_INSTALAR : "true"
# TOBA_PROYECTO_INSTALAR_PARAMETROS : --base-nombre miproyecto
links:
- pg
Expand Down
2 changes: 1 addition & 1 deletion docker-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ web:
# TOBA_BASE_NOMBRE : toba
# TOBA_PROYECTO_DIR : /var/local/proyecto
# TOBA_PROYECTO_ALIAS : /miproyecto
# TOBA_PROYECTO_INSTALAR : true
# TOBA_PROYECTO_INSTALAR : "true"
# TOBA_PROYECTO_INSTALAR_PARAMETROS : --base-nombre miproyecto

links:
Expand Down
7 changes: 6 additions & 1 deletion php/lib/toba_ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ function get_entradas()
{
return $this->entradas;
}


function vaciar()
{
$this->entradas = array();
}

function existe_entrada($seccion, $nombre=null)
{
if (! isset($nombre)) {
Expand Down
Loading

0 comments on commit 732ba8b

Please sign in to comment.