получить доступ к Joomla сессии в php - codeigniter
Мне нужно проверить, вошел ли пользователь в CodeIgniter или нет.
Логин происходит на сайте Joomla.
Я попытался следующее для инициализации Joomla.
<code>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' ); </code>
Но я получил это сообщение:
No configuration file found and no installation code available. Exiting...
Joomla установлена на root и codeigniter на root / продвинутый
Я звоню код в контроллере.
Как я могу решить это?
EDIT:
Теперь я получаю эту ошибку:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: BM
Filename: core/CodeIgniter.php
Line Number: 364
Edit
Мой контроллер выглядит так
<code>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' ); } </code>
Directory Structure
<code>--Public_html --Joomla Istallation files --Advanced [This is a folder ,i installed codeignitor on this folder] </code>
Так что путь к Joomlasite.com/
и путь к Codeignitor являетсяsite.com/advanced
More about the Error
Строка 364 на Codeignitor Core говорит, что:
<code>// Mark a benchmark end point $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); </code>
и я вижу следующее при запуске ядра CI
<code> $BM =& load_class('Benchmark', 'core'); $BM->mark('total_execution_time_start'); $BM->mark('loading_time:_base_classes_start'); </code>