示例#1
0
 function Generator_Abstract()
 {
     FLEA::import(FLEA::getAppInfValue('scripts', 'appDir'));
     ob_start();
     $return = (include FLEA::getAppInfValue('scripts', 'appConfigFile'));
     ob_clean();
     if (isset($return['dbDSN'])) {
         FLEA::setAppInf('dbDSN', $return['dbDSN']);
     }
 }
示例#2
0
<?php

$configFilename = 'DSN.php';
if (!is_readable($configFilename)) {
    header('Location: install/setup-required.php');
}
define('SHARED_DIR', dirname(realpath($configFilename)));
define('APP_DIR', dirname(__FILE__) . '/APP');
// UPLOAD_DIR 常量用于指示保存上传文件的根目录
define('UPLOAD_DIR', dirname(__FILE__) . '/upload');
// UPLOAD_ROOT 常量用于指示用什么 URL 路径访问上传目录
define('UPLOAD_ROOT', 'upload');
define('NO_LEGACY_FLEAPHP', true);
require 'FLEA/FLEA.php';
FLEA::loadAppInf($configFilename);
FLEA::loadAppInf(APP_DIR . '/Config/ZOB_APP_INF.php');
FLEA::import(APP_DIR);
FLEA::runMVC();
/**
 * 增加文件搜索路径(已经过时,用 FLEA::import() 代替)
 *
 * @param string $dir
 * @deprecated
 */
function import($dir)
{
    FLEA::import($dir);
}
<?php

define('ROOT_DIR', dirname(__FILE__));
require ROOT_DIR . '/Libs/FLEA/FLEA.php';
require ROOT_DIR . '/Libs/Config/sys_env.php';
FLEA::loadAppInf(ROOT_DIR . '/Libs/Config/FLEA_CONFIG.php');
//如果ACT文件存在 则加载 否则使用默认ACT文件
if (file_exists(ROOT_DIR . '/_Cache/ACT.php')) {
    FLEA::setAppInf('defaultControllerACTFile', ROOT_DIR . '/_Cache/ACT.php');
}
FLEA::import(ROOT_DIR . '/App');
//FLEA::loadClass('Sys_Core');
FLEA::runMVC();
/**
 * 无法找到控制器时的错误处理
 *
 */
function onDispatcherFailedCallback($controller, $action)
{
    echo "你所访问的控制器" . $controller . "中" . $action . "方法不存在";
    //redirect(url(null, null, array('requestUri' => $_SERVER['REQUEST_URI'])));
}
/**
 * 权限认证失败时的错误处理
 *
 */
function onAuthFailedCallback($controller, $action)
{
    $sessionKey = FLEA::getAppInf('RBACSessionKey');
    $username = $_SESSION[$sessionKey]['USERNAME'];
    if (empty($username)) {
示例#5
0
 function Generator($argv)
 {
     $this->_argv = $argv;
     FLEA::import(dirname(__FILE__));
 }