<![CDATA[ Could not load DBAPI class error in WordPress after updating to Evo 1.0.15 - My Forums]]> https://forums.modx.com/thread/?thread=95940 <![CDATA[Could not load DBAPI class error in WordPress after updating to Evo 1.0.15]]> https://forums.modx.com/thread/95940/could-not-load-dbapi-class-error-in-wordpress-after-updating-to-evo-1-0-15#dis-post-519257
Could not load DBAPI class.

Any ideas?

Here is the code I'm using in my WP theme:


define('MODX_BASE_PATH', dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/');

//define("IN_ETOMITE_PARSER", "true"); // provides compatibility with etomite 0.6 and maybe later versions
define("IN_PARSER_MODE", "true");
define("IN_MANAGER_MODE", "false");

if (!defined('MODX_API_MODE')) {
    define('MODX_API_MODE', true);
}

// initialize the variables prior to grabbing the config file
$GLOBALS['database_type'] = 'mysql';
$GLOBALS['database_server'] = 'mysql.xxx.com';
$GLOBALS['database_user'] = 'xxx';
$GLOBALS['database_password'] = 'xxx';
$GLOBALS['dbase'] = 'xxx_modx';
$GLOBALS['table_prefix'] = 'modx_';
$GLOBALS['base_url'] = 'http://www.xxx.com/';
$GLOBALS['base_path'] = '/home/xxx/xxx/';
define('MODX_BASE_URL', $GLOBALS['base_url']);
define('MODX_SITE_URL', $GLOBALS['base_url']);

$ipath = ini_get('include_path');
ini_set('include_path', $ipath . ':' . $GLOBALS['base_path']);

// initiate a new document parser
include_once($GLOBALS['base_path'].'manager/includes/document.parser.class.inc.php');
$GLOBALS['modx'] = new DocumentParser;
$modx =& $GLOBALS['modx'];
$etomite = &$GLOBALS['modx']; // for backward compatibility

// set some parser options
$modx->minParserPasses = 1; // min number of parser recursive loops or passes
$modx->maxParserPasses = 10; // max number of parser recursive loops or passes
$modx->dumpSQL = false;
$modx->dumpSnippets = false; // feed the parser the execution start time
$modx->tstart = $tstart;

$modx->getSettings();
$modx->documentMethod = 'id';
$modx->documentIdentifier = 8; // modx page ID that links to wordpress
]]>
lt_dan Jan 26, 2015, 06:39 PM https://forums.modx.com/thread/95940/could-not-load-dbapi-class-error-in-wordpress-after-updating-to-evo-1-0-15#dis-post-519257
<![CDATA[Re: Could not load DBAPI class error in WordPress after updating to Evo 1.0.15]]> https://forums.modx.com/thread/95940/could-not-load-dbapi-class-error-in-wordpress-after-updating-to-evo-1-0-15#dis-post-519553 Quote from: lt_dan at Jan 30, 2015, 10:31 AM
Thanks for the help. So, I would replace lines 27-30 in my code with the code you provided?

I think that everything up to line 40 needs to go (but not sure, missing a bit of context - what happens after).]]>
danilocuculic Jan 30, 2015, 08:42 AM https://forums.modx.com/thread/95940/could-not-load-dbapi-class-error-in-wordpress-after-updating-to-evo-1-0-15#dis-post-519553
<![CDATA[Re: Could not load DBAPI class error in WordPress after updating to Evo 1.0.15]]> https://forums.modx.com/thread/95940/could-not-load-dbapi-class-error-in-wordpress-after-updating-to-evo-1-0-15#dis-post-519542 lt_dan Jan 30, 2015, 04:31 AM https://forums.modx.com/thread/95940/could-not-load-dbapi-class-error-in-wordpress-after-updating-to-evo-1-0-15#dis-post-519542 <![CDATA[Re: Could not load DBAPI class error in WordPress after updating to Evo 1.0.15]]> https://forums.modx.com/thread/95940/could-not-load-dbapi-class-error-in-wordpress-after-updating-to-evo-1-0-15#dis-post-519535 Quote from: lt_dan at Jan 27, 2015, 12:39 AM
but today when I updated a site to Evo 1.0.15 WP now gives me this error:
Could not load DBAPI class.
Any ideas? Here is the code I'm using in my WP theme: (...)

Bootstrap code for MODX core/parser as of 1.0.13 (from assets/<folder>, change location with dots in first two lines):
include_once("../cache/siteManager.php");
define('MODX_API_INC', '../../'.MGR_DIR.'/includes/');
require_once(MODX_API_INC.'protect.inc.php');
require_once(MODX_API_INC.'config.inc.php');
define('MODX_API_MODE', true);
startCMSSession();
include_once(MODX_API_INC.'document.parser.class.inc.php');
$modx = new DocumentParser;
$modx->db->connect();
$modx->getSettings(); // provide the $modx->documentMap and user settings
]]>
danilocuculic Jan 30, 2015, 02:45 AM https://forums.modx.com/thread/95940/could-not-load-dbapi-class-error-in-wordpress-after-updating-to-evo-1-0-15#dis-post-519535