当前位置: 首页>>代码示例>>PHP>>正文


PHP Autoloader::setClassPaths方法代码示例

本文整理汇总了PHP中Autoloader::setClassPaths方法的典型用法代码示例。如果您正苦于以下问题:PHP Autoloader::setClassPaths方法的具体用法?PHP Autoloader::setClassPaths怎么用?PHP Autoloader::setClassPaths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Autoloader的用法示例。


在下文中一共展示了Autoloader::setClassPaths方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: define

// 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();
开发者ID:albatronic,项目名称:hermes,代码行数:31,代码来源:index.php

示例2: error_reporting

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";
    }
开发者ID:albatronic,项目名称:agentescloud,代码行数:31,代码来源:fab.php

示例3: define

    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();
    }
开发者ID:albatronic,项目名称:hermes,代码行数:31,代码来源:actualizaRelacion.php

示例4: realpath

$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']);
开发者ID:nazimkabiri,项目名称:sims-beasiswa,代码行数:31,代码来源:index.php


注:本文中的Autoloader::setClassPaths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。