本文整理汇总了PHP中Connect::setUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Connect::setUser方法的具体用法?PHP Connect::setUser怎么用?PHP Connect::setUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connect
的用法示例。
在下文中一共展示了Connect::setUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
/*
* configuracoes
*/
global $appName;
if (isset($appName)) {
$initPath = '../system-' . $appName . "/";
} else {
$initPath = "../system/";
}
require_once $initPath . 'vendor/cristal/config/CristalSettings.php';
require_once $initPath . 'config/Settings.php';
/*
* setar configuracoes de data
*/
date_default_timezone_set(Settings::$timeZone);
/*
* modo debug
*/
if (Settings::$debugMode) {
ini_set('display_errors', true);
if (Settings::$showWarning) {
error_reporting(E_ALL);
} else {
error_reporting(E_ERROR);
}
// error_reporting( E_ALL );
// error_reporting( E_ALL ^ E_NOTICE ^ E_WARNING );
} else {
/*
* oculta qualquer mensagem de erro
*/
ini_set('display_errors', false);
error_reporting(0);
}
/*
* conexao com o banco
*/
require_once Settings::$systemFolder . 'vendor/cristal/config/CristalConnect.php';
require_once Settings::$systemFolder . 'config/Connect.php';
Connect::setHost(Settings::$dbHost);
Connect::setUser(Settings::$dbUser);
Connect::setPass(Settings::$dbPass);
Connect::setDatabase(Settings::$dbName);
/*
* estrutura base de objetos
*/
require_once Settings::$systemFolder . 'vendor/cristal/CristalLib.php';
require_once Settings::$systemFolder . 'Lib.php';
require_once Settings::$systemFolder . 'vendor/cristal/model/Main.php';
require_once Settings::$systemFolder . 'vendor/cristal/model/MainDao.php';
require_once Settings::$systemFolder . 'vendor/cristal/controller/MainController.php';
// require_once Settings::$systemFolder . 'controller/AuthController.php';
@(require_once Settings::$systemFolder . 'controller/BaseController.php');
@(require_once Settings::$systemFolder . 'model/BaseModel.php');
@(require_once Settings::$systemFolder . 'model/BaseDao.php');
/*
* modo instalacao da aplicacao
*/
if (Settings::$installMode == true) {
require_once Settings::$systemFolder . 'vendor/cristal/install/CristalInstallController.php';
require_once Settings::$systemFolder . 'install/InstallController.php';
$install = new InstallController();
die;
}
/*
* trata a rota
*/
require_once Settings::$systemFolder . 'vendor/cristal/controller/CristalRouteController.php';
require_once Settings::$systemFolder . 'controller/RouteController.php';
require_once Settings::$systemFolder . 'vendor/cristal/model/CristalRoute.php';
$Route = new RouteController();
$model = $Route->model;
$action = $Route->action;
/*
* Objetos do framework
*/
self::loadCristalClasses();
/*
* Objetos do usuario
*/
require_once Settings::$systemFolder . 'controller/' . $model . 'Controller.php';
@(include_once Settings::$systemFolder . 'model/' . $model . '.php');
@(include_once Settings::$systemFolder . 'model/' . $model . 'Dao.php');
/*
* Inicia aplicacao
*/
$controller = $model . 'Controller';
$controller = new $controller();
$controller->run($model, $action);
}
示例2: setUser
public static function setUser()
{
global $params;
Connect::setUser($params);
}