本文整理汇总了PHP中System::singleton方法的典型用法代码示例。如果您正苦于以下问题:PHP System::singleton方法的具体用法?PHP System::singleton怎么用?PHP System::singleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System
的用法示例。
在下文中一共展示了System::singleton方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
require_once 'libs/config.php';
$this->_system = System::singleton();
$this->_hat = new Hat();
$this->_shoe = new Shoe();
$data["baseHref"] = $this->_system->GetBaseRef();
$data["skin"] = $this->_system->get('skin');
$data['env'] = $this->_system->getEnviroment();
$data['token'] = session_id();
//token for cross site injection
$this->_hat->pintaHat('login');
$array_bg = array();
$directory = $this->_system->get('background');
$dirint = dir($directory);
while (($archivo = $dirint->read()) !== false) {
if (eregi("gif", $archivo) || eregi("jpg", $archivo) || eregi("png", $archivo)) {
array_push($array_bg, $directory . $archivo);
}
}
$dirint->close();
$data['background'] = $array_bg;
$this->_system->fShow($this->_system->get('skin') . "/tpl_login.php", $data);
$this->_shoe->pintaShoe();
}
示例2: __construct
function __construct()
{
require_once 'libs/config.php';
$this->_system = System::singleton();
new Check();
$this->_hat = new Hat();
$this->_shoe = new Shoe();
$data["baseHref"] = $this->_system->GetBaseRef();
$data["skin"] = $this->_system->get('skin');
$data['env'] = $this->_system->getEnviroment();
$data['dbconsumer'] = $_SESSION['consumerdb'];
$data['dbmanager'] = $_SESSION['dbmanager'];
$data['dbquality'] = $_SESSION['dbquality'];
$data['dbwater'] = $_SESSION['dbwater'];
$data['dbenergy'] = $_SESSION['dbbnergy'];
$data['dbsmartmeter'] = false;
$this->_hat->pintaHat('home');
$array_bg = array();
$directory = $this->_system->get('background');
$dirint = dir($directory);
while (($archivo = $dirint->read()) !== false) {
if (eregi("gif", $archivo) || eregi("jpg", $archivo) || eregi("png", $archivo)) {
array_push($array_bg, $directory . $archivo);
}
}
$dirint->close();
$data['background'] = $array_bg;
$this->_system->fShow($this->_system->get('skin') . "/tpl_mhome.php", $data);
$this->_shoe->pintaShoe();
}
示例3: __construct
function __construct()
{
$this->_system = System::singleton();
//contiene objeto system
$this->_ruta = $this->_system->GetBaseRef();
$this->_detect = new Mobile_Detect();
}
示例4: __construct
function __construct()
{
require_once 'libs/config.php';
//Archivo con configuraciones.
$this->_system = System::singleton();
//contiene objeto system
echo "render error page";
}
示例5: __construct
function __construct()
{
require_once 'libs/config.php';
$this->_system = System::singleton();
$this->_hat = new Hat();
$this->_shoe = new Shoe();
$data["baseHref"] = $this->_system->GetBaseRef();
$data["skin"] = $this->_system->get('skin');
$data['env'] = $this->_system->getEnviroment();
$data['token'] = session_id();
//token for cross site injection
$pwd1 = empty($_POST['pwd1']) ? null : $this->_system->nohacker($_POST['pwd1']);
$pwd2 = empty($_POST['pwd2']) ? null : $this->_system->nohacker($_POST['pwd2']);
$hash = empty($_GET['h']) ? null : $this->_system->nohacker($_GET['h']);
$token = empty($_POST['token']) ? null : $this->_system->nohacker($_POST['token']);
$this->_hat->pintaHat('login');
$array_bg = array();
$directory = $this->_system->get('background');
$dirint = dir($directory);
while (($archivo = $dirint->read()) !== false) {
if (eregi("gif", $archivo) || eregi("jpg", $archivo) || eregi("png", $archivo)) {
array_push($array_bg, $directory . $archivo);
}
}
$dirint->close();
$data['background'] = $array_bg;
if ($pwd1) {
if ($token === session_id()) {
$id = empty($_POST['id']) ? null : $this->_system->nohacker($_POST['id']);
require_once 'libs/apps/users/class.users.php';
$users = new Users();
$request = $users->resetPwd($id, $pwd1);
$this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_4.php", $data);
} else {
echo "Cross site injection detected";
}
} else {
if ($hash) {
require_once 'libs/apps/users/class.users.php';
$users = new Users();
$request = $users->validateRecoveryHash($hash);
/*
echo "<pre>";
print_r($request);
echo "</pre>";
*/
if ($request['status'] === "Accepted") {
$data['id'] = $request['message']['users_id'];
$this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_3.php", $data);
} else {
$this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_5.php", $data);
}
} else {
$this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_5.php", $data);
}
}
$this->_shoe->pintaShoe();
}
示例6: __construct
function __construct()
{
require_once 'libs/config.php';
$this->_system = System::singleton();
$data["baseHref"] = $this->_system->GetBaseRef();
$data["skin"] = $this->_system->get('skin');
$data['env'] = $this->_system->getEnviroment();
$this->_system->fShow($this->_system->get('skin') . "/tpl_index.php", $data);
}
示例7: __construct
function __construct()
{
require_once 'libs/config.php';
$this->_system = System::singleton();
$this->_hat = new Hat();
$this->_shoe = new Shoe();
$data["baseHref"] = $this->_system->GetBaseRef();
$data["skin"] = $this->_system->get('skin');
$data["env"] = $this->_system->getEnviroment();
$this->_hat->pintaHat();
$this->_system->fShow($this->_system->get('skin') . "/tpl_maqueta.php", $data);
$this->_shoe->pintaShoe();
}
示例8: __construct
function __construct()
{
require_once 'libs/config.php';
$this->_system = System::singleton();
if ($_SESSION['consumerdb']) {
$data["baseHref"] = $this->_system->GetBaseRef();
$data["skin"] = $this->_system->get('skin');
$data['env'] = $this->_system->getEnviroment();
$this->_system->fShow($this->_system->get('skin') . "/tpl_demo_map.php", $data);
} else {
echo "No access to this page";
}
}
示例9: __construct
function __construct()
{
require_once 'libs/config.php';
$this->_system = System::singleton();
$data["baseHref"] = $this->_system->GetBaseRef();
$data["skin"] = $this->_system->get('skin');
$data['env'] = $this->_system->getEnviroment();
$data['urlWMS'] = $this->_system->get('urlWMS');
$data['token'] = session_id();
$data['update'] = 1;
//$data['update'] = $_SESSION['update'];
$detect = new Mobile_Detect();
$data['isMobile'] = $detect->isMobile() === true && $detect->isTablet() === false ? '1' : '0';
$this->_system->fShow($this->_system->get('skin') . "/tpl_dbwater.php", $data);
}
示例10: __construct
function __construct()
{
require_once 'libs/config.php';
$this->_system = System::singleton();
$this->_hat = new Hat();
$this->_shoe = new Shoe();
$data["baseHref"] = $this->_system->GetBaseRef();
$data["skin"] = $this->_system->get('skin');
$data['env'] = $this->_system->getEnviroment();
$data['token'] = session_id();
//token for cross site injection
$email = empty($_POST['email']) ? null : $this->_system->nohacker($_POST['email']);
$token = empty($_POST['token']) ? null : $this->_system->nohacker($_POST['token']);
$type = empty($_GET['t']) ? null : $this->_system->nohacker($_GET['t']);
$this->_hat->pintaHat('login');
$array_bg = array();
$directory = $this->_system->get('background');
$dirint = dir($directory);
while (($archivo = $dirint->read()) !== false) {
if (eregi("gif", $archivo) || eregi("jpg", $archivo) || eregi("png", $archivo)) {
array_push($array_bg, $directory . $archivo);
}
}
$dirint->close();
$data['background'] = $array_bg;
if ($email) {
if ($token === session_id()) {
require_once 'libs/apps/users/class.users.php';
$users = new Users();
$request = $users->recoveryRequest($email);
if ($request['status'] === "Accepted") {
$data['ok'] = true;
$this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_2.php", $data);
} else {
$data['ok'] = false;
$this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_2.php", $data);
}
} else {
echo "Cross site injection detected";
}
} else {
$data['type'] = $type;
$this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_1.php", $data);
}
$this->_shoe->pintaShoe();
}
示例11: __construct
function __construct()
{
require_once 'libs/config.php';
//Archivo con configuraciones.
$this->_system = System::singleton();
//contiene objeto system
if ($_POST['token'] != session_id()) {
header('location: error.php');
} else {
require_once 'libs/apps/users/class.users.php';
//Archivo con configuraciones.
$users = new Users();
$user = $this->_system->nohacker($_POST['user']);
$pwd = $this->_system->nohacker($_POST['pwd']);
$login = $users->login($user, $pwd);
/*echo "<pre>";
print_r($login);
echo "</pre>";
*/
if ($login['status'] === "Accepted") {
$_SESSION['logged'] = true;
$_SESSION['id'] = $login['message']['id'];
$_SESSION['nick'] = $_POST['user'];
$_SESSION['consumerdb'] = $login['message']['consumerdb'];
$_SESSION['dbmanager'] = $login['message']['dbmanager'];
$_SESSION['dbquality'] = $login['message']['dbquality'];
$_SESSION['dbwater'] = $login['message']['dbwater'];
$_SESSION['dbbnergy'] = $login['message']['dbbnergy'];
$_SESSION['update'] = (int) $login['message']['update'];
/*echo "<pre>";
print_r($_SESSION);
echo "</pre>";*/
header('location: home.php');
} else {
if ($login['code'] === 412) {
//code 412 password must be regenerated
header('location: pwd_recovery.php?t=regenerate');
} else {
header('location: index.php?e=login_error');
}
}
}
}
示例12: __construct
function __construct()
{
$host = "localhost";
$name = "test";
$user = "llopez";
$pwd = "";
require_once 'libs/config.php';
//Archivo con configuraciones.
$this->_system = System::singleton();
//contiene objeto system
$dbconn = pg_connect("host=localhost dbname=test user=llopez password=") or die('No se ha podido conectar: ' . pg_last_error());
//perform the insert using pg_query
/*$result = pg_query($dbconn, "INSERT INTO testtable(name)
VALUES('pedo');");*/
$result = pg_query($dbconn, "SELECT * FROM testtable");
//dump the result object
var_dump($result);
// Closing connection
pg_close($dbconn);
echo "<br>PDO<br>";
$pdo = new PDOdbp(PDO_PGSQL, $host, $name, $user, $pwd, $dbids);
echo "<br>Insert:<br>";
$pdo->prepare_insert("testtable", "id,name");
$last_id = $pdo->insert(array(2, "algo"));
echo "lastId: " . $last_id . "<br>";
echo "<br>Update:<br>";
$pdo->prepare_update("testtable", "name", null, "id=1");
$pdo->update(array('ogtro', 2));
echo "<br>Select:<br>";
$query = "SELECT * FROM testtable";
$select = $pdo->prepare_select($query);
$rs = $pdo->select();
var_dump($rs);
echo "<br><br>Select con bind:<br>";
$query = "SELECT * FROM testtable WHERE id= :v1";
$pdo->prepare_select($query);
$pdo->bind(":v1", 2);
$rs = $pdo->select();
var_dump($rs);
}
示例13: __construct
function __construct()
{
header('Content-Type: application/json');
require_once 'libs/config.php';
//Archivo con configuraciones.
$this->_system = System::singleton();
//contiene objeto system
$_POST = json_decode(file_get_contents('php://input'), true);
require_once 'libs/apps/alerts/class.alerts.php';
$alerts = new Alerts();
$what = empty($_POST['what']) ? null : $_POST['what'];
$token = empty($_POST['token']) ? null : $_POST['token'];
if ($token === session_id()) {
if ($what === "LIST_ALERTS") {
$period = empty($_POST['period']) ? null : $_POST['period'];
$type = empty($_POST['type']) ? null : $_POST['type'];
$data = array('period' => $period, 'type' => $type);
$current_alerts = $alerts->listAlerts($data);
echo json_encode($current_alerts);
}
} else {
echo json_encode(array("status" => "Failed", "message" => "Cross site injection detected", "code" => 501));
}
}
示例14: __construct
function __construct()
{
$this->_system = System::singleton();
//contiene objeto system
}
示例15: __construct
function __construct()
{
$system = System::singleton();
}