Example #1
0
 /**
  * Initializes a new fab with colors appropriate for terminals capable of
  * displaying 256 colors.
  */
 public function __construct()
 {
     /**
      * https://github.com/seattlerb/minitest/blob/4373fc7ebf648e156902958466cc4678945eac29/lib/minitest/pride.rb#L78-L96
      */
     foreach (range(0, 6 * 7) as $color) {
         $color *= 1.0 / 6;
         $r = (int) (3 * sin($color) + 3);
         $g = (int) (3 * sin($color + 2 * (M_PI / 3)) + 3);
         $b = (int) (3 * sin($color + 4 * (M_PI / 3)) + 3);
         $colors[] = 36 * $r + 6 * $g + $b + 16;
     }
     return parent::__construct($colors);
 }
Example #2
0
if (file_exists("../yaml/lib/sfYaml.php")) {
    include "../yaml/lib/sfYaml.php";
} else {
    die("NO EXISTE LA CLASE PARA LEER ARCHIVOS YAML\n");
}
// ---------------------------------------------------------------
// ACTIVAR EL AUTOLOADER DE CLASES Y FICHEROS A INCLUIR
// ---------------------------------------------------------------
include_once "Autoloader.class.php";
$path = str_replace("/bin/albatronic", "", __DIR__);
$path = str_replace("\\bin\\albatronic", "", $path);
// Para el caso de msdos
Autoloader::setCacheFilePath($path . '/tmp/class_path_cache.txt');
Autoloader::excludeFolderNamesMatchingRegex('/^CVS|\\..*$/');
Autoloader::setClassPaths(array(__DIR__ . "/", $path . '/entities/methods/', $path . '/entities/models/', $path . '/entities/abstract/'));
spl_autoload_register(array('Autoloader', 'loadClass'));
$config = sfYaml::load('../../config/config.yml');
$_SESSION['conections'] = $config['config']['conections'];
$_SESSION['debug'] = $config['config']['debug'];
$_SESSION['produccion'] = strtolower($config['config']['enviroment']) == 'prod';
$_SESSION['idiomas']['actual'] = 0;
$_SESSION['usuarioPortal']['Id'] = 1;
if ($argc < 2) {
    Fab::usage();
} else {
    if (!$_SESSION['produccion']) {
        Fab::interpreta($argv);
    } else {
        echo "No disponible en entorno de produccion\n";
    }
}
Example #3
0
 static function getConection()
 {
     $config = sfYaml::load("../../config/config.yml");
     $conections = $config['config']['conections'];
     list($key, $conection) = each($conections);
     if ($conection['charset'] == '') {
         $conection['charset'] = 'utf8';
     }
     if ($conection['collate'] == '') {
         $conection['collate'] = 'utf8_general_ci';
     }
     //print_r($conection);
     self::$conectionDB = $conection;
     self::$conectionDB['dropTablesIfExists'] = true;
 }