當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Registry::getObject方法代碼示例

本文整理匯總了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();
 }
開發者ID:GerashenkoVladimir,項目名稱:students2.0,代碼行數:13,代碼來源:AbstractController.php

示例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);
 }
開發者ID:simontakite,項目名稱:cookbooks,代碼行數:12,代碼來源:controller.php

示例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();
     }
 }
開發者ID:BorisMatonickin,項目名稱:bookstore,代碼行數:17,代碼來源:Registry.php

示例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);
開發者ID:simontakite,項目名稱:cookbooks,代碼行數:31,代碼來源:index.php

示例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();
}
開發者ID:BorisMatonickin,項目名稱:bookstore,代碼行數:31,代碼來源:index.php

示例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'));
開發者ID:maxzeroedge,項目名稱:social,代碼行數:31,代碼來源:index.php


注:本文中的Registry::getObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。