Author Topic

Łukasz Serwatka

Saturday 05 November 2005 7:05:34 am

Comment44652

Hi,

Look on example scripts in /bin/php/*.php this will give you some overview how to build CLI script.

Small example:

include_once( 'lib/ezutils/classes/ezcli.php' );
include_once( 'kernel/classes/ezscript.php' );

$cli =& eZCLI::instance();
$script =& eZScript::instance();

$script->startup();

$script->initialize();

//Your code goes here
// include_once( 'lib/ezdb/classes/ezdb.php' );
// $db= =& eZDB::instance()
// $result = $db->arrayQuery("SELECT * ...");

$script->shutdown();

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog