当前位置: 首页>>代码示例>>PHP>>正文


PHP JFactory::container方法代码示例

本文整理汇总了PHP中JFactory::container方法的典型用法代码示例。如果您正苦于以下问题:PHP JFactory::container方法的具体用法?PHP JFactory::container怎么用?PHP JFactory::container使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JFactory的用法示例。


在下文中一共展示了JFactory::container方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: restoreFactoryState

 /**
  * Sets the Factory pointers
  *
  * @return  void
  *
  * @since   12.1
  */
 protected function restoreFactoryState()
 {
     JFactory::$application = $this->_stashedFactoryState['application'];
     JFactory::$config = $this->_stashedFactoryState['config'];
     JFactory::$container = $this->_stashedFactoryState['container'];
     JFactory::$dates = $this->_stashedFactoryState['dates'];
     JFactory::$session = $this->_stashedFactoryState['session'];
     JFactory::$language = $this->_stashedFactoryState['language'];
     JFactory::$document = $this->_stashedFactoryState['document'];
     JFactory::$acl = $this->_stashedFactoryState['acl'];
     JFactory::$mailer = $this->_stashedFactoryState['mailer'];
     JFactory::$database = $this->_stashedFactoryState['database'];
 }
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:20,代码来源:case.php

示例2: dirname

<?php

/**
 * @package     Joomla.Installation
 * @subpackage  Application
 *
 * @copyright   Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
// Define the base path and require the other defines
define('JPATH_BASE', dirname(__DIR__));
require_once __DIR__ . '/defines.php';
// Launch the application
require_once __DIR__ . '/framework.php';
// Register the Installation application
JLoader::registerPrefix('Installation', JPATH_INSTALLATION);
// Register the application's router due to non-standard include
JLoader::register('JRouterInstallation', __DIR__ . '/router.php');
// Instantiate the dependency injection container
JFactory::$container = (new \Joomla\DI\Container())->registerServiceProvider(new InstallationServiceProviderApplication())->registerServiceProvider(new InstallationServiceProviderSession())->registerServiceProvider(new \Joomla\Cms\Service\Provider\Dispatcher())->registerServiceProvider(new \Joomla\Cms\Service\Provider\Database());
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:21,代码来源:bootstrap.php

示例3: testActivateUser

 /**
  * Testing activateUser().
  *
  * @param   string   $activation  Activation string
  * @param   boolean  $expected    Expected params
  *
  * @dataProvider casesActivateUser
  * @covers  JUserHelper::activateUser
  * @return  void
  *
  * @since   12.3
  */
 public function testActivateUser($activation, $expected)
 {
     // Configure the container
     $container = (new \Joomla\DI\Container())->set('dispatcher', $this->getMockDispatcher())->set('db', static::$driver);
     JFactory::$container = $container;
     $this->assertEquals(JUserHelper::activateUser($activation), $expected);
 }
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:19,代码来源:JUserHelperTest.php

示例4: getContainer

 /**
  * Get a container object
  *
  * Returns the global service container object, only creating it if it doesn't already exist.
  *
  * @return  Container
  *
  * @since   4.0
  */
 public static function getContainer()
 {
     if (!self::$container) {
         self::$container = self::createContainer();
     }
     return self::$container;
 }
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:16,代码来源:factory.php


注:本文中的JFactory::container方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。