Initializing eZ when not using CLI or eZ publish

Initializing eZ when not using CLI or eZ publish

Monday 14 May 2007 6:54:26 am - 2 replies

Author Message

Michael Maclean

Tuesday 15 May 2007 2:56:41 am

The minimum that I've managed to get away with so far has been:

include_once('lib/ezutils/classes/ezini.php');
include_once('lib/ezutils/classes/ezsys.php');
include_once('lib/ezdb/classes/ezdb.php');
include_once('access.php');
include_once( "lib/ezutils/classes/ezdebugsetting.php" );
include_once( "kernel/classes/ezcontentobjecttreenode.php" );

/*!
  Dummy function, required by some scripts in eZ publish.
*/
function eZUpdateDebugSettings( $useDebug = null )
{
}

$ini = eZINI::instance();

// This will get the default siteaccess name, or you can hard code it if you want
// $siteaccess = 'accessname';
$siteaccess = $ini->variable( 'SiteSettings', 'DefaultAccess' );
$access = array( 'name' => $siteaccess, 'type' => EZ_ACCESS_TYPE_DEFAULT );
$access = changeAccess( $access );

$node = eZContentObjectTreeNode::fetch( 2 );
var_dump($node);

You will probably need to change the paths to the includes.

eZpedia community documentation project | http://ezpedia.org

Atle Pedersen

Thursday 24 May 2007 6:23:59 am

Thank you Michael, this was excatly what I needed.

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.