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


PHP Csrf::setFrontendMode方法代碼示例

本文整理匯總了PHP中Cx\Core\Csrf\Controller\Csrf::setFrontendMode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Csrf::setFrontendMode方法的具體用法?PHP Csrf::setFrontendMode怎麽用?PHP Csrf::setFrontendMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cx\Core\Csrf\Controller\Csrf的用法示例。


在下文中一共展示了Csrf::setFrontendMode方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 /**
  * Loading ClassLoader, EventManager, Env, DB, API and InitCMS
  * (Env, API and InitCMS are deprecated)
  * @todo Remove deprecated elements
  * @todo Remove usage of globals
  * @global array $_CONFIG
  * @global type $_FTPCONFIG
  * @global type $objDatabase
  * @global type $objInit
  */
 protected function init()
 {
     global $objDatabase, $objInit, $_DBCONFIG, $_CONFIG;
     $this->tryToSetMemoryLimit();
     /**
      * Include all the required files.
      * @todo Remove API.php, it should be unnecessary
      */
     $this->cl->loadFile($this->codeBaseCorePath . '/API.php');
     // Temporary fix until all GET operation requests will be replaced by POSTs
     if ($this->mode != self::MODE_BACKEND) {
         \Cx\Core\Csrf\Controller\Csrf::setFrontendMode();
     }
     // Set database connection details
     $objDb = new \Cx\Core\Model\Model\Entity\Db();
     $objDb->setHost($_DBCONFIG['host']);
     $objDb->setName($_DBCONFIG['database']);
     $objDb->setTablePrefix($_DBCONFIG['tablePrefix']);
     $objDb->setDbType($_DBCONFIG['dbType']);
     $objDb->setCharset($_DBCONFIG['charset']);
     $objDb->setCollation($_DBCONFIG['collation']);
     $objDb->setTimezone($_DBCONFIG['timezone']);
     // Set database user details
     $objDbUser = new \Cx\Core\Model\Model\Entity\DbUser();
     $objDbUser->setName($_DBCONFIG['user']);
     $objDbUser->setPassword($_DBCONFIG['password']);
     // Initialize database connection
     $this->db = new \Cx\Core\Model\Db($objDb, $objDbUser, $this->getComponent('Cache')->getCacheDriver());
     $objDatabase = $this->db->getAdoDb();
     \Env::set('db', $objDatabase);
     $em = $this->db->getEntityManager();
     \Env::set('pageguard', new \PageGuard($this->db->getAdoDb()));
     \DBG::set_adodb_debug_mode();
     $this->eventManager = new \Cx\Core\Event\Controller\EventManager($this);
     new \Cx\Core\Event\Controller\ModelEventWrapper($this);
     $this->eventManager->addEvent('preComponent');
     $this->eventManager->addEvent('postComponent');
     // Initialize base system
     // TODO: Get rid of InitCMS class, merge it with this class instead
     $objInit = new \InitCMS($this->mode == self::MODE_FRONTEND ? 'frontend' : 'backend', \Env::get('em'));
     \Env::set('init', $objInit);
     //$bla = $em->getRepository('Cx\Core\ContentManager\Model\Entity\Page');
     //$bla->findAll();
 }
開發者ID:Cloudrexx,項目名稱:cloudrexx,代碼行數:54,代碼來源:Cx.class.php


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