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


PHP JFactory::session方法代码示例

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


在下文中一共展示了JFactory::session方法的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::$session = $this->getMockSession();
     $this->object = new JTableCategory(self::$dbo);
 }
开发者ID:raquelsa,项目名称:Joomla,代码行数:11,代码来源:JTableNestedTest.php

示例3: getSession

 /**
  * Get a session object
  *
  * Returns the global {@link JSession} object, only creating it
  * if it doesn't already exist.
  *
  * @param array An array containing session options
  * @return object JSession
  */
 public static function getSession($options = array())
 {
     if (!is_object(JFactory::$session)) {
         JFactory::$session = JFactory::_createSession($options);
     }
     return JFactory::$session;
 }
开发者ID:joebushi,项目名称:joomla,代码行数:16,代码来源:factory.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   12.1
  */
 protected function setUp()
 {
     parent::setUp();
     $this->saveFactoryState();
     // Set the session object for JUserHelper::addUserToGroup()
     JFactory::$session = $this->getMockSession();
 }
开发者ID:klas,项目名称:joomla-cms,代码行数:15,代码来源:JUserHelperTest.php

示例5: __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

示例6: testCalendar

 /**
  * Tests JHtml::calendar() method with and without 'readonly' attribute.
  */
 public function testCalendar()
 {
     // Create a world for the test
     jimport('joomla.session.session');
     jimport('joomla.application.application');
     jimport('joomla.document.document');
     $cfg = new JObject();
     JFactory::$session = $this->getMock('JSession', array('_start'));
     JFactory::$application = $this->getMock('ApplicationMock');
     JFactory::$config = $cfg;
     JFactory::$application->expects($this->any())->method('getTemplate')->will($this->returnValue('atomic'));
     $cfg->live_site = 'http://example.com';
     $cfg->offset = 'Europe/Kiev';
     $_SERVER['HTTP_USER_AGENT'] = 'Test Browser';
     // two sets of test data
     $test_data = array('date' => '2010-05-28 00:00:00', 'friendly_date' => 'Friday, 28 May 2010', 'name' => 'cal1_name', 'id' => 'cal1_id', 'format' => '%Y-%m-%d', 'attribs' => array());
     $test_data_ro = array_merge($test_data, array('attribs' => array('readonly' => 'readonly')));
     foreach (array($test_data, $test_data_ro) as $data) {
         // Reset the document
         JFactory::$document = JDocument::getInstance('html', array('unique_key' => serialize($data)));
         $input = JHtml::calendar($data['date'], $data['name'], $data['id'], $data['format'], $data['attribs']);
         $this->assertEquals((string) $xml->input['title'], $data['friendly_date'], 'Line:' . __LINE__ . ' The calendar input should have `title == "' . $data['friendly_date'] . '"`');
         $this->assertEquals((string) $xml->input['name'], $data['name'], 'Line:' . __LINE__ . ' The calendar input should have `name == "' . $data['name'] . '"`');
         $this->assertEquals((string) $xml->input['id'], $data['id'], 'Line:' . __LINE__ . ' The calendar input should have `id == "' . $data['id'] . '"`');
         $head_data = JFactory::getDocument()->getHeadData();
         if (!isset($data['attribs']['readonly']) || !$data['attribs']['readonly'] === 'readonly') {
             $this->assertArrayHasKey('/media/system/js/calendar.js', $head_data['scripts'], 'Line:' . __LINE__ . ' JS file "calendar.js" should be loaded');
             $this->assertArrayHasKey('/media/system/js/calendar-setup.js', $head_data['scripts'], 'Line:' . __LINE__ . ' JS file "calendar-setup.js" should be loaded');
         }
     }
 }
开发者ID:realityking,项目名称:oldunittests,代码行数:34,代码来源:JHtmlTest.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   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

示例8: getSession

 /**
  * Get a session object
  *
  * Returns the global {@link JSession} object, only creating it
  * if it doesn't already exist.
  *
  * @param array $options An array containing session options
  *
  * @return JSession object
  */
 public static function getSession($options = array())
 {
     if (!self::$session) {
         self::$session = self::_createSession($options);
     }
     return self::$session;
 }
开发者ID:Joomla-on-NoSQL,项目名称:LaMojo,代码行数:17,代码来源:factory.php

示例9: 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->saveFactoryState();
     JFactory::$application = $this->getMockCmsApp();
     JFactory::$session = $this->getMockSession();
     $this->id = bin2hex(random_bytes(8));
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:14,代码来源:cache.php

示例10: __construct

 /**
  * Constructor.
  *
  * @since   3.2
  */
 public function __construct()
 {
     parent::__construct();
     // Overrides application config and set the configuration.php file so the send function will work
     JFactory::$config = null;
     JFactory::getConfig(JPATH_SITE . '/configuration.php');
     JFactory::$session = null;
 }
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:13,代码来源:email.php

示例11: __construct

 /**
  * Constructor: Deletes the default installation config file and recreates it with the good config file.
  *
  * @since  3.1
  */
 public function __construct()
 {
     // Overrides application config and set the configuration.php file so tokens and database works
     JFactory::$config = null;
     JFactory::getConfig(JPATH_SITE . '/configuration.php');
     JFactory::$session = null;
     parent::__construct();
 }
开发者ID:Tommar,项目名称:remate,代码行数:13,代码来源:languages.php

示例12: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   3.4
  */
 protected function setUp()
 {
     parent::setUp();
     $app = $this->getMockCmsApp();
     JFactory::$application = $app;
     JFactory::$session = $this->getMockSession();
     $this->object = new JComponentRouterViewInspector($app, $app->getMenu());
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:16,代码来源:JComponentRouterViewTest.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.4
  */
 protected function setUp()
 {
     parent::setUp();
     $this->saveFactoryState();
     JFactory::$application = $this->getMockCmsApp();
     JFactory::$session = $this->getMockSession();
     require_once dirname(__DIR__) . '/controller/JCacheControllerRaw.php';
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:16,代码来源:JCacheStorageMainTest.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()
 {
     parent::setUp();
     // Get the mocks
     $this->saveFactoryState();
     JFactory::$session = $this->getMockSession();
     $this->object = new JTableLanguage(self::$driver);
 }
开发者ID:ZerGabriel,项目名称:joomla-platform,代码行数:14,代码来源:JTableLanguageTest.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()
 {
     parent::setUp();
     // Get the mocks
     $this->saveFactoryState();
     JFactory::$session = $this->getMockSession();
     $this->object = new JTableCorecontent(static::$driver);
 }
开发者ID:klas,项目名称:joomla-cms,代码行数:16,代码来源:JTableCorecontentTest.php


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