當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。