本文整理汇总了PHP中FLEA::setAppInf方法的典型用法代码示例。如果您正苦于以下问题:PHP FLEA::setAppInf方法的具体用法?PHP FLEA::setAppInf怎么用?PHP FLEA::setAppInf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLEA
的用法示例。
在下文中一共展示了FLEA::setAppInf方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Generator_Abstract
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: Controller_ZobBase
/**
* 构造函数
*
* 负责根据用户的 session 设置载入语言文件
*
* @return Controller_OfficeBase
*/
function Controller_ZobBase()
{
if (isset($_SESSION['LANG'])) {
$lang = $_SESSION['LANG'];
$languages = FLEA::getAppInf('languages');
if (in_array($lang, $languages, true)) {
FLEA::setAppInf('defaultLanguage', $lang);
}
}
load_language('ui, exception');
}
示例3: array
<?php
require 'FLEA.php';
$dbDSN = array('driver' => 'mysqlt', 'host' => 'localhost', 'login' => 'root', 'password' => '', 'database' => 'test');
FLEA::setAppInf('dbDSN', $dbDSN);
FLEA::setAppInf('internalCacheDir', 'D:/temp');
$dbo =& FLEA::getDBO();
$dbo->startTrans();
/**
* 建立全部需要的权限
*/
$tablePermissions =& FLEA::getSingleton('FLEA_Acl_Table_Permissions');
/* @var $tablePermissions FLEA_Acl_Table_Permissions */
$permissions = array(array('name' => '/Project/Create'), array('name' => '/Project/View'), array('name' => '/Project/Edit'), array('name' => '/Project/Delete'), array('name' => '/Bug/Create'), array('name' => '/Bug/View'), array('name' => '/Bug/Edit'), array('name' => '/Bug/AddComment'), array('name' => '/Bug/SetFixed'), array('name' => '/Bug/SetClosed'), array('name' => '/Bug/Delete'));
$tablePermissions->createRowset($permissions);
$permissions = $tablePermissions->findAll();
FLEA::loadHelper('array');
$permissions = array_to_hashmap($permissions, 'name');
/**
* 建立角色,并将权限绑定到角色上
*/
$tableRoles =& FLEA::getSingleton('FLEA_Acl_Table_Roles');
/* @var $tableRoles FLEA_Acl_Table_Roles */
$role = array('name' => 'ProjectManager', 'permissions' => array($permissions['/Project/Create'], $permissions['/Project/View'], $permissions['/Project/Edit'], $permissions['/Project/Delete'], $permissions['/Bug/Delete']));
$tableRoles->create($role);
$role = array('name' => 'Developer', 'permissions' => array($permissions['/Project/View'], $permissions['/Bug/View'], $permissions['/Bug/AddComment'], $permissions['/Bug/SetFixed'], $permissions['/Bug/Delete']));
$tableRoles->create($role);
$role = array('name' => 'Tester', 'permissions' => array($permissions['/Project/Create'], $permissions['/Bug/Create'], $permissions['/Bug/Edit'], $permissions['/Bug/View'], $permissions['/Bug/AddComment'], $permissions['/Bug/SetClosed']));
$tableRoles->create($role);
/**
* 读取所有角色信息,并以角色名为索引
示例4: _executeAction
/**
* 执行指定的 Action 方法
*
* @param string $controllerName
* @param string $actionName
* @param string $controllerClass
*
* @return mixed
*/
function _executeAction($controllerName, $actionName, $controllerClass)
{
$callback = FLEA::getAppInf('dispatcherFailedCallback');
// 确定动作方法名
$actionPrefix = FLEA::getAppInf('actionMethodPrefix');
$actionMethod = $actionPrefix . $actionName . FLEA::getAppInf('actionMethodSuffix');
$controller = null;
$controllerClassFilename = null;
do {
// 载入控制对应的类定义
if (!$this->_loadController($controllerClass)) {
break;
}
// 构造控制器对象
FLEA::setAppInf('FLEA.internal.currentControllerName', $controllerName);
FLEA::setAppInf('FLEA.internal.currentActionName', $actionName);
$controller =& new $controllerClass($controllerName);
if (!method_exists($controller, $actionMethod)) {
break;
}
if (method_exists($controller, '__setController')) {
$controller->__setController($controllerName, $actionName);
}
if (method_exists($controller, '__setDispatcher')) {
$controller->__setDispatcher($this);
}
// 调用 _beforeExecute() 方法
if (method_exists($controller, '_beforeExecute')) {
$controller->_beforeExecute($actionMethod);
}
// 执行 action 方法
$ret = $controller->{$actionMethod}();
// 调用 _afterExecute() 方法
if (method_exists($controller, '_afterExecute')) {
$controller->_afterExecute($actionMethod);
}
return $ret;
} while (false);
if ($callback) {
// 检查是否调用应用程序设置的错误处理程序
$args = array($controllerName, $actionName, $controllerClass);
return call_user_func_array($callback, $args);
}
if (is_null($controller)) {
FLEA::loadClass('FLEA_Exception_MissingController');
__THROW(new FLEA_Exception_MissingController($controllerName, $actionName, $this->_requestBackup, $controllerClass, $actionMethod, $controllerClassFilename));
return false;
}
FLEA::loadClass('FLEA_Exception_MissingAction');
__THROW(new FLEA_Exception_MissingAction($controllerName, $actionName, $this->_requestBackup, $controllerClass, $actionMethod, $controllerClassFilename));
return false;
}
示例5: array
<?php
require '../../FLEA.php';
$dbDSN = array('driver' => 'mysqlt', 'host' => 'localhost', 'login' => 'root', 'password' => 'phpwind.net', 'database' => 'acl');
FLEA::setAppInf('dbDSN', $dbDSN);
FLEA::setAppInf('internalCacheDir', 'D:/usr/www/rbac/_Cache');
$dbo =& FLEA::getDBO();
$dbo->startTrans();
/**
* 建立全部需要的权限
*/
$tablePermissions =& FLEA::getSingleton('FLEA_Acl_Table_Permissions');
/* @var $tablePermissions FLEA_Acl_Table_Permissions */
$permissions = array(array('name' => '/Project/Create'), array('name' => '/Project/View'), array('name' => '/Project/Edit'), array('name' => '/Project/Delete'), array('name' => '/Bug/Create'), array('name' => '/Bug/View'), array('name' => '/Bug/Edit'), array('name' => '/Bug/AddComment'), array('name' => '/Bug/SetFixed'), array('name' => '/Bug/SetClosed'), array('name' => '/Bug/Delete'));
$tablePermissions->createRowset($permissions);
$permissions = $tablePermissions->findAll();
FLEA::loadHelper('array');
$permissions = array_to_hashmap($permissions, 'name');
/**
* 建立角色,并将权限绑定到角色上
*/
$tableRoles =& FLEA::getSingleton('FLEA_Acl_Table_Roles');
/* @var $tableRoles FLEA_Acl_Table_Roles */
$role = array('name' => 'ProjectManager', 'permissions' => array($permissions['/Project/Create'], $permissions['/Project/View'], $permissions['/Project/Edit'], $permissions['/Project/Delete'], $permissions['/Bug/Delete']));
$tableRoles->create($role);
$role = array('name' => 'Developer', 'permissions' => array($permissions['/Project/View'], $permissions['/Bug/View'], $permissions['/Bug/AddComment'], $permissions['/Bug/SetFixed'], $permissions['/Bug/Delete']));
$tableRoles->create($role);
$role = array('name' => 'Tester', 'permissions' => array($permissions['/Project/Create'], $permissions['/Bug/Create'], $permissions['/Bug/Edit'], $permissions['/Bug/View'], $permissions['/Bug/AddComment'], $permissions['/Bug/SetClosed']));
$tableRoles->create($role);
/**
* 读取所有角色信息,并以角色名为索引
示例6: set_app_inf
/**
* 修改设置值(已经过时,用 FLEA::setAppInf() 代替)
*
* @param string $option
* @param mixed $data
* @deprecated
*/
function set_app_inf($option, $data = null)
{
FLEA::setAppInf($option, $data);
}
示例7: define
<?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)) {
示例8: define
*
* @copyright Copyright (c) 2005 - 2008 QeeYuan China Inc. (http://www.qeeyuan.com)
* @author 起源科技 (www.qeeyuan.com)
* @package Example
* @subpackage Smarty
* @version $Id: index.php 972 2007-10-09 20:56:54Z qeeyuan $
*/
/**
* 首先引入 FleaPHP 的库文件,并会做一些基本的处理
*/
define('NO_LEGACY_FLEAPHP', true);
require './FLEA/FLEA.php';
require './config.inc.php';
/**
* 指定数据库连接设置,TableDataGateway 会自动取出 dbDSN 设置来连接数据库。
* FLEA::loadAppInf() 会用开发者指定的应用程序设置覆盖 FleaPHP 提供的默认设置。
* 开发者可以使用 FLEA::getAppInf() 取出任意应用程序设置。
*/
/**
* 要使用 Smarty,必须做两项准备工作
*
* 1、设置应用程序的 view 选项为 FLEA_View_Smarty;
* 2、设置应用程序的 viewConfig 选项为数组,数组中必须包含
* smartyDir 选项,指示 Smarty 模版引擎源代码所在目录。
*
* 如果需要在构造 FLEA_View_Smarty 时就初始化 Smarty 模版引擎的设置,
* 直接放置在 viewConfig 选项数组中即可。
*/
FLEA::setAppInf('urlMode', URL_PATHINFO);
FLEA::import(APP_DIR);
FLEA::runMVC();