本文整理汇总了PHP中Registry::getObject方法的典型用法代码示例。如果您正苦于以下问题:PHP Registry::getObject方法的具体用法?PHP Registry::getObject怎么用?PHP Registry::getObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registry
的用法示例。
在下文中一共展示了Registry::getObject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
/*
* Sets $loginStatus result of the authorization check.
**/
$this->loginStatus = LoginStatus::getLoginStatus();
$this->registry = Registry::getInstance();
$request = $this->registry->getObject('request');
/*
* Contains $_POST
* */
$this->post_data = $request->getPostData();
}
示例2: __construct
/**
* API Controller Constructor
* @param Registry $registry the registry
* @param boolean $directCall
* @return void
*/
public function __construct(Registry $registry, $directCall = true)
{
$this->registry = $registry;
$apiController = $registry->getObject('url')->getURLBit(1);
$this->delegateControl($apiController);
}
示例3: loadAdminController
public function loadAdminController(Registry $registry, $controller)
{
$adminControllers = array();
$queryStr = "SELECT * FROM controllers_admin WHERE active = 1";
$registry->getObject('db')->execute($queryStr);
while ($adctrl = $registry->getObject('db')->getRows()) {
$adminControllers[] = $adctrl['controller'];
}
if (isset($controller) && is_string($controller) && in_array($controller, $adminControllers)) {
require_once 'protected/admin/controllers/' . ucfirst($controller) . 'Controller.php';
$controllerInc = ucfirst($controller) . 'Controller';
$controller = new $controllerInc($registry);
return $controller;
} else {
$registry->redirectTo();
}
}
示例4: dirname
<?php
session_start();
DEFINE("FRAMEWORK_PATH", dirname(__FILE__) . "/");
require 'registry/registry.class.php';
$registry = new Registry();
// setup our core registry objects
$registry->createAndStoreObject('template', 'template');
$registry->createAndStoreObject('mysqldb', 'db');
$registry->createAndStoreObject('authenticate', 'authenticate');
$registry->createAndStoreObject('urlprocessor', 'url');
$registry->getObject('url')->getURLData();
// database settings
include FRAMEWORK_PATH . 'config.php';
// create a database connection
$registry->getObject('db')->newConnection($configs['db_host_sn'], $configs['db_user_sn'], $configs['db_pass_sn'], $configs['db_name_sn']);
$controller = $registry->getObject('url')->getURLBit(0);
if ($controller != 'api') {
$registry->getObject('authenticate')->checkForAuthentication();
}
// store settings in our registry
$settingsSQL = "SELECT `key`, `value` FROM settings";
$registry->getObject('db')->executeQuery($settingsSQL);
while ($setting = $registry->getObject('db')->getRows()) {
$registry->storeSetting($setting['value'], $setting['key']);
}
$registry->getObject('template')->getPage()->addTag('siteurl', $registry->getSetting('siteurl'));
$registry->getObject('template')->buildFromTemplates('header.tpl.php', 'main.tpl.php', 'footer.tpl.php');
$controllers = array();
$controllersSQL = "SELECT * FROM controllers WHERE active=1";
$registry->getObject('db')->executeQuery($controllersSQL);
示例5:
$registry->createAndStoreObject('Session', 'session');
$registry->createAndStoreObject('Email', 'mailout');
$registry->createAndStoreObject('Paginator', 'paginator');
$registry->createAndStoreModel('Authenticate', 'authenticate');
$registry->createAndStoreModel('Registration', 'register');
$registry->createAndStoreModel('Products', 'products');
$registry->createAndStoreModel('Categories', 'categories');
$registry->createAndStoreModel('Authors', 'authors');
$registry->createAndStoreModel('Basket', 'basket');
$registry->createAndStoreModel('User', 'user');
$registry->createAndStoreModel('Account', 'account');
$registry->createAndStoreModel('Rating', 'rating');
$registry->createAndStoreModel('Review', 'review');
$registry->createAndStoreModel('Checkout', 'checkout');
$registry->createAndStoreModel('UploadFiles', 'upload');
$registry->getObject('url')->getURLData();
$registry->storeSetting('default', 'view');
$registry->storeSetting('template', 'template');
$registry->storeSetting('authentication', 'authenticate');
$registry->storeSetting('Book Store', 'sitename');
$registry->storeSetting('https://', 'protocol');
$registry->storeSetting($registry->getSetting('protocol') . 'localhost/bookstore/', 'siteurl');
include 'protected/config/config.php';
// create database connection
$registry->getObject('db')->newConnection(DB_SERVER, DB_NAME, DB_USER, DB_PASS);
// process authentication
$registry->getModel('authenticate')->checkForAuthentication();
if ($registry->getModel('authenticate')->isLoggedIn() === true) {
$registry->getObject('template')->username = $registry->getObject('session')->get('firstName');
$registry->getObject('template')->loggedIn = $registry->getModel('authenticate')->isLoggedIn();
}
示例6: Registry
<?php
try {
session_start();
//Session start
require "registry/registry.php";
$registry = new Registry();
//$_SESSION['sn_auth_session_uid'] = '';
//setup our core registry objects
$registry->setObject('template', 'template');
$registry->setObject('mysqldb', 'db');
$registry->setObject('authentication', 'authenticate');
$registry->setObject('urlProcessor', 'url');
$registry->getObject('url')->getURLData();
//Settings
include 'config.php';
//create a database connection
$registry->getObject('db')->newConnection($configs['db_host_sn'], $configs['db_user_sn'], $configs['db_pass_sn'], $configs['db_name_sn']);
// store settings in our registry
$settingsSQL = "SELECT `key`, `value` FROM settings";
$registry->getObject('db')->executeQuery($settingsSQL);
while ($setting = $registry->getObject('db')->getRows()) {
$registry->setSetting($setting['value'], $setting['key']);
}
//var_dump(session_status());
//header('location: /geoboxx/social2/index.php');
//Check if logged in
$registry->getObject('authenticate')->checkForAuthentication();
//The homepage for the network
$registry->getObject('template')->getPage()->addTag('sitename', $registry->getSetting('sitename'));
$registry->getObject('template')->getPage()->addTag('baseurl', $registry->getSetting('baseurl'));