1. <i id='UQmEF'><tr id='UQmEF'><dt id='UQmEF'><q id='UQmEF'><span id='UQmEF'><b id='UQmEF'><form id='UQmEF'><ins id='UQmEF'></ins><ul id='UQmEF'></ul><sub id='UQmEF'></sub></form><legend id='UQmEF'></legend><bdo id='UQmEF'><pre id='UQmEF'><center id='UQmEF'></center></pre></bdo></b><th id='UQmEF'></th></span></q></dt></tr></i><div id='UQmEF'><tfoot id='UQmEF'></tfoot><dl id='UQmEF'><fieldset id='UQmEF'></fieldset></dl></div>

      <small id='UQmEF'></small><noframes id='UQmEF'>

          <bdo id='UQmEF'></bdo><ul id='UQmEF'></ul>
        <legend id='UQmEF'><style id='UQmEF'><dir id='UQmEF'><q id='UQmEF'></q></dir></style></legend>
        <tfoot id='UQmEF'></tfoot>

      1. 在 php 中访问 joomla 会话 - codeigniter

        时间:2023-10-16

      2. <small id='ZS2Vv'></small><noframes id='ZS2Vv'>

            <i id='ZS2Vv'><tr id='ZS2Vv'><dt id='ZS2Vv'><q id='ZS2Vv'><span id='ZS2Vv'><b id='ZS2Vv'><form id='ZS2Vv'><ins id='ZS2Vv'></ins><ul id='ZS2Vv'></ul><sub id='ZS2Vv'></sub></form><legend id='ZS2Vv'></legend><bdo id='ZS2Vv'><pre id='ZS2Vv'><center id='ZS2Vv'></center></pre></bdo></b><th id='ZS2Vv'></th></span></q></dt></tr></i><div id='ZS2Vv'><tfoot id='ZS2Vv'></tfoot><dl id='ZS2Vv'><fieldset id='ZS2Vv'></fieldset></dl></div>
              <tbody id='ZS2Vv'></tbody>

            <legend id='ZS2Vv'><style id='ZS2Vv'><dir id='ZS2Vv'><q id='ZS2Vv'></q></dir></style></legend>

                <tfoot id='ZS2Vv'></tfoot>
                • <bdo id='ZS2Vv'></bdo><ul id='ZS2Vv'></ul>
                  本文介绍了在 php 中访问 joomla 会话 - codeigniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要在 CodeIgniter 中检查用户是否已登录.

                  I need to check if the user is logged in or not in CodeIgniter.

                  登录正在 Joomla 站点中进行.

                  The login is happening in Joomla site.

                  我尝试了以下方法来初始化 joomla.

                  I tried the following to initialize joomla .

                  define( '_JEXEC', 1 );
                  define( 'DS', DIRECTORY_SEPARATOR );
                  define('JPATH_BASE', dirname(__FILE__) );
                  
                  require_once ("../includes/defines.php");
                  require_once ("../includes/framework.php");
                  
                  $mainframe =& JFactory::getApplication("site");
                  $mainframe->initialise();
                  
                  $session =& JFactory::getSession();
                  $user = $session->get( 'user' );
                  

                  但我收到了这条消息:

                  未找到配置文件,也没有可用的安装代码.退出...

                  No configuration file found and no installation code available. Exiting...

                  Joomla 安装在 root 上,codeigniter 安装在 root/advanced 上

                  Joomla is installed on root and codeigniter on root/advanced

                  我正在调用控制器中的代码.

                  I am calling the code in controller.

                  我该如何解决这个问题?

                  How can I solve this?

                  现在我收到此错误:

                  遇到 PHP 错误

                  严重性:注意

                  消息:未定义变量:BM

                  Message: Undefined variable: BM

                  文件名:core/CodeIgniter.php

                  Filename: core/CodeIgniter.php

                  行号:364

                  编辑

                  我的控制器看起来像这样

                  My Controller look like this

                  function is_logged()
                      {
                  
                                  define( '_JEXEC', 1 );
                              define( 'JPATH_BASE', '../');
                              define( 'DS', DIRECTORY_SEPARATOR );
                  
                          require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
                          require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
                          //require_once ("../libraries/joomla/user/authentication.php");
                          $mainframe =& JFactory::getApplication("site");
                          $mainframe->initialise();
                  
                          $session =& JFactory::getSession();
                          $user = $session->get( 'user' );
                  
                  
                  
                      }
                  

                  目录结构

                  --Public_html
                    --Joomla Istallation files
                    --Advanced [This is a folder ,i installed codeignitor on this folder]
                  

                  所以 joomla 的路径是 site.com/ 而 Codeignitor 的路径是 site.com/advanced

                  So the path to joomla is site.com/ and path to Codeignitor is site.com/advanced

                  关于错误的更多信息

                  Codeignitor Core 上的第 364 行说:

                  Line 364 on Codeignitor Core says that :

                  // Mark a benchmark end point
                      $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end');
                  

                  并且我可以在 CI 核心启动时看到以下内容

                  and i can see the following on the starting of CI core

                      $BM =& load_class('Benchmark', 'core');
                      $BM->mark('total_execution_time_start');
                      $BM->mark('loading_time:_base_classes_start');
                  

                  推荐答案

                  我知道这是一篇旧帖子,但您需要确保 JPATH_BASE 指向您的 configuration.php 文件所在的目录.我会使用绝对路径而不是相对路径.

                  I know its an old post but you need to make sure JPATH_BASE points to the directory where your configuration.php file is. I would use the absolute path rather than a relative path.

                  这篇关于在 php 中访问 joomla 会话 - codeigniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用框架将独立脚本连接到 joomla DB 下一篇:Joomla 获取页面 ID

                  相关文章

                    <bdo id='3VnUK'></bdo><ul id='3VnUK'></ul>
                      <tfoot id='3VnUK'></tfoot>

                    1. <small id='3VnUK'></small><noframes id='3VnUK'>

                    2. <i id='3VnUK'><tr id='3VnUK'><dt id='3VnUK'><q id='3VnUK'><span id='3VnUK'><b id='3VnUK'><form id='3VnUK'><ins id='3VnUK'></ins><ul id='3VnUK'></ul><sub id='3VnUK'></sub></form><legend id='3VnUK'></legend><bdo id='3VnUK'><pre id='3VnUK'><center id='3VnUK'></center></pre></bdo></b><th id='3VnUK'></th></span></q></dt></tr></i><div id='3VnUK'><tfoot id='3VnUK'></tfoot><dl id='3VnUK'><fieldset id='3VnUK'></fieldset></dl></div>

                    3. <legend id='3VnUK'><style id='3VnUK'><dir id='3VnUK'><q id='3VnUK'></q></dir></style></legend>