Not sure if this is the right place to post, so please move if not.
2.0RC3 and trying to get the CB User name.
When using the example code from
www.joomlapolis.com/support/tutorials/120-api-usage/18357-including-cb-api-for-usage-outside-of-cb
:
global $_CB_framework, $mainframe;
if ( defined( 'JPATH_ADMINISTRATOR' ) ) {
if ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) {
echo 'CB not installed!';
return;
}
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
} else {
if ( ! file_exists( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' ) ) {
echo 'CB not installed!';
return;
}
include_once( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' );
}
I get:
PHP Fatal error: Call to a member function getCfg() on a non-object, pointing to the line:
if ( ! file_exists( $mainframe->getCfg( 'absolute_path' ) . ....
when running 'php file.php' from shell (on the Joomla/CB server)
From within CB I get a 500 Internal server error