// CARGO LOS PARAMETROS DE CONFIGURACION. // --------------------------------------------------------------- $yaml = sfYaml::load('config/config.yml'); $config = $yaml['config']; $_SESSION['audit'] = $config['audit_mode']; $app = $config['app']; $app['audit'] = $_SESSION['audit']; $_SESSION['appPath'] = $app['path']; // --------------------------------------------------------------- // ACTIVAR EL AUTOLOADER DE CLASES Y FICHEROS A INCLUIR // --------------------------------------------------------------- define("APP_PATH", $_SERVER['DOCUMENT_ROOT'] . $app['path'] . "/"); include_once $app['framework'] . "Autoloader.class.php"; Autoloader::setCacheFilePath(APP_PATH . 'tmp/class_path_cache.txt'); Autoloader::excludeFolderNamesMatchingRegex('/^CVS|\\..*$/'); Autoloader::setClassPaths(array(APP_PATH . $app['framework'], APP_PATH . 'entities/', APP_PATH . 'lib/')); spl_autoload_register(array('Autoloader', 'loadClass')); //---------------------------------------------------------------- // ACTIVAR EL MOTOR DE PDF'S // --------------------------------------------------------------- if (file_exists($config['pdf'])) { include_once $config['pdf']; } else { die("NO SE PUEDE ENCONTRAR EL MOTOR PDF"); } //---------------------------------------------------------------- // ACTIVAR EL MOTOR TWIG PARA LOS TEMPLATES. //---------------------------------------------------------------- if (file_exists($config['twig']['motor'])) { include_once $config['twig']['motor']; Twig_Autoloader::register();
error_reporting(E_ERROR | E_WARNING | E_PARSE); 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"; }
echo "NO EXISTE LA CLASE PARA LEER ARCHIVOS YAML"; exit; } // --------------------------------------------------------------- // CARGO LOS PARAMETROS DE CONFIGURACION. // --------------------------------------------------------------- $config = sfYaml::load('../config/config.yml'); $app = $config['config']['app']; // --------------------------------------------------------------- // ACTIVAR EL AUTOLOADER DE CLASES Y FICHEROS A INCLUIR // --------------------------------------------------------------- define("APP_PATH", $_SERVER['DOCUMENT_ROOT'] . $app['path'] . "/"); include_once "../" . $app['framework'] . "Autoloader.class.php"; Autoloader::setCacheFilePath(APP_PATH . 'tmp/class_path_cache.txt'); Autoloader::excludeFolderNamesMatchingRegex('/^CVS|\\..*$/'); Autoloader::setClassPaths(array('../' . $app['framework'], '../entities/', '../lib/')); spl_autoload_register(array('Autoloader', 'loadClass')); $v = $_GET; $relacion = new CpanRelaciones(); $idRelacion = $relacion->getIdRelacion($v['entidadOrigen'], $v['idOrigen'], $v['entidadDestino'], $v['idDestino']); if ($v['onOff']) { // Hacer relacion if (!$idRelacion) { $relacion = new CpanRelaciones(); $relacion->setEntidadOrigen($v['entidadOrigen']); $relacion->setIdEntidadOrigen($v['idOrigen']); $relacion->setEntidadDestino($v['entidadDestino']); $relacion->setIdEntidadDestino($v['idDestino']); $relacion->setPublish(1); $relacion->create(); }
$sitepath = realpath(dirname(__FILE__)); define('ROOT', $sitepath); //echo $sitepath; /* * define the sitepath url */ $base_url = 'http://' . $_SERVER['HTTP_HOST'] . '/beasiswa/'; //echo $base_url; define('URL', $base_url); $path = array(ROOT . '/libs/', ROOT . '/app/controllers/', ROOT . '/app/models/', ROOT . '/app/dao/'); //include ROOT.'/config/config.php'; include ROOT . '/libs/Autoloader.php'; include ROOT . '/libs/config.php'; include ROOT . '/app/akses.php'; Autoloader::setCacheFilePath(ROOT . '/libs/cache.txt'); Autoloader::setClassPaths($path); Autoloader::register(); $registry = new Registry(); $registry->upload = new Upload(); $registry->view = new View(); $registry->db = Database::get_instance(); $registry->auth = new Auth(); $registry->auth->add_roles('admin'); $registry->auth->add_access('admin', 'admin', $akses['Admin']); $registry->auth->add_access('auth', 'admin', 'logout'); $registry->auth->add_roles('pic'); $registry->auth->add_access('cuti', 'pic', $akses['Cuti']); $registry->auth->add_access('surattugas', 'pic', $akses['Surattugas']); $registry->auth->add_access('elemenBeasiswa', 'pic', $akses['ElemenBeasiswa']); $registry->auth->add_access('kontrak', 'pic', $akses['Kontrak']); $registry->auth->add_access('penerima', 'pic', $akses['Penerima']);