在php-codeigniter中访问joomla会话
我需要检查用户是否已登录CodeIgniter 登录正在Joomla站点中进行 我尝试了以下方法来初始化joomla在php-codeigniter中访问joomla会话,php,codeigniter,session,joomla,Php,Codeigniter,Session,Joomla,我需要检查用户是否已登录CodeIgniter 登录正在Joomla站点中进行 我尝试了以下方法来初始化joomla define( '_JEXEC', 1 ); define( 'DS', DIRECTORY_SEPARATOR ); define('JPATH_BASE', dirname(__FILE__) ); require_once ("../includes/defines.php"); require_once ("../includes/framework.php"); $
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' );
但我得到了这个信息:
找不到配置文件,也没有可用的安装代码。
退出
Joomla安装在root上,codeigniter安装在root/advanced上
我正在调用控制器中的代码
我怎样才能解决这个问题
编辑:
现在我得到了这个错误:
遇到一个PHP错误
严重性:通知
消息:未定义变量:BM
文件名:core/CodeIgniter.php
电话号码:364
编辑
我的控制器看起来像这样
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
有关错误的详细信息
共点火器芯上的第364行表示:
// Mark a benchmark end point
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end');
我可以在CI core的开始部分看到以下内容
$BM =& load_class('Benchmark', 'core');
$BM->mark('total_execution_time_start');
$BM->mark('loading_time:_base_classes_start');
我知道这是一篇老文章,但您需要确保JPATH_的基点指向configuration.php文件所在的目录。我会使用绝对路径而不是相对路径。请参阅此线程,这可能会有帮助:@AlphaMale
core/CodeIgniter.php
…当我包含joomla的framework.php
文件时会发生这种情况…请您显示您的代码好吗。@AlphaMale没有太多代码要显示。。只有一个控制器。。我认为joomla中的CodeIgniter有一些问题。。不,告诉我BM变量在哪里??