I found this EE Bootstrap unit: https://github.com/blocka/ExpressionEngine-Bootstrap
It "bootstraps" the EE environment, so you use the EE "super object". However, I'm running into problems trying to use it with EE 2.5.2.
I have set my system_path as required. The script is trying to include Compat.php, which isn't in 2.5.2, so I comment out that line. The script is also trying to include Base5.php, which also is not in 2.5.2, so I comment out that line.
Now, when running, I get an exception: "Class 'Controller' not found" at this line
class A extends Controller {
Any ideas how to fix this for 2.5.2?
Here's the source code that I have:
<?php
if (!isset($system_path)) {
$system_path = './na_cms/';
}
$assign_to_config['enable_query_strings'] = TRUE;
$assign_to_config['subclass_prefix'] = 'EE_';
if (realpath($system_path) !== FALSE)
{
$system_path = realpath($system_path).'/';
}
// ensure there's a trailing slash
$system_path = rtrim($system_path, '/').'/';
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('EXT', '.php');
define('APPPATH', $system_path.'expressionengine/');
define('FCPATH', str_replace(SELF, '', __FILE__));
define('SYSDIR', trim(strrchr(trim(str_replace("\\", "/", $system_path), '/'), '/'), '/'));
if(!defined('UTF8_ENABLED')) define('UTF8_ENABLED', false);
if(!defined('CI_VERSION')) define('CI_VERSION', '2.0.1');
//define('AJAX_REQUEST',false);
define('DEBUG',false);
require(BASEPATH.'core/Common'.EXT);
// require(BASEPATH.'core/Compat'.EXT);
require(APPPATH.'config/constants'.EXT);
$CFG =& load_class('Config', 'core');
$URI =& load_class('URI', 'core');
$IN =& load_class('Input', 'core');
$OUT =& load_class('Output', 'core');
$LANG =& load_class('Lang', 'core');
// require(BASEPATH.'core/Base5'.EXT);
$loader = load_class('Loader', 'core');
// Load the base controller class
require BASEPATH.'core/Controller'.EXT;
class A extends Controller {
}
$EE = new A;
$EE->core->_initialize_core();