5

Since the last update of joomla to 3.8, i can't call the following function via "NON-Joomla-Script".

  $db=JFactory::getDBO();

I get the following Error Message:

Fatal error: Uncaught Error: Class 'JFactory' not found in

I was loading several Joomla-Classes via require_once and this was working since Joomla 3.7.x, e.g:

  require_once("[RootToPath]/libraries/joomla/database/factory.php");

Which Joomla-Classes do I have to load, to use this class again?

Thanks for your help.

andreas
  • 16,357
  • 12
  • 72
  • 76
VolleyTom
  • 71
  • 1
  • 3

2 Answers2

2

classmap.php is key as mentioned by Sven. In terms of specifically leveraging it, this works for me:

define( '_JEXEC', 1 );
define( 'JPATH_BASE', '/Full/Server/Path/To/Joomla/Folder' );
require_once ( JPATH_BASE . '/includes/defines.php' );
require_once ( JPATH_BASE . '/includes/framework.php' );

Gives access to JFactory and the other 'J' Items as framework.php loads the classmap file.

Dayo
  • 12,413
  • 5
  • 52
  • 67
  • Old topic but I am new on Joomla, so please help.. I am getting following error email after trying your solution. Error: Failed to start application: Failed to start application – tanveer javaid Apr 10 '19 at 19:43
0

With Joomla 3.8 the class structure changed. Jxxx was replaced with "normal" class names. You need to do some class mapping so old Jxxx names can be located again.

This class should get you started: https://github.com/joomla/joomla-cms/blob/staging/libraries/classmap.php

Sven Bluege
  • 1,418
  • 1
  • 10
  • 19