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


PHP JFactory::application方法代碼示例

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


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

示例1: __construct

 /**
  * Class constructor.
  *
  * @since   3.1
  */
 public function __construct()
 {
     // Run the parent constructor
     parent::__construct();
     // Load and set the dispatcher
     $this->loadDispatcher();
     // Enable sessions by default.
     if (is_null($this->config->get('session'))) {
         $this->config->set('session', true);
     }
     // Set the session default name.
     if (is_null($this->config->get('session_name'))) {
         $this->config->set('session_name', 'installation');
     }
     // Create the session if a session name is passed.
     if ($this->config->get('session') !== false) {
         $this->loadSession();
         // Register the session with JFactory
         JFactory::$session = $this->getSession();
     }
     // Store the debug value to config based on the JDEBUG flag
     $this->config->set('debug', JDEBUG);
     // Register the config to JFactory
     JFactory::$config = $this->config;
     // Register the application to JFactory
     JFactory::$application = $this;
     // Register the application name
     $this->_name = 'installation';
     // Register the client ID
     $this->_clientId = 2;
     // Set the root in the URI one level up.
     $parts = explode('/', JUri::base(true));
     array_pop($parts);
     JUri::root(null, implode('/', $parts));
 }
開發者ID:shoffmann52,項目名稱:install-from-web-server,代碼行數:40,代碼來源:web.php

示例2: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->saveFactoryState();
     JFactory::$application = $this->getMockWeb();
     $this->object = new JDocumentFeed();
 }
開發者ID:b-dur,項目名稱:joomla-cms,代碼行數:11,代碼來源:JDocumentFeedTest.php

示例3: __construct

 /**
  * Class constructor.
  *
  * @param   mixed  $input   An optional argument to provide dependency injection for the application's
  *                          input object.  If the argument is a JInput object that object will become
  *                          the application's input object, otherwise a default input object is created.
  * @param   mixed  $config  An optional argument to provide dependency injection for the application's
  *                          config object.  If the argument is a JRegistry object that object will become
  *                          the application's config object, otherwise a default config object is created.
  * @param   mixed  $client  An optional argument to provide dependency injection for the application's
  *                          client object.  If the argument is a JApplicationWebClient object that object will become
  *                          the application's client object, otherwise a default client object is created.
  */
 public function __construct(JInput $input = null, JRegistry $config = null, JApplicationWebClient $client = null)
 {
     parent::__construct($input, $config, $client);
     $this->config->set('session', false);
     // Inject the application into JFactory
     JFactory::$application = $this;
 }
開發者ID:realityking,項目名稱:jd12dk,代碼行數:20,代碼來源:web.php

示例4: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   3.5
  */
 protected function setUp()
 {
     parent::setUp();
     $app = $this->getMockCmsApp();
     JFactory::$application = $app;
     $router = new JComponentRouterViewInspector($app, $app->getMenu());
     $router->set('name', 'content');
     $categories = new JComponentRouterViewconfiguration('categories');
     $categories->setKey('id');
     $router->registerView($categories);
     $category = new JComponentRouterViewconfiguration('category');
     $category->setKey('id')->setParent($categories)->setNestable()->addLayout('blog');
     $router->registerView($category);
     $article = new JComponentRouterViewconfiguration('article');
     $article->setKey('id')->setParent($category, 'catid');
     $router->registerView($article);
     $archive = new JComponentRouterViewconfiguration('archive');
     $router->registerView($archive);
     $featured = new JComponentRouterViewconfiguration('featured');
     $router->registerView($featured);
     $form = new JComponentRouterViewconfiguration('form');
     $router->registerView($form);
     $router->menu = new MockJComponentRouterRulesMenuMenuObject();
     $this->object = new JComponentRouterRulesMenuInspector($router);
 }
開發者ID:eshiol,項目名稱:joomla-cms,代碼行數:33,代碼來源:JComponentRouterRulesMenuTest.php

示例5: __construct

	public function __construct(JInput $input = null, JRegistry $config = null, JApplicationWebClient $client = null)
	{
		parent::__construct($input, $config, $client);

		// Load and set the dispatcher
		$this->loadDispatcher();

		// Register the application to JFactory
		JFactory::$application = $this;

		// Enable sessions by default.
		if (is_null($this->config->get('session')))
		{
			$this->config->set('session', true);
		}

		// Set the session default name.
		if (is_null($this->config->get('session_name')))
		{
			$this->config->set('session_name', 'site');
		}

		// Create the session if a session name is passed.
		if ($this->config->get('session') !== false)
		{
			$this->loadSession();

			// Register the session with JFactory
			JFactory::$session = $this->getSession();
		}
	}
開發者ID:BillVGN,項目名稱:PortalPRP,代碼行數:31,代碼來源:attachment.php

示例6: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   3.2
  */
 protected function setUp()
 {
     parent::setUp();
     $this->saveFactoryState();
     JFactory::$application = $this->getMockWeb();
     $this->object = new JUcmContent(JTable::getInstance('Content'), 'com_content.article');
 }
開發者ID:sural98,項目名稱:joomla-cms,代碼行數:15,代碼來源:JUcmContentTest.php

示例7: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   12.1
  */
 protected function setUp()
 {
     parent::setUp();
     $this->saveFactoryState();
     JFactory::$application = $this->getMockCmsApp();
     JFactory::$application->expects($this->any())->method('triggerEvent')->willReturn([]);
 }
開發者ID:Rai-Ka,項目名稱:joomla-cms,代碼行數:15,代碼來源:JUserHelperTest.php

示例8: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   3.2
  */
 protected function setUp()
 {
     parent::setUp();
     $this->saveFactoryState();
     JFactory::$application = $this->getMockWeb();
     $this->object = new JUcmBase('com_content.article');
 }
開發者ID:klas,項目名稱:joomla-cms,代碼行數:15,代碼來源:JUcmBaseTest.php

示例9: __construct

 /**
  * Class constructor.
  *
  * @since   3.1
  */
 public function __construct()
 {
     // Run the parent constructor
     parent::__construct();
     // Load and set the dispatcher
     $this->loadDispatcher();
     // Enable sessions by default.
     if (is_null($this->config->get('session'))) {
         $this->config->set('session', true);
     }
     // Set the session default name.
     if (is_null($this->config->get('session_name'))) {
         $this->config->set('session_name', 'installation');
     }
     // Create the session if a session name is passed.
     if ($this->config->get('session') !== false) {
         $this->loadSession();
         // Register the session with JFactory
         JFactory::$session = $this->getSession();
     }
     // Store the debug value to config based on the JDEBUG flag
     $this->config->set('debug', JDEBUG);
     // Register the config to JFactory
     JFactory::$config = $this->config;
     // Register the application to JFactory
     JFactory::$application = $this;
     // Set the root in the URI based on the application name
     JUri::root(null, str_ireplace('/installation', '', JUri::base(true)));
 }
開發者ID:karimzg,項目名稱:joomla,代碼行數:34,代碼來源:web.php

示例10: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   3.2
  */
 protected function setUp()
 {
     parent::setUp();
     $this->saveFactoryState();
     $this->object = new JHelper();
     JFactory::$application = $this->getMockCmsApp();
 }
開發者ID:SysBind,項目名稱:joomla-cms,代碼行數:15,代碼來源:JHelperTest.php

示例11: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   3.2
  */
 protected function setUp()
 {
     parent::setUp();
     $this->saveFactoryState();
     JFactory::$application = $this->getMockApplication();
     $this->object = new JUcmType();
 }
開發者ID:shoffmann52,項目名稱:install-from-web-server,代碼行數:15,代碼來源:JUcmTypeTest.php

示例12: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->checkAvailability();
     $this->saveFactoryState();
     JFactory::$application = $this->getMockCmsApp();
 }
開發者ID:joomla-projects,項目名稱:media-manager-improvement,代碼行數:13,代碼來源:JCacheTest.php

示例13: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   3.2
  */
 protected function setUp()
 {
     parent::setUp();
     $this->saveFactoryState();
     JFactory::$application = $this->getMockCmsApp();
     JFactory::$session = $this->getMockSession();
 }
開發者ID:joomla-projects,項目名稱:media-manager-improvement,代碼行數:15,代碼來源:JModuleHelperTest.php

示例14: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  */
 protected function setUp()
 {
     $this->saveFactoryState();
     JFactory::$application = $this->getMockCmsApp();
     JFactory::$config = $this->getMockConfig();
     parent::setUp();
 }
開發者ID:joomla-projects,項目名稱:media-manager-improvement,代碼行數:13,代碼來源:JControllerFormTest.php

示例15: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   3.1
  */
 protected function setUp()
 {
     $this->toolbar = JToolbar::getInstance();
     $this->object = $this->toolbar->loadButtonType('link');
     $this->saveFactoryState();
     JFactory::$application = $this->getMockApplication();
 }
開發者ID:karimzg,項目名稱:joomla,代碼行數:15,代碼來源:JToolbarButtonLinkTest.php


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