Пример #1
0
 public function __construct()
 {
     parent::__construct();
     $this->cacheFile = dirname(__FILE__) . 'class_path_cache.txt';
     $this->removeCacheFile();
     include_once dirname(dirname(dirname(__FILE__))) . '/extras/Autoloader.class.php';
     Autoloader::addClassPath(dirname(__FILE__) . '/classes_app/');
     Autoloader::addClassPath(dirname(__FILE__) . '/classes_shared/');
     Autoloader::setCacheFilePath($this->cacheFile);
     //Autoloader::excludeFolderNamesMatchingRegex('/^CVS|\..*$/');
     spl_autoload_register(array('Autoloader', 'loadClass'));
 }
Пример #2
0
}
// ---------------------------------------------------------------
// 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'])) {
Пример #3
0
 */
// Notificar solamente errores de ejecución
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 {
Пример #4
0
 */
$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']);
Пример #5
0
<?php

session_start();
define('APP_ROOT', dirname(__FILE__) . '/protected');
// Get CoughPHP
require_once APP_ROOT . '/vendor/coughphp/load.inc.php';
require_once APP_ROOT . '/vendor/coughphp/as_database/load.inc.php';
require_once APP_ROOT . '/vendor/coughphp/extras/Autoloader.class.php';
Autoloader::addClassPath(APP_ROOT . '/models/');
Autoloader::setCacheFilePath(APP_ROOT . '/cache/cough_class_path_cache.txt');
spl_autoload_register(array('Autoloader', 'loadClass'));
// Get config stuff
require_once APP_ROOT . '/config/config.php';
require_once APP_ROOT . '/config/routes.php';
require_once APP_ROOT . '/config/database.php';
// Get system classes
require_once APP_ROOT . '/system/view.php';
require_once APP_ROOT . '/system/controller.php';
require_once APP_ROOT . '/system/uri.php';
// Parse URI
if (false === strpos($_SERVER['REQUEST_URI'], $config['uri_prefix'])) {
    die('Configuration Error - Bad uri_prefix');
}
$path = substr($_SERVER['REQUEST_URI'], strlen($config['uri_prefix']));
$components = explode('/', $path);
for ($i = 0; $i < count($components); ++$i) {
    if (empty($components[$i])) {
        unset($components[$i]);
    }
}
$controller_name = $config['default_controller'];